Re: [AVaRICE-user] AVR Dragon not working with atxmega16d4

2015-10-19 Thread Joerg Wunsch
As Element Green wrote:

> command[0x02, 1]: 02 03 06
> recv: 0x1b
> recv: 0x01
> recv: 0x00
> recv: 0x01
> recv: 0x00
> recv: 0x00
> recv: 0x00
> recv: 0x0e
> sDATA: reading 1 bytes
> read:  ae
> recv: 0xb1
> recv: 0x4b
> CRC OK
> Got message seqno 1 (command_sequence == 1)
> response: AE
> set paramater command failed: Unknwon response code 0xae
> Failed to activate PDI debugging protocol

That (sadly) probably means they have broke^H^H^H^H^Hchanged the 
protocol with their new firmware version.  As an indication, error 
codes known to me (for the JTAGICEmkII/Dragon protocol) go to 0xAD 
by now, so it appears they have added a new code here.

You might try requesting some explanation from Atmel by opening a case 
on their support web site, albeit I'm not very enthuasiastic about the 
success of such an inquiry.

Next step would be to reverse-engineer how Atmel Studio is handling 
this situation, sigh. :(

Here's the transcript from my older Dragon firmware (note that Atmel 
usually writes firmware versions in Hex, while AVRDUDE and AVaRICE 
in Decimal):

% ./src/avarice -g -j usb -X -d
AVaRICE version 2.13svn20141210, Jul 13 2015 21:28:57

Found JTAG ICE, serno: 00A27BFE
JTAG config starting.
Attempting synchronisation at bitrate 19200

command[0x01, 1]: 01
recv: 0x1b
recv: 0x00
recv: 0x00
recv: 0x1a
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 26 bytes
read:  86 01 ff 18 07 01 ff 18 07 07 00 a2 00 00 7b fe 41 56 52 44 52 41 47 4f 
4e 00
recv: 0xfb
recv: 0x39
CRC OK
Got message seqno 0 (command_sequence == 0)
response: 86 01 FF 18 07 01 FF 18 07 07 00 A2 00 00 7B FE 41 56 52 44 52 41 47 
4F 4E 00
Found a device: AVRDRAGON
Serial number:  00:a2:00:00:7b:fe
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:255
  firmware version:  7.24
  hardware version:  1
S_MCU:
  boot-loader FW version:255
  firmware version:  7.24
  hardware version:  7

command[0x02, 1]: 02 03 06
recv: 0x1b
recv: 0x01
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0xcd
recv: 0x83
CRC OK
Got message seqno 1 (command_sequence == 1)
response: 80

command[0x0a, 1]: 0A 01
recv: 0x1b
recv: 0x02
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0x1d
recv: 0x09
CRC OK
Got message seqno 2 (command_sequence == 2)
response: 80
recv: 0x1b
recv: 0xff
recv: 0xff
recv: 0x08
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 8 bytes
read:  e0 ff ff 00 00 40 00 00
recv: 0xee
recv: 0x63
CRC OKAutomatic device detection: jtagRead
command[0x14, 1]: 14
recv: 0x1b
recv: 0x03
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0xa2
recv: 0x88
CRC OK
Got message seqno 3 (command_sequence == 3)
response: 80

command[0x05, 1]: 05 B4 03 00 00 00 00 00 00 00
recv: 0x1b
recv: 0x04
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read:  82 1e 94 42
recv: 0x4e
recv: 0x99
CRC OK
Got message seqno 4 (command_sequence == 4)
response: 82 1E 94 42

command[0x15, 1]: 15
recv: 0x1b
recv: 0x05
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0x13
recv: 0x95
CRC OK
Got message seqno 5 (command_sequence == 5)
response: 80
Reported PDI device ID: 0x9442
Configured for device ID: 0x9442 atxmega16d4

command[0x36, 1]: 36 02 00 2F 00 00 80 00 00 40 80 00 00 00 8C 00 20 00 8F 00 
27 00 8F 00 00 04 8E 00 00 02 8E 00 00 00 00 01 00 40 00 00 00 10 00 01 00 04 
20 C0 01 90 00
recv: 0x1b
recv: 0x06
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0xc3
recv: 0x1f
CRC OK
Got message seqno 6 (command_sequence == 6)
response: 80
JTAG config complete.

command[0x37, 1]: 37 00 00 00 00 00 00 00 00 00 00 00 00 00
recv: 0x1b
recv: 0x07
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0x7c
recv: 0x9e
CRC OK
Got message seqno 7 (command_sequence == 7)
response: 80

