cancel
Showing results for 
Search instead for 
Did you mean: 

How to combine SRAM and CCM with STM32f429?

lhofstaetter9
Associate II

The Datasheet of the STM32F429 says that this uC has 256 kbyte of RAM, whereas 64kbyte are CCM.

By default the Linker uses only 192kbyte for the heap/stack. I found several articels about how to move some sections to the CCM.

But I would like to know if it is possible to configure the linker script to combine the 192kbyte of SRAM and the 64kbyte of CCM.

How to combine SRAM and CCM with STM32f429?

Background:

I ran out of memory. After some inspection we realized that we really need some more RAM. Extending the existing RAM section in the linker file with the unused 64kbyte of CCM would be a simple and great solution for me.

2 REPLIES 2
S.Ma
Principal

In most tools, the linker has a config file which defines the different memory segments and their nature.

Edit this file to customize. If using cubeMx, maybe this file is overwritten at code generation and its content is indirectly editable in one of CubeMX dialog box.

CCM is core exclusive use (no DMA access), so putting the stack and frequently used access global variables maybe beneficial. Putting interrupt functions in this RAM area may boost performance too (if allowed)

When RAM is not enough, it's time to implement rolling or shared buffers, or C unions when possible.

The MAP file of your toolchain may gives you clues on this.

The memories aren't contiguous and the linker isn't that smart.

Are.these all large static globals? Have you considered using the heap and doing one time dynamic allocation? Putting the stack in CCM?

In Keil it is not that hard to define multiple pools for the heap allocator. For GNU /GCC I expect you'll need to recode _sbrk to cope with the heap and stack being in different memories. ​

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..