leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

JTAG Recommendations

Wed Apr 03, 2019 4:46 pm

Hello everyone,

I decided to by a JTAG debugger interface like this one, and I'm interested on recommendations. I've searched the forum but couldn't find anything.

My OS is Linux, and I'm writing bare metal code that I'd like to upload to memory and step through. I'd like it to be cheap and work with the RPi 1 board, but that's not a hard requirement.

Thanks,

Andre

dwelch67
Posts: 955
Joined: Sat May 26, 2012 5:32 pm

Re: JTAG Recommendations

Thu Apr 04, 2019 9:30 pm

I wouldnt say there are no recommendations, there was a lengthy discussion or two on jtag. The FT232H breakout from adafruit

https://www.adafruit.com/product/2264

is more than adequate for the job. The problem is not the debugger but setting up openocd or whatever else, now maybe if you spend hundreds to thousands for the debugger then sure for another few dozen to hundreds they will make it work for the raspberry pi with little to no effort on your part.

Should be able to do this though with any 3.3v ttl level capable ftdi part with mpsse. now does openocd support the pi3 not sure, no problem at all with the pi-zero.

you may know from my samples that I used jtag on the original pis and pi zero. and I use jtag dozens of times to hundreds of times a day at work using ftdi and openocd. but for the raspberry pi I put a reset button on the board and use my srec based bootloader instead.

YMMV. If you figure out how to configure openocd then please share in these forums.

David (dwelch67)

dwelch67
Posts: 955
Joined: Sat May 26, 2012 5:32 pm

Re: JTAG Recommendations

Thu Apr 04, 2019 9:35 pm

for the original pis basically the pi-zero is what you can buy new today. jtag is simple. I recommend openocd 0.9.0 as 0.10.0 and later is problematic not just with arm11s but I think cortex-ms too. certainly with arm11's though. If you dont hook up reset you can use the legacy ft2232 mode as the new ftdi mode has a download bug or at least it will download, sometimes report it didnt work when it really did and stop the download short. If you hook up reset hook it up like an existing board (at that time) like a flyswatter or other.

User avatar
Gavinmc42
Posts: 3429
Joined: Wed Aug 28, 2013 3:31 am

Re: JTAG Recommendations

Fri Apr 05, 2019 1:46 am

OpenOCD can also do JTAG via the GPIO pins on the Pi's.
https://learn.adafruit.com/programming- ... spberry-pi
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

Re: JTAG Recommendations

Sat Apr 06, 2019 5:14 pm

dwelch67 wrote:
Thu Apr 04, 2019 9:30 pm
I wouldnt say there are no recommendations, there was a lengthy discussion or two on jtag. The FT232H breakout from adafruit

https://www.adafruit.com/product/2264

is more than adequate for the job.

Thanks so much, I'll be getting on of those for sure.
dwelch67 wrote:
Thu Apr 04, 2019 9:30 pm
The problem is not the debugger but setting up openocd or whatever else

Well, I think I don't have much of a choice if I want to go down this road... LED and printf debugging aren't very productive.
dwelch67 wrote:
Thu Apr 04, 2019 9:30 pm
Should be able to do this though with any 3.3v ttl level capable ftdi part with mpsse.

Is the FT232H breakout the same voltage as the Raspberry Pi boards? I couldn't find this information in their page.
dwelch67 wrote:
Thu Apr 04, 2019 9:30 pm
but for the raspberry pi I put a reset button on the board and use my srec based bootloader instead.

Yeah, I also have an IHEX loader via the serial, makes it very convenient to test small things. However, the low transfers were a let down, and I'm hoping JTAG will help with that.
dwelch67 wrote:
Thu Apr 04, 2019 9:35 pm
I recommend openocd 0.9.0 as 0.10.0 and later is problematic not just with arm11s but I think cortex-ms too. certainly with arm11's though. If you dont hook up reset you can use the legacy ft2232 mode as the new ftdi mode has a download bug or at least it will download, sometimes report it didnt work when it really did and stop the download short.

Ah, thanks for the tip, will do.
dwelch67 wrote:
Thu Apr 04, 2019 9:30 pm
If you hook up reset hook it up like an existing board (at that time) like a flyswatter or other.

Sorry, I don't know what you mean.
Gavinmc42 wrote:
Fri Apr 05, 2019 1:46 am
OpenOCD can also do JTAG via the GPIO pins on the Pi's.
https://learn.adafruit.com/programming- ... spberry-pi

Thanks, that's very cool, I do own an Raspberry Pi 3 B+ so I could do this, but I think I'll give the FT232H breakout a go first.

gchamp
Posts: 6
Joined: Mon Apr 01, 2019 8:10 pm

Re: JTAG Recommendations

Sun Apr 07, 2019 6:48 pm

For what it's worth, I have successfully used OpenOCD to debug a raspberry pi 2B+ via JTAG using this guide and the segger JLINK probe. It is however on the expensive side. The arm DSTREAM probe also works out of the box with ARM DS-5 for raspberry pi 2 and 3 but is even more expensive.

leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

Re: JTAG Recommendations

Mon Apr 08, 2019 8:41 am

gchamp wrote:
Sun Apr 07, 2019 6:48 pm
For what it's worth, I have successfully used OpenOCD to debug a raspberry pi 2B+ via JTAG using this guide and the segger JLINK probe. It is however on the expensive side. The arm DSTREAM probe also works out of the box with ARM DS-5 for raspberry pi 2 and 3 but is even more expensive.
Thanks for the link, I'm sure it will be useful even with different JTAG adapters.

leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

Re: JTAG Recommendations

