trouble getting avrdude working

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

I've got an avrispmkII connected to a xmega128a3 (http://www.bostonandroid.com/xme...) as shown in http://www.bostonandroid.com/ima...

I'm working with a fairly fresh install of Ubuntu 9.10 (Karmic Koala), and used the gcc installation scripts found in this forum.

I've installed in /home/avrgcc2 (a new user I set up for my dev tools)

I can't get avrdude to work. What have I done wrong here?

adam@adam-office:~$ sudo /home/avrgcc2/bin/avrdude -c avrispmkII -P usb:47 -p x128a3 -F -t -v

avrdude: Version 5.8, compiled on Jan 2 2010 at 15:23:26
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/home/avrgcc2/etc/avrdude.conf"
User configuration file is "/home/adam/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : usb:47
Using Programmer : avrispmkII
avrdude: usbdev_open(): Found AVRISP mkII, serno: 0000A0008347
AVR Part : ATXMEGA128A3
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
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 0 0 0 0 no 2048 256 0 0 0 0x00 0x00
application 0 0 0 0 no 131072 256 0 0 0 0x00 0x00
apptable 0 0 0 0 no 8192 256 0 0 0 0x00 0x00
boot 0 0 0 0 no 8192 256 0 0 0 0x00 0x00
flash 0 0 0 0 no 139264 256 0 0 0 0x00 0x00
prodsig 0 0 0 0 no 512 256 0 0 0 0x00 0x00
usersig 0 0 0 0 no 512 256 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
fuse0 0 0 0 0 no 1 0 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

Programmer Type : STK500V2
Description : Atmel AVR ISP mkII
Programmer Model: AVRISP mkII
Hardware Version: 1
Firmware Version Master : 1.05
Vtarget : 3.2 V
SCK period : 10.37 us

avrdude: stk500v2_command(): error in CMD_XPROG_SETMODE: Unknown
avrdude: stk600_xprog_program_enable(): CMD_XPROG_SETMODE failed
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATXMEGA128A3 is 1E 97 42

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

You need a patch for avrdude https://www.avrfreaks.net/index.p...

Note, the patch fixes the PDI issue, but breaks the terminal mode dump command.

Edit: No, that might be wrong. You need to update the firmware of your AVRISP mkII. You need to find a windows PC with AVR Stupido 4.18 SP1, and use the firmware upgrade procedure. Then Firmware Version Master should be 1.13 or later.

Stealing Proteus doesn't make you an engineer.

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

Updated firmware to 1.13, still no joy. Trying patch next...

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

Patch after firmware worked. Thank you.

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

It looks like I spoke too soon. I tried to write new code out to the device today and had trouble. It erases, and it claims to write, but verification and reads show a blank device. I'm certina it erases, because the dev board I have had a demo program that made an LED blink and it doesn't blink anymore. Any clues are welcome...

sudo /home/avrgcc2/bin/avrdude -c avrispmkII -p x128a3 -P usb -e -U flash:w:main.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9742
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: writing flash (762 bytes):

Writing | ################################################## | 100% 0.12s

avrdude: 762 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex contains 762 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.07s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0xff
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done. Thank you.

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

Clues?

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

I also tried disabling verify (-V) and writting twice (two -U on the command line) with no joy.

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

avrdude 5.8 is known to have all kinds of issues, but I haven't seen this one.

Can you try programming from Windows with AVR Studio, with an otherwise unchanged setup (same wiring, same hex file)? Just to make sure it is avrdude getting things wrong, and not anything in your setup.

When you know it is avrdude you could try to go back to the patch, and increase the delay it introduces. There are, among other things, two lines of code added by the patch, introducing 100ms delays. You could try setting them to e.g. 150ms.

Stealing Proteus doesn't make you an engineer.

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

AVR Studio works fine with the same setup, wiring, and hex file.