Skip to main content
ducommun
Associate II
September 5, 2014
Question

How to use External Memory with FreeRTOS (stack, heap in internal SRAM)

  • September 5, 2014
  • 1 reply
  • 1189 views
Posted on September 05, 2014 at 16:39

Hi,

I want to use external SDRAM for data in my project with FreeRTOS.

But I want to keep stack and heap in internal SRAM.

Actually I have two issues :

1) If I use example from ST, stack and heap are placed in external SDRAM which is not very efficient.

2) If you use FreeRTOS, at start it place the stack pointer in internal SRAM and cause a lot of issue because it has been changed before in the startup file in external SDRAM.

Can anyone help me to configure my project with FreeRTOS using external SDRAM memory and keeping stack and heap in internal SRAM ?

Thanks

#freertos-external-memory
This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
September 5, 2014
Posted on September 05, 2014 at 18:01

Using what chip and tool chain? Supposing an F429, but really helps to be specific.

Usually you'd want to define stacks/heaps in either the linker script or assembler start up file. Review your allocator, and if you can specify multiple regions as a pool/arena for the allocation.

Pay attention to the stack pointer used at reset, and the one that might be used subsequently by the C run time, and then later allocated for use by the RTOS tasks.

Pay attention to when the external memory (pins, bus, memory) gets configured, the resources and state of the system when SystemInit() is called.
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..