avrdude and dragon programmer in jtag mode

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

Hello,

I just purchased a dragon so I could hopefully start using Atmega1281 to replace the Atmega128. I think I am close, but can't quite get it to work. I was using an MKI jtag programmer fine. Without changing anything else, I changed my avrdude command line to:

sudo avrdude -p m128 -c dragon_jtag -P usb -t -v

Sometimes I get RSP_NO_TARGET_POWER and sometimes I get RSP_ILLEGAL_JTAG_ID

The wiring and ribbon cable did not change. It seems to read the target voltage correctly.

Any help greatly appreciated!

Here is a sample of the verbose output

Using Port            : usb
         Using Programmer      : dragon_jtag
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200006F84
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:              1.03
  hardware version:              6
Serial number:                   00:a2:00:00:6f:84
Device ID:                       AVRDRAGON
         AVR Part              : ATMEGA128
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PA0
         RESET disposition     : dedicated
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    12    64    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         33     6   128    0 yes    131072  256    512  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : DRAGON_JTAG
         Description     : Atmel AVR Dragon in JTAG mode
         M_MCU hardware version: 1
         M_MCU firmware version: 1.01
         S_MCU hardware version: 6
         S_MCU firmware version: 1.03
         Serial number:          00:a2:00:00:6f:84
         Vtarget         : 3.3 V
         JTAG clock      : 891.7 kHz (1.1 us)

avrdude: jtagmkII_program_enable(): bad response to enter progmode command: RSP_ILLEGAL_JTAG_ID
avrdude: JTAGEN fuse disabled?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.



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

I tried adding some pull-up resistors to the jtag signal lines as the Atmel Dragon documentation implies. That didn't help.

I have also noticed that the target device never gets reset when I execute the avrdude command line I posted before. Should it reset first thing?

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

Oops... finally figured it out. I didn't have pin 4 (vref) connected as I thought I did. Guess I should have believed the error message..

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

New but related problem now... The dragon jtag now reads an ATMega128 target fine, but reads 0xffffff for a signature on the ATMega1281 target. (I tried 3 different boards). I know the targets are at least partially OK because my MKI programmer can read the signature correctly from them.

Any ideas? I tried setting the clock speed with the -B2 option in avrdude, but it still reports that is is clocking with 1.1uS / 891.7Khz

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

Well, one more day wasted... Has anyone been able to get the m1281 working with Dragon and avrdude under linux? I can still read the device signature and fuses with my mki programmer, but the dragon just reports 0xffffff for signature on the Mega1281, while it works fine for the Mega128.

Seems like it must be an avrdude problem with Mega1281 and Dragon in jtag mode?

Any help or ideas will be greatly appreciated.

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

Been going through the avrdude source code trying some hacks to see if I can get the m1281 to respond, but nothing. Even if I slow the jtag clock down to slowest possible setting by hard-coding the source. The m128 still works fine with this setting. I know the m1281 device is OK because the mkI programmer can still read the signature and fuse bytes OK. Any suggestions?

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

One more post in case anyone is interested. I got a Windows machine up and running and installed AVR Studio. It updated the firmware on the Dragon programmer. It can see the Mega128 target, but still can't see the Mega1281 target. The problem does not appear to be avrdude, but the Dragon itself. I also purchased a Kanda AVR USB with JTAG programmer and it sees the Mega1281 target ok, but I can't figure out what protocol it uses. It may be proprietary as it comes with its own programming software. Can't seem to win here. At least I can program a Mega1281 if I use the the Windows machine and Kanda programmer. Not going to be fun trying to migrate from Mega128 to Mega1281 in that case though.

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

Oops... figured it out. I had some esd protection diodes on the jtag lines. They apparently caused problems with the m1281, but not the m128 using the Dragon programmer. They also didn't cause problems with the Kanda programmer. Not sure exactly why, but I'm happy to be programming a device with avrdude under Linux now. Sorry for all the posts, but maybe this will help out someone else.