cancel
Showing results for 
Search instead for 
Did you mean: 

no init variable at specific address for BOOT / APP sharing KEY

CiuppaPT
Associate III

I want to define a variable at a fixed address RAM with __attribut__ noinit , in order to set a magic key for trigger bootloader update request.

I have done some researches but can't edit the linker sript file correctly neither with GCC in STM32CUBEide.

Some one can help me in setup also the scatter file configuration of the KEIL uVISION for realize the same things for the BOOTLOADER?

4 REPLIES 4

Couldn't you just use a pointer?

uint32_t *foo = (uint32_t *)0x2000FFFC;

printf ("%d\n", *foo);

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

but how to make foo var no init after reset?

Shrink the RAM size the linker can use, and on GNU/GCC move/check ​where the initial stack pointer is set.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

If the pointer points to an address outside of the linker script sections, it will not be initialized.

If you feel a post has answered your question, please click "Accept as Solution".