Flashing boot section on XMEGA256A3

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

Hi all,
I'm trying to flash the boot section of an Xmega256A3U (G rev.).

I have a boot memory section @ address 0x40000 and I have code residing there :

$#> avr-objdump image.elf -h

image.elf:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         000166ac  00000000  00000000  00000094  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000b6e  00802000  000166ac  00016740  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .boot         0000001c  00040000  00040000  000172ae  2**0
...

I'm able to generate the binary and hex version of the code (hereby the hex):

:020000024000BC
:100000005BB78BBF42E200C0F72FE62F4093CA01D7
:0C0010000DE900933400E8955BBF0895F3
:00000001FF

Unfortunately when I jump to the code in there

CALL 0x40000

and I inspect the bytecode I only seee 0xFFFF words (it has not been reprogrammed).

I tried reprogramming with both binary and hex files through avrdude: with the binary, avrdude does not complain whereas with the hex it reports an out of bound address;here below the output of the two flashing procedures.

With hex file:

/usr/local/avr/bin//avrdude -p x256a3 -c jtag2 -P usb -C /usr/local/avr/etc//avrdude.conf -u -V -U boot:w:./boot.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.27s

avrdude: Device signature = 0x1e9842
avrdude: reading input file "./boot.hex"
avrdude: input file ./boot.hex auto detected as Intel Hex
avrdude: ERROR: address 0x40010 out of range at line 2 of ./boot.hex
avrdude: read from file './boot.hex' failed

avrdude done.  Thank you.

With binary file:

/usr/local/avr/bin//avrdude -p x256a3 -c jtag2 -P usb -C /usr/local/avr/etc//avrdude.conf -u -V -U boot:w:./boot.bin

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.27s

avrdude: Device signature = 0x1e9842
avrdude: reading input file "./boot.bin"
avrdude: input file ./boot.bin auto detected as raw binary
avrdude: writing boot (28 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 28 bytes of boot written

avrdude done.  Thank you.

Is there something I'm missing in the procedure ?? Fuse bits for instance? Or should I replace "-U boot:w" with "-U flash:w" ?

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

Quote:

and I inspect the bytecode I only seee 0xFFFF words (it has not been reprogrammed).

How are you observing this - if you use an Atmel tool (such as Studio driving a debugger) note that they do all flash addressing in terms of words not bytes.

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

clawson wrote:
Quote:

and I inspect the bytecode I only seee 0xFFFF words (it has not been reprogrammed).

How are you observing this - if you use an Atmel tool (such as Studio driving a debugger) note that they do all flash addressing in terms of words not bytes.

I'm using GNU GCC/G++ and AVRDUDE. I'm developing under linux... In order to see the "0xFFFF" words, I just let the CALL 0x40000 instruction execute (step). So I relay on target jump rather than on Studio or other tools memory inspection.

R