On Jan 10, 2012, at 9:11 AM, Mark Rages wrote:
> (I want my bootloader to place its version
> number in a well-defined place in flash memory.) Is this possible
> without mucking with the linker script?
I wanted to do all the same things, for all the same reasons,
for optiboot on Atmel AVR. I ended up doing (in optiboot.c):
>> #define OPTIBOOT_MAJVER 4
>> #define OPTIBOOT_MINVER 4
>>
>> #define MAKESTR(a) #a
>> #define MAKEVER(a, b) MAKESTR(a*256+b)
>>
>> asm(" .section .version\n"
>> "optiboot_version: .word " MAKEVER(OPTIBOOT_MAJVER, OPTIBOOT_MINVER)
>> "\n"
>> " .section .text\n");
And then add to the link command:
>> -Wl,--section-start=.version=0x3ffe
And to the hex file generation:
>> $(OBJCOPY) -j .text -j .data -j .version --set-section-flags
>> .version=alloc,load -O ihex $< $@
I don't think that any of those are specific to the AVR (not even the assembler
sytax!), so this should probably work for msp430 as well?
BillW
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users