STM32L467RG configured with only 96kB RAM

Hello,

I’ve just upgraded to the latest stm32 configuration and since the update the RAM of the STM32L476RG, which actually has 128kB of RAM, shows only 96kB.

CONFIGURATION: Redirecting...
PLATFORM: ST STM32 (15.4.1) > ST Nucleo L476RG
HARDWARE: STM32L476RGT6 80MHz, 96KB RAM, 1MB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:

Is that a mistake or is it intentional? Can I change it back to the correct size?

Thank you
Andy

This is currently a trick to make Arduino compile the firmware in the right way. The L476RG does have 128 kByte of RAM, but it is divided between two banks, 96 kilobytes at 0x20000000 and 32 kilobytes at 0x1000000 (refer https://www.st.com/resource/en/datasheet/stm32l476rg.pdf page 20).

See

If you do change it back, e.g. via

board_upload.maximum_ram_size = 131072 

in the platformio.ini, you will see that with the current builder script logic, the firmware will not run, due to initial SP in the vector table being set wrong, since the logic assumes a contiguous RAM memory space, which the L476RG does not have.

If you control the linker script yourself, and it has the right memory sections declared, then this does not matter.

Thank you for your reply.

I’m using mbed OS and used to compile with 128kB RAM and it worked so far (but I’ve never used all the RAM). Should I also compile with 96kB in this case? I never checked my linker script though.