Hi
I have been struggling with programming the xmega bootloader section lately using avrdude (version 6.2)
The case is that when verifying the content it always read back as 0xff and it is the same behaviour on two different HW.
The code is compiled with base address 0x20000, and the boot reset flag is programmed. I also tried to both set and unset all lock bits to no help.
All scenarios was tried on both HW. I have used xmegas before, but never with an bootloader so this is first time I try to program xmega bootloader section via avrdude. I am able to load the application code via avrdude (into regular flash), and this executes perfectly on both hardwares. Worth to mention probably is that I use the pdi interface.
The following shows avrdude output after adding -v option aswell.
I find it a bit strange that all the fuses and the lockbits are readback as 0x00.
(Note that the following avrdude command and options is only one of the many attempts with different settings for lockbits and fuses which I have tried, but the result is the same at the end. Verification of fist byte at 0x20000 fails.)
Hope someone may share some light on this my problem
$ avrdude -c jtag2pdi -p x128a3u -e -Ulock:w:0xff:m -Ufuse2:w:0xbf:m -Uflash:w:Xmega_Bootloader.hex -v
avrdude: Version 6.2
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/micro/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : jtag2pdi
avrdude: usbdev_open(): Found JTAGICE mkII, serno: 00B0000044DD
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
boot-loader FW version: 255
firmware version: 7.39
hardware version: 0
S_MCU:
boot-loader FW version: 255
firmware version: 7.39
hardware version: 1
Serial number: 00:b0:00:00:44:dd
Device ID: JTAGICEmkII
AVR Part : ATxmega128A3U
Chip Erase delay : 0 us
PAGEL : P00
BS2 : P00
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 0
StabDelay : 0
CmdexeDelay : 0
SyncLoops : 0
ByteDelay : 0
PollIndex : 0
PollValue : 0x00
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
prodsig 0 0 0 0 no 50 50 0 0 0 0x00 0x00
fuse1 0 0 0 0 no 1 0 0 0 0 0x00 0x00
fuse2 0 0 0 0 no 1 0 0 0 0 0x00 0x00
fuse4 0 0 0 0 no 1 0 0 0 0 0x00 0x00
fuse5 0 0 0 0 no 1 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 0 0 0x00 0x00
data 0 0 0 0 no 0 0 0 0 0 0x00 0x00
eeprom 0 0 0 0 no 2048 32 0 0 0 0x00 0x00
application 0 0 0 0 no 131072 512 0 0 0 0x00 0x00
apptable 0 0 0 0 no 8192 512 0 0 0 0x00 0x00
boot 0 0 0 0 no 8192 512 0 0 0 0x00 0x00
flash 0 0 0 0 no 139264 512 0 0 0 0x00 0x00
usersig 0 0 0 0 no 512 512 0 0 0 0x00 0x00
fuse0 0 0 0 0 no 1 0 0 0 0 0x00 0x00
Programmer Type : JTAGMKII_PDI
Description : Atmel JTAG ICE mkII PDI mode
M_MCU hardware version: 0
M_MCU firmware version: 7.39
S_MCU hardware version: 1
S_MCU firmware version: 7.39
Serial number: 00:b0:00:00:44:dd
Vtarget : 3.4 V
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e9742 (probably x128a3u)
avrdude: erasing chip
avrdude: reading input file "0xff"
avrdude: writing lock (1 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0xff:
avrdude: load data lock data from input file 0xff:
avrdude: input file 0xff contains 1 bytes
avrdude: reading on-chip lock data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xbf"
avrdude: writing fuse2 (1 bytes):
Writing | ################################################## | 100% 0.01s
avrdude: 1 bytes of fuse2 written
avrdude: verifying fuse2 memory against 0xbf:
avrdude: load data fuse2 data from input file 0xbf:
avrdude: input file 0xbf contains 1 bytes
avrdude: reading on-chip fuse2 data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of fuse2 verified
avrdude: reading input file "Xmega_Bootloader.hex"
avrdude: input file Xmega_Bootloader.hex auto detected as Intel Hex
avrdude: writing flash (136216 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 136216 bytes of flash written
avrdude: verifying flash memory against Xmega_Bootloader.hex:
avrdude: load data flash data from input file Xmega_Bootloader.hex:
avrdude: input file Xmega_Bootloader.hex auto detected as Intel Hex
avrdude: input file Xmega_Bootloader.hex contains 136216 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x20000
0xff != 0x0d
avrdude: verification error; content mismatch
avrdude done. Thank you.