Wed May 01, 2019 9:23 pm

Ugh, only now that I have the FT232H breakout from Adafruit with me that I learned that the RPi B revision 1 board doesn't expose ARM_TMS pin...

I can't find the S5-11 pin to solder the wire, like dwelch67 says here. I know it's the SD card connector, but mine has a strange label next to it that doesn't read S5.

If someone can give me a hand I appreciate.
photo_2019-05-01_22-19-34.jpg
photo_2019-05-01_22-19-34.jpg (200.91 KiB) Viewed 1634 times

User avatar
rpdom
Posts: 14722
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: JTAG Recommendations

Thu May 02, 2019 5:35 am

S5 is not the SD card connector (S8). It is the camera connector.

leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

Re: JTAG Recommendations

Thu May 02, 2019 8:20 am

rpdom wrote:
Thu May 02, 2019 5:35 am
S5 is not the SD card connector (S8). It is the camera connector.
Ah nice catch! Do you know where I have to solder a wire to have access to ARM_TMS?

User avatar
rpdom
Posts: 14722
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: JTAG Recommendations

Thu May 02, 2019 9:32 am

I thinks so.

As it says, pin 11 of S5. Pin 1 is the connection furthest from the edge of the board. It's a bit fiddly, but a small wire could be soldered on if done carefully.

leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

Re: JTAG Recommendations

Thu May 02, 2019 10:36 am

rpdom wrote:
Thu May 02, 2019 9:32 am
I thinks so.

As it says, pin 11 of S5. Pin 1 is the connection furthest from the edge of the board. It's a bit fiddly, but a small wire could be soldered on if done carefully.
Thank you very much.

I wonder if there's a unconnected hole in the board that I could use to solder a single header pin and make a jumper to S5-11 to it? TP2 (at the center top of the board, just left of the composite plug) seems to be unconnected so it could serve this purpose.

User avatar
rpdom
Posts: 14722
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: JTAG Recommendations

Thu May 02, 2019 11:29 am

TP2 is connected to 0V. It is a Test Point for the power supply (TP1 is connected to +5V).

There are no unused holes on the board.

leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

Re: JTAG Recommendations

Thu May 02, 2019 1:11 pm

Thanks for the info. I'll see if I can cut off the tracks leading to one of those holes and solder the header.

User avatar
rpdom
Posts: 14722
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: JTAG Recommendations

Thu May 02, 2019 2:09 pm

Be careful with cutting tracks. The Pi is a multi-layer board and there could be tracks on a hidden level that are essential to the normal operation.

User avatar
rpdom
Posts: 14722
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: JTAG Recommendations

Thu May 02, 2019 2:11 pm

rpdom wrote:
Thu May 02, 2019 2:09 pm
Be careful with cutting tracks. The Pi is a multi-layer board and there could be tracks on a hidden level that are essential to the normal operation. It would be easier to solder a wire to the S5 connector and fix it in place with some hot glue or epoxy resin.

leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

Re: JTAG Recommendations

Thu May 02, 2019 2:33 pm

rpdom wrote:
Thu May 02, 2019 2:09 pm
Be careful with cutting tracks. The Pi is a multi-layer board and there could be tracks on a hidden level that are essential to the normal operation. It would be easier to solder a wire to the S5 connector and fix it in place with some hot glue or epoxy resin.
Yeah, good advice. I'll just glue one end of a wire to the board, and solder the other end to S5-11.

Thanks again, I have a plan now.

dwelch67
Posts: 955
Joined: Sat May 26, 2012 5:32 pm

Re: JTAG Recommendations

Sat May 04, 2019 1:21 am

You only need to find TMS that way using the old old original (available to the masses) cards, from there on out they were on a pin in the P1 connector, no soldering required.

You dont need trst, but if you do then it is not in a standard place with an ftdi mpsse chip, it is just a gpio so different existing jtag debuggers for arm used different ftdi gpio pins. tms/tdi/tdo/tck

dwelch67
Posts: 955
Joined: Sat May 26, 2012 5:32 pm

Re: JTAG Recommendations

Sat May 04, 2019 1:22 am

I didnt need to cut a trace, just soldered to the pin on the camera connector.

leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

Re: JTAG Recommendations

Sun May 05, 2019 1:45 pm

dwelch67 wrote:
Sat May 04, 2019 1:21 am
You only need to find TMS that way using the old old original (available to the masses) cards, from there on out they were on a pin in the P1 connector, no soldering required.
Unfortunately that's precisely my board. The 0x00010002 mailbox message (get board revision) returns 2, which is a model B, revision 1.0, 256 MB board made by Egoman.

I've decided to drop support for BCM2835-based boards. They're difficult to come by, and will only add complexity to what I'm doing because I'd have to support mono and multi-core CPUs in my BIOS. Maybe I'll port an Atari 2600 emulator to baremetal to use with this board and put it in an original VCS case just for the fun of it.

I've already ordered a 3 A+ to continue my experiments.

Thanks,

Andre

leiradel
Posts: 32
Joined: Wed Feb 13, 2019 10:38 pm

Re: JTAG Recommendations

Sat May 18, 2019 12:16 pm

Ok, I've already got a 3A+ but I refuse to give up on my 1B... I want to turn it into an barebones Atari 2600 emulator, but I'm having issues with the MMU that I'm unable to debug using the LED or the UART. So I've decided to solder the missing JTAG pin.

I'm however concerned about which pin to solder. Can someone hold my hand and point me to the exact pin on the board? I don't want to waste a perfectly functional board because I don't know how to correctly count the pins :?

Thanks in advance,

Andre

Return to “Bare metal, Assembly language”