|
From: | Michael Stocker |
Subject: | Re: Version/Signature in Flash |
Date: | Wed, 19 Jan 2022 13:48:57 +0100 |
Hallo Klaus, you can always define your own sections at a fixed location in flash and write anything you like in there. But every time you start a new section the previous one is closed implicitly. So it cannot be in the middle of another section. It also cannot go at the beginning of flash because the interrupt vectors are expected to be there. You can put anything into a section as long as it fits. Here for example a 32-bit signature: const uint32_t __attribute__((section(".my_signature"))) signature = 0xCAFEBABE; The linker then needs an additional argument to know where this section is: -Wl,--section-start=. my_signature =0x7FFC Where 0x7FFC is the byte-offset in flash not the word-offset. 0x7FFC would mean the end of flash on an ATmega328P. Hope this helps. Michael
|
[Prev in Thread] | Current Thread | [Next in Thread] |