cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE linker script reserves first 4 bytes of RAM1. What for?

T_1
Associate II

Linker scripts generated by STM32CubeIDE 1.10.1 for the STM32WB55 (but also other STM32 platforms) reserve the first 4 bytes of RAM1. Below is an excerpt from STM32WB55RGVX_FLASH.ld demostrating that. Similarly every STM32 linker script I've seen appears to reserve first 4 (sometimes 8) bytes of RAM.

Why are those 4 bytes of RAM1 reserved? Can I reclaim them and use for my own purposes?

MEMORY
{
FLASH (rx)                 : ORIGIN = 0x08000000, LENGTH = 512K
RAM1 (xrw)                 : ORIGIN = 0x20000004, LENGTH = 0x2FFFC
RAM_SHARED (xrw)           : ORIGIN = 0x20030000, LENGTH = 10K
}

1 ACCEPTED SOLUTION

Accepted Solutions
Remi QUINTIN
ST Employee

Thes 4 bytes are used when using the OTA FW provided by ST. If you dont intend to use OTA or develop your own way, you can use these 4 bytes at the start of the SRAM1 memory.

View solution in original post

4 REPLIES 4
Remi QUINTIN
ST Employee

Thes 4 bytes are used when using the OTA FW provided by ST. If you dont intend to use OTA or develop your own way, you can use these 4 bytes at the start of the SRAM1 memory.

Ah, great - thank you. I've been googling for hours and it seemed a likely explanation but there's not a single sentence that directly confirms it.

Just to clarify - "when using OTA FW provided by ST" means an example OTA implementation (e.g. https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota) and not the bootloader in boot ROM, right?

Remi QUINTIN
ST Employee

Correct!!

BLE_Ota is checking this address to detect whether an OTA is to be performed.

Wonderful, thank you again for the speedy response.