Memory reads over JTAG slightly corrupt

OpenOCD JTAG debugging with the Bus Pirate.

Memory reads over JTAG slightly corrupt

Postby rdiez » Tue Jun 04, 2013 6:46 am

Hi all:

I am having an interesting problem with the Bus Pirate as a JTAG adapter: when I read memory contents back from the target, sometimes some of the data bytes are corrupt. For example, I tried uploading this data file to my target:

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

That's just a ladder from 0x00 to 0x0F, twice (32 bytes in total). When I read the memory contents back with OpenOCD, I get 0x0A instead of 0x0D in both 0x0D positions above. This does not happen when the test data are all zeros or 0xFFs.

Here is some background information on what I am trying to achieve:

"How to stress-test a JTAG connection for troubleshooting purposes"
OpenOCD users mailing list
http://sourceforge.net/mailarchive/foru ... enocd-user

I am using the git head version of OpenOCD and this Bus Pirate version:
Bus Pirate v3.5
Firmware v6.1 r1676 Bootloader v4.4
DEVID:0x0447 REVID:0x3043 (24FJ64GA002 B5)

I added a command to the target firmware in order to dump those memory contents to its debugging console, and the data arrived fine, the problem is reading it back over OpenOCD.

The same happens with my JTAG firmware clone for the Arduino Due, so it is probably a problem on the OpenOCD side. However, I took a good look at OpenOCD's buspirate.c and could not find anything obvious.

I tried the same data with an Atmel SAM-ICE JTAG adapter and that works fine.

Has anybody seen anything similar?

Thanks,
rdiez
rdiez
Newbie
Newbie
 
Posts: 13
Joined: Tue Sep 27, 2011 11:48 am

Re: Memory reads over JTAG slightly corrupt

Postby robots » Tue Jun 04, 2013 8:22 am

is this on windows ? or linux ?

on widows there is some weirdness with translating LF to CR LF .... 0x0A and 0x0D are exactly those characters.

This can very easily be the same problem with linux. And there might be bug in the serial port initialization routine.
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Memory reads over JTAG slightly corrupt

Postby rdiez » Wed Jun 05, 2013 12:47 pm

Thanks robots, now that you mention it, it's rather obvious. It's a shame I wasted so much time because of this issue.
rdiez
Newbie
Newbie
 
Posts: 13
Joined: Tue Sep 27, 2011 11:48 am


Return to OpenOCD JTAG