Pages: [1]   Go Down
Author Topic: Compiling Bootloader and sketch into single .elf file  (Read 2837 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is it possible to dump an arduino  bootloader, arduino sketch, eeprom, and fuse settings and dump it all to a single .elf file?

I tried to do it via AVR studio 4 but I get a read error on final verify, and I could not change the BLB1 fuse (bootloader section) without getting an ISP error. AVR studio can reads out the the hex, eeprom, fuses and create the .elf file but I get the this report when I try to reupload it:

Getting isp parameter.. SD=0x02 .. OK
Validating ELF input file.. OK!
Reading FLASH input..OK!
Reading EEPROM input..OK!
Reading FUSE input..OK!
Reading LOCKBIT input..OK!
Reading SIGNATURE input..OK!
Entering programming mode.. OK!
Erasing device.. OK!
Reading signature .. 0x1E, 0x95, 0x0F .. OK!

Signature matches selected device .. OK
Programming FLASH ..      OK!
Reading FLASH ..  OK!
WARNING: FLASH byte address 0x0002 is 0x20 (should be 0x62).. FAILED!
Leaving programming mode.. OK!

Nothing gets uploaded as far as I can see, and the fuse settings does not change.....

Is it at all possible to compile/combine the bootloader and sketch/hex-file into a single .elf file? Or is the BLB1 fuse preventing to read out the bootloader part?

Any help, experience, thoughts or suggestions will be highly appreciated!

Thanks

Jussi
Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Take the .hex file of your sketch and the .hex file of your bootloader. Open both of them in a text editor. Remove the last line ':00000001FF' in there and just append the bootloader 'text'.
Logged

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I will try that. Sounds easy. I will report back!

Edit: Opened the files in text editor. I am guessing the bootloader has to come first?
« Last Edit: August 31, 2011, 05:49:19 pm by 420RcPilot » Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I put it at the end of the sketch. But you can give it a try.
Logged

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

Pages: [1]   Go Up
Jump to: