Question

I have an XMEGA-A1 Xplained and a JTAG ICE mkII. I just tried to use avrdude on Linux. The first thing I did was to try to set the JTAG fuse off to use PDI (since the Hardware User's Guide said JTAG and PDI can't be used together - section 9.3), but now all I have is 8 rapidly flashing LEDs and no ability to communicate with the device. The LED by the USB connector is solid green/red, though the red flashes when you replug the USB. If I press SW0, the LEDs stop flashing, but they start again as soon as I let go, and pressing any of the 7 other buttons seems to have no effect.

When I try to communicate with the device now, all I get is:

$ avrdude -p x128a1 -c jtag2pdi -P usb -v

avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
avrdude: jtagmkII_close(): bad response to GO command: RSP_ILLEGAL_EMULATOR_MODE

avrdude done.  Thank you.

If I use jtag2slow (which worked before), I get:

avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
avrdude: initialization failed, rc=-1
     Double check connections and try again, or use -F to override
     this check.

avrdude: jtagmkII_close(): bad response to GO command: RSP_ILLEGAL_EMULATOR_MODE

avrdude done.  Thank you.

The command I used to set the fuses was taken from what Eclipse generated: -Ufuse4:w:0x1:m

Is there a way to "break into" the device and re-establish communication?

Était-ce utile?

La solution

This was caused by a failure of the JTAGICE mkII to communicate over the PDI connection due to a bad connection in the (homemade) squid cable. I made a new one and all is OK. It took a bit of messing around to work out the right connections again, since no-one seems to have put the two connection tables together (i.e. the "Connecting to a PDI target" in AVR Help and "Table 4.1: Programming Headers" in the Xplained user Guide), my squid cable is all grey, and I disconnected it before writing down the connections (don't do this!). So, here it is.

How to connect XMega-A1 Xplained via PDI with JTAGICE mkII

------------------------------------------------------
|         JTAGICE mkII           | XMEGA-A1 Xplained |
|--------------------------------+-------------------|
| Pin | JTAG Name | Squid Colour | Pin |  PDI Name   |
|-----------------+--------------+-------------------|
|  2  |  GND      |  White       |  2  |  GND        |
|  4  |  VTref    |  Purple      |  4  |  VCC        |
|  6  |  nSRST    |  Green       |  6  |  PCI_CLK    |
|  9  |  TDI      |  Red         |  3  |  PDI_DATA   |
------------------------------------------------------

Setting fuses

This is mentioned in the documentation, but it's worth repeating here: once you set the JTAGEN fuse to 1 (i.e. disable JTAG) the only way to get back to JTAG is to make a PDI connection and set the fuse back to 0.

Be very careful when setting the fuse if you can't program by PDI, as if you set fuse byte 4 to 0x01, as well as setting JTAGEN, you will also disable external reset (bit 4) and be unable to use ISP programming. If you look above, you will see this is what I did.

Apparently, not all JTAGICE mkII's can do PDI (mine can), so make sure before you blow this fuse!

Autres conseils

I had the same problem and it was induces because I was flashing the .elf file instead the .hex.

To solve it I did the next:

  1. Disconnect the xplained usb cable in order to Unpowered the micro.
  2. Reconnect the USB cable and as fast as you can send the command to reprogramm the micro. If someone can help is better.

It worked for me.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top