cancel
Showing results for 
Search instead for 
Did you mean: 

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

ducommun
Associate II
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
1 REPLY 1
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 Venmo
Up vote any posts that you find helpful, it shows what's working..