Hi Leute!
Ich möchte folgendes erreichen:
Ein HEX File (Bootloader) und die Fuses zusammen in ein ELF File packen.
Da aber das Bootloader HEX File solche Späße hier enthält (vermutlich um
ganze 14 Bytes Platz zu sparen):
1 | ...
|
2 | :0601E000C9F7DB010895E0 // End of File Record
|
3 | :1001F4000D947D010D94B2013ECF0FBF08952AE105 // Neuer Data Record
|
4 | ...
|
generiert folgender Aufruf:
1 | avr-objcopy -I ihex -O elf32-avr $bootloader_hex $production_elf
|
eine ELF Datei mit folgendem Inhalt (avr-objdump):
1 | Sections:
|
2 | Idx Name Size VMA LMA File off Algn
|
3 | 0 .sec1 000001e6 00020000 00020000 00000034 2**0
|
4 | CONTENTS, ALLOC, LOAD, DATA
|
5 | 1 .sec2 000013ee 000201f4 000201f4 0000021a 2**0
|
6 | CONTENTS, ALLOC, LOAD, DATA
|
7 | 2 .sec3 00000014 00021fe0 00021fe0 00001608 2**0
|
8 | CONTENTS, ALLOC, LOAD, DATA
|
Meine Frage wäre, mit welcher Option man das verhindern kann? Sprich,
wie sage ich, dass er die komplette HEX Datei in eine Section packen
soll?
Was teilweise funktioniert ist
1 | avr-objcopy -I ihex -O elf32-avr --add-section .flashdata=$bootloader_hex $bootloader_hex $production_elf
|
Dann lädt er (neben den 3 .secX) die gesamte HEX Datei in die Section
.flashdata.
1 | Sections:
|
2 | Idx Name Size VMA LMA File off Algn
|
3 | 0 .sec1 000001e6 00020000 00020000 00000034 2**0
|
4 | CONTENTS, ALLOC, LOAD, DATA
|
5 | 1 .sec2 000013ee 000201f4 000201f4 0000021a 2**0
|
6 | CONTENTS, ALLOC, LOAD, DATA
|
7 | 2 .sec3 00000014 00021fe0 00021fe0 00001608 2**0
|
8 | CONTENTS, ALLOC, LOAD, DATA
|
9 | 3 .flashdata 00003df0 00000000 00000000 0000161c 2**0
|
10 | CONTENTS, READONLY
|
D.h. mir wäre geholfen, wenn ich den Pflichtparameter "in-file" für
avr-objcopy irgendwie ignorieren lassen könnte und nur mit add-section
arbeite.
1 | Usage: avr-objcopy [option(s)] in-file [out-file]
|
EDIT: Ich sehe gerade, .text ist eigentlich für den Programmcode da.
Egal, es geht ums Prinzip ;-)