|
From: | Jim Brain |
Subject: | Re: Version/Signature in Flash |
Date: | Wed, 19 Jan 2022 09:30:15 -0600 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.5.0 |
You are right.
-Wl,--undefined=signature
This will keep it in flash and not let the linker strip its value.Also when preparing your .hex file for flashing you may need to explicitly tell the sections you want.
avr-objcopy -j .text -j .data -j .my_signature -O ihex prog.elf prog.hex
Cheers
Michael
This may be a naive question, but is it possible to "place" the signature in a specific location in the resulting output file, padding the file to the required size to include the signature?
Use case:
One of the projects I utilize defines a 4 byte signature at the end of the AVR code space (top 4 bytes), and it checks that signature in the bootloader to see if an update on storage is newer than the one installed. Right now, the main developer has created a Perl script that pulls the resulting object file, padds it out, and puts the 4 bytes at the end. It would be nice to do all of that in the linker.
[Prev in Thread] | Current Thread | [Next in Thread] |