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

2015-10-22 Thread Jörg Wunsch
Am 21. Oktober 2015 21:52:39 MESZ, schrieb "Jörg Wunsch" 
:

>You could try fiddling a custom cable with serial terminators (about 
>100 ohms) on each driving (tx) side of a line (TDO, TCK, TDI) to reduce
>ringing.

Sorrry, that was related to JTAG which has dedicated signal lines.  PDI uses 
the data line bidirectionally, so it is difficult to terminate at the tx side. 
Maybe it already helps to insert the resistor into the PDCLK line.


-- 
Viele Grüße, Jörg

--
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


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

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

> Thank you for your reply.  I downgraded the firmware to 7.21 (from AVR
> Studio 5).

I just upgraded another Dragon to 7.38 (decimal), and it works without 
troubles using AVaRICE (SVN version) on my ATxmega16D4 board.

> I attempted to use the Dragon to connect to 2 different XMEGA devices, one
> is a custom PCB I made with an xmega16d4, the other is a development board
> with an xmega128d4 using AVR Studio 7 in programming mode.  It could read
> the reference voltage but not the device ID.

That somehow smells like connection issues on the PDI level.

The target voltage is sensed on the Dragon itself, without the need 
for a working PDI link.  This error code 0xAE is likely an indication 
for PDI link issues - but still, you might ask Atmel explicitly about 
that.  While the JTAGICEmkII protocol is officially documented in an 
appnote, the Xmega protocol isn't.

How long's your cable?  The levelshifters/drivers on the Dragon are 
known to be fairly weak.  In general, the cables that come with an STK500 
work well, they are about 15 cm long.  Anything longer might cause 
troubles.
-- 
cheers, Joerg   .-.-.   --... ...--   -.. .  DL8DTL

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

--
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


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

2015-10-20 Thread Element Green
Hello Joerg,

On Tue, Oct 20, 2015 at 9:35 AM, Joerg Wunsch  wrote:

> As Element Green wrote:
>
> > Thank you for your reply.  I downgraded the firmware to 7.21 (from AVR
> > Studio 5).
>
> I just upgraded another Dragon to 7.38 (decimal), and it works without
> troubles using AVaRICE (SVN version) on my ATxmega16D4 board.
>
>

Good to hear that it's not related to the version.



> > I attempted to use the Dragon to connect to 2 different XMEGA devices,
> one
> > is a custom PCB I made with an xmega16d4, the other is a development
> board
> > with an xmega128d4 using AVR Studio 7 in programming mode.  It could read
> > the reference voltage but not the device ID.
>
> That somehow smells like connection issues on the PDI level.
>
> The target voltage is sensed on the Dragon itself, without the need
> for a working PDI link.  This error code 0xAE is likely an indication
> for PDI link issues - but still, you might ask Atmel explicitly about
> that.  While the JTAGICEmkII protocol is officially documented in an
> appnote, the Xmega protocol isn't.
>
> How long's your cable?  The levelshifters/drivers on the Dragon are
> known to be fairly weak.  In general, the cables that come with an STK500
> work well, they are about 15 cm long.  Anything longer might cause
> troubles.
>


I had that thought as well about the cable length after reading something
to that effect on a forum post.  My guess is that that is the issue now
that you mention it again, though I got sidetracked by the thought that it
was a version incompatibility.  The cable I have came with a ZeptoProg II
programmer and is probably about 10 inches long.  I'll get some shorter
ones and see if that makes a difference.  Perhaps the 0xAE code can be used
to identify cable length issues.  Guess I will see.



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

Cheers!

Element Green
--
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


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

2015-10-20 Thread Element Green
Hello Joerg,

On Tue, Oct 20, 2015 at 9:49 AM, Element Green 
wrote:

>
>> How long's your cable?  The levelshifters/drivers on the Dragon are
>> known to be fairly weak.  In general, the cables that come with an STK500
>> work well, they are about 15 cm long.  Anything longer might cause
>> troubles.
>>
>
>
> I had that thought as well about the cable length after reading something
> to that effect on a forum post.  My guess is that that is the issue now
> that you mention it again, though I got sidetracked by the thought that it
> was a version incompatibility.  The cable I have came with a ZeptoProg II
> programmer and is probably about 10 inches long.  I'll get some shorter
> ones and see if that makes a difference.  Perhaps the 0xAE code can be used
> to identify cable length issues.  Guess I will see.
>
>

So I shortened the cable by removing the connector, cut it to about 4
inches and then put the connector back on.  It still was getting the same
error code with my custom PCB, but it goes through a motherboard
interconnect plus a few extra inches.  So I then tried it on the little
development board I have and it came back with a device ID which is
currently unsupported (the xmega128d4) which it was not doing with a longer
cable.  So it seems like it would likely work if the interconnect was not
there.  I cut the cable to 2 inches and still same 0xAE error code.

I'm thinking of getting an MKII clone like this one since they seem to be
available for under $43 online:
http://www.wvshare.com/product/USB-AVR-JTAGICE-XPII.htm

Any idea if those will work OK with debugging or if it might work better
than the Dragon in regards to cable length?  Guess the easiest thing to do
is just try it.



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

Cheers.

Element
--
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


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

2015-10-20 Thread Arnim Littek
FWIW, I’m operating a Dragon to an ATxmega128a4u over ca. 40mm of ribbon cable 
reliably.  You also have a speed setting in avrdude to fiddle with.  Mine is 
running at
/usr/bin/avrdude -B 2.0 -p atxmega128a4u -P usb -c dragon_pdi
but that can be slowed down in problematic cases.

