Problem programming xmega with dragon

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

Hi All,

I have been having difficulties in connecting to my xmega using the dragon. I could program the device with avrisp a while ago, but with dragon, I have no success. (I don't have avrisp with me at the moment.) I don't quite know what the problem is. I suspect that the debugwire fuse is perhaps set (I don't know why it should be, for I have never tried to tamper with that). In any case, here is the dump of the communication between the device, and dragon.

sudo avrdude -p x64a3 -P usb -c dragon_isp -e -U flash:w:slm_scan.hex -vvvv

avrdude: Version 5.10, compiled on Jun 29 2010 at 21:09:48
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

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

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: stk500v2_dragon_isp_open()
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A20000387C
avrdude: usbdev_open(): using read endpoint 0x82
avrdude: jtagmkII_getsync()
avrdude: jtagmkII_getsync(): Sending sign-on command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Sent: . [1b] . [00] . [00] . [01] . [00] . [00] . [00] . [0e] . [01] . [f3] . [97] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 0 (command_sequence == 0)
avrdude: Recv: . [86] . [01] . [ff] . [01] . [01] . [01] . [ff] . [00] . [02] . [07] . [00] . [a2] . [00] . [00] 8 [38] | [7c] A [41] V [56] R [52] D [44] R [52] A [41] G [47] O [4f] N [4e] . [00] 

Raw message:
0x860x010xff0x010x010x010xff0x000x020x070x000xa20x000x000x380x7c
0x410x560x520x440x520x410x470x4f0x4e0x00
Sign-on succeeded

JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              1.01
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              2.00
  hardware version:              7
Serial number:                   00:a2:00:00:38:7c
Device ID:                       AVRDRAGON
avrdude: jtagmkII_setparm()
avrdude: jtagmkII_setparm(): Sending set parameter command (parm 0x03, 1 bytes): 
avrdude: jtagmkII_send(): sending 3 bytes
avrdude: Sent: . [1b] . [01] . [00] . [03] . [00] . [00] . [00] . [0e] . [02] . [03] . [03] . [89] f [66] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 1 (command_sequence == 1)
avrdude: Recv: . [a0] 

Raw message:
0xa0
FAILED

avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
avrdude: jtagmkII_getsync(): ISP activation failed, trying debugWire
avrdude: jtagmkII_setparm()
avrdude: jtagmkII_setparm(): Sending set parameter command (parm 0x03, 1 bytes): 
avrdude: jtagmkII_send(): sending 3 bytes
avrdude: Sent: . [1b] . [02] . [00] . [03] . [00] . [00] . [00] . [0e] . [02] . [03] . [00] { [7b]   [20] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 2 (command_sequence == 2)
avrdude: Recv: . [ac] 

Raw message:
0xac
unknown message 0xac

avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_DEBUGWIRE_SYNC_FAILED
avrdude: failed to sync with the AVR Dragon in ISP mode
avrdude: stk500v2_jtagmkII_close()
avrdude: jtagmkII_close()
avrdude: jtagmkII_close(): Sending sign-off command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Sent: . [1b] . [03] . [00] . [01] . [00] . [00] . [00] . [0e] . [00] . [aa] . [0c] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 65535 (command_sequence == 3)
avrdude: jtagmkII_recv(): got asynchronous event
avrdude: jtagmkII_recv():
avrdude: usb_fill_buf(): usb_bulk_read() error No error
avrdude: jtagmkII_recv(): Timeout receiving packet

avrdude: jtagmkII_close(): timeout/error communicating with programmer (status -1)

avrdude done.  Thank you.

                           make: *** [dragon] Error 1

Could anyone point to why the programmer fails to write to the flash, and how I could recover the device? I use avrdude on linux, if that matters.
Thanks,
Zoltán

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

Quote:
I could program the device with avrisp a while ago, but with dragon, I have no success.
Quote:
I suspect that the debugwire fuse is perhaps set

As far as I know Xmega's don't have a Debugwire fuse, or interface.

I, too, can program the Xmegas with an AVRISPmkII, but have had problems using the Dragon for Xmega programming. (AVR Studio Ver 4).

This has come up in two recent threads, and several remote threads.

At the present time, I would not spend time trying to get the Dragon / Xmega combination to work for you. Use the programmer that you have and does work.

To be fair, several people have used the Dragon with Xmegas. But if your setup doesn't work, I don't think it is worth the time and effort to debug it at this time.

JC

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

Hi JC,

Thanks for the prompt reply, even if it is a bit saddening! I guess, I would not want to try to force the dragon-xmega combination, but I don't have my avrisp with me:(
Cheers,
Zoltán

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

zoltanvoros wrote:
... but I don't have my avrisp with me ...
Then try a cable length that is as short as possible. Suspect the RESET/PDI_CLK from Dragon does not have enough drive strength (an impedance mis-match driver to cable). IIRC, there is one recent message about reducing the PDI clock frequency that solved a problem.

sudo avrdude -p x64a3 -P usb -c dragon_isp -e -U flash:w:slm_scan.hex -vvvv

Try "-c dragon_pdi"
Fall-back: If ports PB4 through PB7 (pins 10 through 13) are available, use JTAG instead of PDI.

"Dare to be naïve." - Buckminster Fuller

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

I'd email, not PM, dl8dtl and ask him to check your configs. There's a LIB32 usb driver on s.forge that may fix it for you.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

indianajones11 wrote:
I'd email, not PM, dl8dtl and ask him to check your configs. There's a LIB32 usb driver on s.forge that may fix it for you.

So, your suspicion is that it is a problem in avrdude, and not a hardware issue? I can perhaps check this in AVR Studio today, to see if that works.
Zoltán

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

I have 'doze Xp and at the time of problem I had Winavr 2009 version. Using PN, I couldn't get avrdude to work for my dragon w/o the LIB usb driver talked about here:
http://www.avrfreaks.net/index.p...

Do you have the Dragon with or w/o the mounting holes ? The one w/o, has driver issues that restrict the programming cable to be very short for it to work.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

indianajones11 wrote:
Do you have the Dragon with or w/o the mounting holes ? The one w/o, has driver issues that restrict the programming cable to be very short for it to work.

It's got the four mounting holes, and the cable is something like 25 cm (10") long. Do you think that is too long? Accidentally, it is just as long as the cable on my avrisp.

I have checked out the link that you posted, but I wonder whether that would apply in my case. That seems to be related to windows, while I am trying to make this work under linux. I can get a windows computer, and try out the dragon with AVR Studio, but that actually wasn't the original post.
Zoltán

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

I thought there might be a Linux version of that driver somewhere on Sourceforge, but then maybe Linux already has the equivalent driver packaged with your distro. Of two Dragon versions you have the better one, but I don't know if 10" is too long even for that version. PLONS would know. I knew you had a Linux OS,but I thought that since my 'dude headache was fixed with that USB driver that MAYBE your issue might be fixed also with the install of the 'right' Linux driver.

It wouldn't hurt to put the dragon on your 'doze machine and see if PN's 'Dude can get it done with what you have now. If it does, I'd think there was something wrong with your Linux driver or its config.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

So, I have dug out a windows computer, and tried to program the xmega through the dragon. It did not work. AVR Studio complained that it could not connect to the emulator. It is really odd, given that the xplain manual advertises the dragon as a possible programming device.
Zoltán

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

Quote:

. AVR Studio complained that it could not connect to the emulator.

Surely that's just a Jungo error? When you installed Studio did you answer "yes" when it gave the option about USB support (that's where it installs Jungo).

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

clawson wrote:
Surely that's just a Jungo error? When you installed Studio did you answer "yes" when it gave the option about USB support (that's where it installs Jungo).

Hm. I am not sure. AVR Studio had already been on the system, and when I plugged in the dragon, the computer had some misgivings about the driver, and then it installed something that it found on the net. After that, AVR Studio updated the dragon firmware, and was willing to connect to it. But when I actually wanted to load my code to the xmega, I got the above-mentioned message. I could check whether it was a Jungo driver. I have absolutely no problems with the avrisp, if that helps clarify the situation.
Zoltán

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

If Jungo's on it, it'll be in the device mgr. If you don't see it, re-install Studio and make sure you select to install the USB driver ( disconnect the dragon if you do re-install studio ). Better make sure your studio version supports XMEGAs !

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1