Loading...
 
Skip to main content

System Workbench for STM32


RAM function not going into RAM?

Bruno from STMicro helpfully replied on another forum on how to make the ram function work.

Here's a code snippet from the linker script:

/* Initialized data sections goes into RAM, load LMA copy after code */
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
*(.RamFunc) /* .RamFunc sections */

. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >RAM AT> FLASH

When I added the red text to my linker script in that area, the function was placed correctly in RAM and the half-page programming started working.