Address out of range

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, when I use avr-dude to upload the usb dfu bootloader I get this output:

[arkadi@linux binaries $]avrdude -p atxmega64a3u -P usb -c stk600  -e -U boot:w:atxmega64a3u_104.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9642
avrdude: erasing chip
avrdude: reading input file "atxmega64a3u_104.hex"
avrdude: input file atxmega64a3u_104.hex auto detected as Intel Hex
avrdude: ERROR: address 0x10010 out of range at line 2 of atxmega64a3u_104.hex
avrdude: read from file 'atxmega64a3u_104.hex' failed

avrdude done.  Thank you.

What is my mistake?

This topic has a solution.

Last Edited: Thu. Jul 30, 2015 - 11:13 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The program is too big. In a 64K micro the addresses run from 0x0000 to 0xFFFF. That hex file contains a record at 0x10010 which is beyond the end of the 64K.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the hex file is 4K:

$ avr-size atxmega64a3u_104.hex 
   text    data     bss     dec     hex filename
      0    3995       0    3995     f9b atxmega64a3u_104.hex

my solution was to dump it to bin file and to uploade it:

avr-objcopy -I ihex -O binary atxmega64a3u_104.hex atxmega64a3u_104.bin

avrdude -F -p atxmega64a3u -P usb -c stk600 -U fuse2:w:0xBF:m  -e -U boot:w:atxmega64a3u_104.bin

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Then the base address is set close to the end of the address space. Is this a bootloader by any chance?

 

Your binary trick might well program it but it will surely be programming it in the wrong place!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, it atmel's dfu-usb bootloader (AVR1916).

I try also to build the source code but for now I have few errors in the proccess (it takes time to change it for avr-gcc)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

how to change the base address?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I looked at the latest avrdude user manual:

 

http://mirror.unicorncloud.org/s...

 

it does not appear to have a command line option to set the base address to which the code is programmed. However in "terminal" mode it looks like the write command can take a base address as a parameter. However I think you may still hit the wall of avrdude saying "an address above 64K is outside the range of a 64K micro".

 

What version of avrdude by the way? Google seems to suggest that this inability to program Xmega bootloader sections may have been fixed at version 5.11

Last Edited: Thu. Jul 30, 2015 - 09:04 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have avrdude: Version 6.1, compiled on Mar 24 2014 at 14:07:14

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah right I understand more about this issue after reading this:

 

http://savannah.nongnu.org/bugs/...

 

I hadn't grasped the significance of "flash:" and "boot:" in the -U command. So it seems that your converting to binary (which removes the address offset) and then using boot: is the solution. boot: itself implies a base address offset (64K in the case of this chip). So continue as you were doing. I'm wrong and you are right - it should work.

 

The issue you face is using both boot: and then a .hex file which itself has an offset of 0x10000.

 

(to be honest I don't think it's right - it would be natural to build a bootloader at 0x10000 or whatever (so all the call/jump destinations are correct) and as such the .hex is bound to have a similar base offset - so when boot: is used it should say nothing more than "allow access beyond the top application address" - but I guess this is a philosophical discussion to have with the maintainers of avrdude!)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the information

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

arkadi wrote:

Hello, when I use avr-dude to upload the usb dfu bootloader I get this output:

[arkadi@linux binaries $]avrdude -p atxmega64a3u -P usb -c stk600  -e -U boot:w:atxmega64a3u_104.hex

Try this instead:

$ avrdude -p atxmega64a3u -P usb -c stk600  -e -U flash:w:atxmega64a3u_104.hex

On the xmega, avrdude regards the "flash" address space as covering both the application and the boot sections. The hex file has the correct addressing for writing to flash address space in this way.

 

- S

 

Last Edited: Thu. Jul 30, 2015 - 09:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mnehpets, it worked.
The new problem  the pc doesn't recognize it  as Xmega, only as Stk600.
You have any tips ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

arkadi wrote:

The new problem  the pc doesn't recognize it  as Xmega, only as Stk600.
You have any tips ?

Well, a good tip is that if you are asking for help on avrfreaks, you need to include *relevant* information that the rest of us can use to try and figure out your problem. You've told us virtually nothing, so all we can do is make wild uninformed guesses.

 

On what hardware is the target xmega device located? Has that hardware been debugged and verified as working? How have you connected your pc to that target's USB port? How have you configured the xmega's boot fuses?

 

- S

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yea, you are right.
I figure it out.
Next time I will try to add more details :)

Thanks again