Make linker put version number in separate section

Discussions about all user software around SAM Series.

Moderator: nferre

elektrobjorn
Posts: 7
Joined: Thu Sep 10, 2015 11:10 am

Make linker put version number in separate section

Wed Jun 29, 2016 4:33 pm

I want to define a section in the top of the flash (starting at 0x1FF80 for the SAMD21G18A) and place the firmware revision number there.
As described in Atmel Application Note AVR32795, I add the command

Code: Select all

-Wl,-section-start=.revnumber=0x1ff80
to the linker flags, and the definition

Code: Select all

const char revision[] __attribute__ ((section (".revnumber"))) = "Rev 0.4.1";
in the source code.
This compiles and links without error messages, and when I inspect the .map file, I find this line:

Code: Select all

Address of section .revnumber set to 0x1ff80
But there is no data at this address. Further down in the .map file is the line

Code: Select all

.revnumber      0x0001ff80        0x0
,
and when I inspect the .hex file, there is nothing at address 0x1ff80.
What am I doing wrong?

Return to “Software”

Who is online

Users browsing this forum: No registered users and 1 guest