command[0x08, 1]: 08
recv: 0x1b
recv: 0x08
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0xce
recv: 0x2f
CRC OK
Got message seqno 8 (command_sequence == 8)
response: 80

command[0x23, 1]: 23
recv: 0x1b
recv: 0x09
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0x71
recv: 0xae
CRC OK
Got message seqno 9 (command_sequence == 9)
response: 80

command[0x00, 1]: 00
recv: 0x1b
recv: 0x0a
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0xa1
recv: 0x24
CRC OK
Got message seqno 10 (command_sequence == 10)
response: 80


-- 
cheers, Joerg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources 

Re: [AVaRICE-user] AVR Dragon not working with atxmega16d4

2015-10-19 Thread Element Green
I've added some debugging output below.  For testing purposes I modified
the code to ignore the unknown 0xAE return code being hopeful that it would
work anyways, which it didn't.  The return code 0xA4 which occurs with the
next command indicates RSP_ILLEGAL_EMULATOR_MODE, so it would seem there is
something wrong with assigning the PDI emulator mode.  Knowing the meaning
of the 0xAE return code would probably help figure out what is wrong.
Could there be an incompatibility with this version of the firmware (7.39
it seems)?  I may try downgrading to some older version.  If anyone knows
what version is a good candidate for me to try, that would be helpful.

Of note is that the avarice is silent about the error occurring with the
command following the emulator mode assignment.  It wasn't apparent to me
what was wrong (if anything) until I was stepping through the application
with gdb.

Best regards,

Element Green


On Mon, Oct 19, 2015 at 2:29 AM, Element Green 
wrote:

> Hello,
>
> I built AVaRICE 2.13 from source and am trying to debug an xmega16d4 using
> an AVR Dragon.  I first upgraded the firmware on the Dragon board to 7.23
> (I think - I'll need to double check that), using a friends Windows system.
>
> I'm running the command as "avarice -g -X", but it fails with the
> following output:
>
> AVaRICE version 2.13, Oct 18 2015 20:56:43
>
> JTAG config starting.
> Found a device: AVRDRAGON
> Serial number:  00:a2:00:06:06:5f
> set paramater command failed: Unknwon response code 0xae
> Failed to activate PDI debugging protocol
>
> It does not matter if the Dragon is connected to the target board or not,
> same error.  It also seems like the Dragon is power cycling when the
> avarice command is executed (both LEDs go out, then the larger one comes up
> Orange, then goes Red and then the smaller Green LED blinks and stays lit).
>
> My system is running Ubuntu 15.04.
>
> Thank you in advance for any help with this.  I'm new to avarice, so I may
> just be doing something wrong.
>
> Best regards,
>
> Element Green
>


AVaRICE version 2.13, Oct 18 2015 20:56:43

Found JTAG ICE, serno: 00A20006065F
JTAG config starting.
Attempting synchronisation at bitrate 19200

command[0x01, 1]: 01
recv: 0x1b
recv: 0x00
recv: 0x00
recv: 0x1a
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 26 bytes
read:  86 01 ff 27 07 01 ff 27 07 07 00 a2 00 06 06 5f 41 56 52 44 52 41 47
4f 4e 00
recv: 0x70
recv: 0x9b
CRC OK
Got message seqno 0 (command_sequence == 0)
response: 86 01 FF 27 07 01 FF 27 07 07 00 A2 00 06 06 5F 41 56 52 44 52 41
47 4F 4E 00
Found a device: AVRDRAGON
Serial number:  00:a2:00:06:06:5f
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:255
  firmware version:  7.39
  hardware version:  1
S_MCU:
  boot-loader FW version:255
  firmware version:  7.39
  hardware version:  7

command[0x02, 1]: 02 03 06
recv: 0x1b
recv: 0x01
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  ae
recv: 0xb1
recv: 0x4b
CRC OK
Got message seqno 1 (command_sequence == 1)
response: AE
set paramater command failed: Unknwon response code 0xae
Failed to activate PDI debugging protocol

command[0x0a, 1]: 0A 01
recv: 0x1b
recv: 0x02
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  a4
recv: 0x3b
recv: 0x6e
CRC OK
Got message seqno 2 (command_sequence == 2)
response: A4

command[0x23, 1]: 23
recv: 0x1b
recv: 0x03
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0xa2
recv: 0x88
CRC OK
Got message seqno 3 (command_sequence == 3)
response: 80

command[0x00, 1]: 00
recv: 0x1b
recv: 0x04
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0xac
recv: 0x14
CRC OK
Got message seqno 4 (command_sequence == 4)
response: 80
--
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user