cancel
Showing results for 
Search instead for 
Did you mean: 

How to access RAM2 32K memory in STM32L476RG nucleo

paker earth
Associate II
Posted on January 14, 2017 at 15:09

Hi all

I am wondering if I could use the 32K memory.

If somebody know it, pls tell me how to do it.

Because 96K bytes isn't enough for me.

Thank you all in advance.

 0690X000006060HQAQ.png

2 REPLIES 2
Posted on January 14, 2017 at 16:28

This is toolchain-specific.

For gcc and suite I concocted an example here

http://efton.sk/STM32/blinky_ram2.zip

:

- in linker script, RAM2 memory area added and an output section named .ram2 directed to it

- note, that all variables placed in .ram2 are initialized to zero, see FillZeroRam2 in startupxxx.s

- in .c, variables to be placed in .ram have to have __attribute__((section('.ram2')))  added

  to their definition, see delayN

- when generating .bin (or .hex) using objcopy, .ram2 has to be excluded explicitly

  using --remove-section (or -R) option

  JW

S.Ma
Principal
Posted on January 14, 2017 at 19:36

In case of IAR, a #pragma enables a section of C code to allocate variables to be placed in the 32kb. It is similar to the CCM memory for F4. To keep the code clean there should be options in linker file of the toolchain to put the stack area in the RAM2, reducing the #pragmas in the source code...