AnsweredAssumed Answered

STM32CubeMX linker RAM section wrong size?

Question asked by Dave Marples on May 10, 2018
Latest reply on May 16, 2018 by Nawres GHARBI

Hi folks,

 

I just looked at the linker script generated by CubeMX for a STM32F205RB. The bits I'm concerned about;

 

/* Highest address of the user mode stack */ 
_estack = 0x20010000;    /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200;      /* required amount of heap  */
_Min_Stack_Size = 0x400; /* required amount of stack */
 
/* Specify the memory areas */
MEMORY
{
RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 64K
FLASH (rx)      : ORIGIN = 0x8000000, LENGTH = 128K
}

 

The RB does indeed have 64K of RAM, but it's split across SRAM1 and SRAM2. SRAM1 starts are 0x20000000 but should only be 48K long. Unless I've misunderstood something SRAM2 should be a new section starting at 0x2001C000 with length 16K (Figure 16, Pg 68 of the datasheet DocID 15818). At the moment the location of _estack seems to be in memory that doesn't exist, and should really be at 0x2000C000.

 

I suspect this is working due to die sharing but if you're trying to make a reliable product using RAM that's not tested/certified is not a good idea.

 

Did I misunderstand something, or is this a bug in CubeMX?

 

Dave

Outcomes