avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-chat] EEPROM programming from extracted ELF data.


From: Erik Christiansen
Subject: [avr-chat] EEPROM programming from extracted ELF data.
Date: Sun, 20 May 2018 18:43:24 +1000
User-agent: Mutt/1.8.0 (2017-02-23)

I'm back to fiddling with AVRs again, after a long absence, and have
this eeprom addressing error from avrdude:

avrdude: reading input file "obj/eeprom.srec"
avrdude: input file obj/eeprom.srec auto detected as Motorola S-Record
avrdude: ERROR: address 0x810008 out of range at line 2 of obj/eeprom.srec
avrdude: read from file 'obj/eeprom.srec' failed

That's in response to this make target:

$ make load
avrdude -P /dev/ttyUSB0 -p t2313 -c stk500 -e -U flash:w:obj/flash.srec \
                                              -U eeprom:w:obj/eeprom.srec

and the flash & eeprom programming files are created with:

avr-objcopy -O srec obj/dimmer.elf -S -R .eeprom --gap-fill=0xff obj/flash.srec
avr-objcopy -O srec obj/dimmer.elf -S -j .eeprom --gap-fill=0xff obj/eeprom.srec

The EEPROM data file is:

$ more obj/eeprom.srec
S01200006F626A2F656570726F6D2E7372656320
S20C81000007FFFF07FFFFFFFF6A
S804000000FB

And avr-objdump -h shows:

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
...
  2 .eeprom       00000008  00810000  00810000  000005d8  2**0
                  CONTENTS, ALLOC, LOAD, DATA

So the question in my mind is: Given the appended ninth byte (6A) in
obj/eeprom.srec has to be just an srec line checksum, why is avrdude
objecting? As avr-objdump confirms, my .eeprom segment data comprises
only bytes 0 to 7, i.e. 8 bytes. And avr-objdump concurs:

Disassembly of section .eeprom:

00810000 <__eeprom_end-0x8>:
  810000:   07 ff          sbrs  r16, 7
  810002:   ff 07          cpc   r31, r31 
  810004:   ff ff          .word 0xffff   ; ????
  810006:   ff ff          .word 0xffff   ; ????


Erik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]