Forum: Mikrocontroller und Digitale Elektronik progmem und --rename-section


von Amega (Gast)


Lesenswert?

Hallo,

Ich verwende PROGMEM und die pgm_read* Fuktionen.
Brauche ich unbedinkt avr-objcopy --rename-section ...?

Ich make so:
avr-gcc -mmcu=attiny2313 -Wall -O1 -o attinylib.elf attinylib.cpp
avr-objcopy -I elf32-avr -O binary attinylib.elf attinylib.bin
avr-objcopy -I binary --rename-section 
.data=.progmem.data,contents,alloc,load,readonly,data -O ihex 
attinylib.bin attinylib.hex

Ist es richtig was ich mache?


Mfg,
Amega

von Stephan M. (stephanm)


Lesenswert?

Amega schrieb:
> Ich make so:
> avr-gcc -mmcu=attiny2313 -Wall -O1 -o attinylib.elf attinylib.cpp
> avr-objcopy -I elf32-avr -O binary attinylib.elf attinylib.bin
> avr-objcopy -I binary --rename-section
> .data=.progmem.data,contents,alloc,load,readonly,data -O ihex
> attinylib.bin attinylib.hex
>
> Ist es richtig was ich mache?

"Richtig" im Sinne von "es kommt das richtige raus" mag das Ganze es ja 
sein. Aber das --rename-section beim letzten Aufruf von objcopy macht 
keinen Sinn mehr, da es in dem Input-File attinylib.bin keine 
.data-Section mehr gibt, nur noch Daten und Instruktionen als 
strukturlose Bytesequenz.

Stephan

von Amega (Gast)


Lesenswert?

Danke, Stephan!

Anscheinend --rename-section brauche ich nicht, fukctioniert (PROGMEM) 
auch ohne:
avr-gcc -mmcu=attiny2313 -Wall -O1 -o _attinylib.o attinylib.cpp
avr-objcopy -O ihex _attinylib.o _attinylib.hex

Mfg
Amega

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.