Forum Discussion
Altera_Forum
Honored Contributor
21 years agoI want to update the software over a serial HDLC link.
My own bootloader at address 0x0000 in flash is not allowed to be overwritten. This bootloader is a normal C-program with drivers for HDLC etc. Therefore it's not possible to use the NIOS II Flash programmer. My own bootloader can receive files in S-RECORD format. to download a program in another flash region, I changed the address of the normal .flash file (Resetvector from SOPC was 0x000000(flash) and compiler settings are "program memory (.text) = ext ram") with "nios2-elf-objcopy -I srec -O srec --srec-forceS3 --srec-len 32 --change-addresses 0x200000 ext_flash.flash ext2_flash.flash" My bootloader stored the program, which should normally be at flash address 0x000000, at flash address 0x200000. Then i made a simple asm("call 0x200000"); in my bootloader program and the new program seams to start ok. It seems that the small altera bootloader in front of the program is not disturbed by the address shift ??? I don't know if this is a good solution for making software updates and if it works correctly in every case ? Also how can I make the asm call variable ?