Arnim


From: Element Green [mailto:elem...@elementsofsound.org]
Sent: Wednesday, 21 October 2015 12:40 p.m.
To: Joerg Wunsch;
Subject: Re: [AVaRICE-user] AVR Dragon not working with atxmega16d4

Hello Joerg,

On Tue, Oct 20, 2015 at 9:49 AM, Element Green 
<elem...@elementsofsound.org<mailto:elem...@elementsofsound.org>> wrote:

How long's your cable?  The levelshifters/drivers on the Dragon are
known to be fairly weak.  In general, the cables that come with an STK500
work well, they are about 15 cm long.  Anything longer might cause
troubles.


I had that thought as well about the cable length after reading something to 
that effect on a forum post.  My guess is that that is the issue now that you 
mention it again, though I got sidetracked by the thought that it was a version 
incompatibility.  The cable I have came with a ZeptoProg II programmer and is 
probably about 10 inches long.  I'll get some shorter ones and see if that 
makes a difference.  Perhaps the 0xAE code can be used to identify cable length 
issues.  Guess I will see.



So I shortened the cable by removing the connector, cut it to about 4 inches 
and then put the connector back on.  It still was getting the same error code 
with my custom PCB, but it goes through a motherboard interconnect plus a few 
extra inches.  So I then tried it on the little development board I have and it 
came back with a device ID which is currently unsupported (the xmega128d4) 
which it was not doing with a longer cable.  So it seems like it would likely 
work if the interconnect was not there.  I cut the cable to 2 inches and still 
same 0xAE error code.

I'm thinking of getting an MKII clone like this one since they seem to be 
available for under $43 online:
http://www.wvshare.com/product/USB-AVR-JTAGICE-XPII.htm

Any idea if those will work OK with debugging or if it might work better than 
the Dragon in regards to cable length?  Guess the easiest thing to do is just 
try it.



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



Cheers.

Element

--
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


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

2015-10-20 Thread Element Green
Thank you for the info.  I just tried it again with avrdude with the short
2" cable and the xmega128d4 development board and it managed to get pretty
far in the programming process (unlike before), but failed on data
verification.  It still completely fails to even start with my development
board with the same 0xAE error code as avarice.

I'm thinking of looking into a different programmer.  This one seems too
problematic.  Not a lot of options though it seems for debugging over PDI
in Linux.

I was mistaken in my previous email when I mentioned that a debugger could
be found for $43 online, seems its more like $127 for ones which have
debugging capability (several of the MKII clones look identical but have
different capabilities apparently).

Best regards,

Element Green

On Tue, Oct 20, 2015 at 5:44 PM, Arnim Littek <litt...@sirtrack.com> wrote:

> FWIW, I’m operating a Dragon to an ATxmega128a4u over ca. 40mm of ribbon
> cable reliably.  You also have a speed setting in avrdude to fiddle with.
> Mine is running at
>
> /usr/bin/avrdude -B 2.0 -p atxmega128a4u -P usb -c dragon_pdi
>
> but that can be slowed down in problematic cases.
>
>
>
> Arnim
>
>
>
>
>
> *From:* Element Green [mailto:elem...@elementsofsound.org]
> *Sent:* Wednesday, 21 October 2015 12:40 p.m.
> *To:* Joerg Wunsch;
> *Subject:* Re: [AVaRICE-user] AVR Dragon not working with atxmega16d4
>
>
>
> Hello Joerg,
>
>
>
> On Tue, Oct 20, 2015 at 9:49 AM, Element Green <
> elem...@elementsofsound.org> wrote:
>
>
> How long's your cable?  The levelshifters/drivers on the Dragon are
> known to be fairly weak.  In general, the cables that come with an STK500
> work well, they are about 15 cm long.  Anything longer might cause
> troubles.
>
>
>
>
>
> I had that thought as well about the cable length after reading something
> to that effect on a forum post.  My guess is that that is the issue now
> that you mention it again, though I got sidetracked by the thought that it
> was a version incompatibility.  The cable I have came with a ZeptoProg II
> programmer and is probably about 10 inches long.  I'll get some shorter
> ones and see if that makes a difference.  Perhaps the 0xAE code can be used
> to identify cable length issues.  Guess I will see.
>
>
>
>
>
>
>
> So I shortened the cable by removing the connector, cut it to about 4
> inches and then put the connector back on.  It still was getting the same
> error code with my custom PCB, but it goes through a motherboard
> interconnect plus a few extra inches.  So I then tried it on the little
> development board I have and it came back with a device ID which is
> currently unsupported (the xmega128d4) which it was not doing with a longer
> cable.  So it seems like it would likely work if the interconnect was not
> there.  I cut the cable to 2 inches and still same 0xAE error code.
>
>
>
> I'm thinking of getting an MKII clone like this one since they seem to be
> available for under $43 online:
>
> http://www.wvshare.com/product/USB-AVR-JTAGICE-XPII.htm
>
>
>
> Any idea if those will work OK with debugging or if it might work better
> than the Dragon in regards to cable length?  Guess the easiest thing to do
> is just try it.
>
>
>
>
>
>
>
> --
> cheers, Joerg   .-.-.   --... ...--   -.. .  DL8DTL
>
>
>
>
>
>
>
> Cheers.
>
>
>
> Element
>
>
>
--
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


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