Skip to main content
CiuppaPT
Associate III
June 11, 2021
Question

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

  • June 11, 2021
  • 4 replies
  • 2016 views

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?

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
June 11, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
CiuppaPT
CiuppaPTAuthor
Associate III
June 11, 2021

but how to make foo var no init after reset?

Tesla DeLorean
Guru
June 11, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
TDK
June 11, 2021

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""."