Author Topic: Cheap JTAG debugger and speeds?  (Read 7126 times)

0 Members and 1 Guest are viewing this topic.

Offline brainwashTopic starter

  • Frequent Contributor
  • **
  • Posts: 463
  • Country: de
    • Hack Correlation
Cheap JTAG debugger and speeds?
« on: November 03, 2017, 01:26:56 pm »
As I wrote in another post, I'm using a BusPirate that was just laying around to debug an ESP32 using OpenOCD, over JTAG. This is slow, around 15-30 seconds to step over a line of code, out of which 5s is taken up by the thread/register refresh.
I've got an Olimex Tiny H in the mail and a JLink clone coming in with the slow boat.
I've tried using ESP8266 JTAG link (remote_bitbang) but GDB failed to connect to it. However the chip was enumerated fine.

I assume a lot of you have extensive knowledge on this topic. What would be a cheap (<100$) solution that is decently fast and reliable? I've used the integrated TI debugger on the Stellaris boards and it was nice to work with, certainly good enough for my needs. However I think it's limited to TI parts only, haven't tried using it on anything else.
I'm looking for OpenOCD/GDB integration and will be using Eclipse as my IDE. Or possibly gdb in command line mode.
 

Offline stmdude

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: se
Re: Cheap JTAG debugger and speeds?
« Reply #1 on: November 03, 2017, 04:59:59 pm »
I assume a lot of you have extensive knowledge on this topic.

I wouldn't expect there to be "a lot" of us, but there's a few of us.

I'm going to assume that you're talking about SWD debuggers, and not full JTAG debuggers (SWD can "only" debug one device at a time, whilst JTAG can use "chained" devices on more complex boards)

Speed-wise, a lot of it comes down to the software, and on some hardware, OpenOCD is slower than the vendors tools. Then again, in a few cases, OpenOCD is faster.  Just so you know.

The powerpoint presentation of "speed of debuggers" would go something like this:
Bitbangers -> CMSIS-DAP -> ST-Link -> JLink (with their tools, otherwise on-par with the ST-Links)

Bitbangers would be devices such as the buspirate, ESP8266 bitbang, FT2232 based devices, etc.
They are _slow_. Its been a while since I used one, but I would estimate the speed to <5KB/sec.
CMSIS-DAP is usually limited by the report-rate of USB-HID, topping out at 64KB/sec.
ST-Link can reach about 400KB/sec
I've seen JLinks (pro version) transferring at 1MB/sec

Of course, when flashing firmware you'll be limited by the performance of the NAND flash in your MCU.
 

Offline brainwashTopic starter

  • Frequent Contributor
  • **
  • Posts: 463
  • Country: de
    • Hack Correlation
Re: Cheap JTAG debugger and speeds?
« Reply #2 on: November 03, 2017, 05:33:27 pm »
Can those cheap SWD debuggers be used for something other than the STM chips? I was under the impression that they weren't. Talking about these ones:
https://www.aliexpress.com/item/JLink-OB-ARM-STM32-Debugger-Emulator-Programmer-Downloader-Instead-v8-SWD-Interface-Support-IAR-EWARM-and/32764334497.html
I don't know how they would work given that I don't see the TDI/TDO pair, but only one pin.

ARM-USB-Tiny-H is FT232R-based and claims 30MHz: https://www.olimex.com/Products/ARM/JTAG/_resources/ARM-USB-TINY_and_TINY_H_manual.pdf
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Cheap JTAG debugger and speeds?
« Reply #3 on: November 03, 2017, 05:46:30 pm »
I'm going to assume that you're talking about SWD debuggers, and not full JTAG debuggers (SWD can "only" debug one device at a time, whilst JTAG can use "chained" devices on more complex boards)
SWD is an ARM-specific interface. The ESP32 uses a standard JTAG port.

Offline stmdude

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: se
Re: Cheap JTAG debugger and speeds?
« Reply #4 on: November 03, 2017, 05:57:09 pm »
That JLink clone seems to be a ST-Link clone flashed with JLinks software from here:
https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/

It's only supposed to be used with STM devices, and I don't know if it's actually locked to that or not.

However, why are you looking into clones?  An authentic ST-LinkV2 goes for $22 at Mouser. They're not terribly expensive..
 

Offline brainwashTopic starter

  • Frequent Contributor
  • **
  • Posts: 463
  • Country: de
    • Hack Correlation
Re: Cheap JTAG debugger and speeds?
« Reply #5 on: November 05, 2017, 11:17:23 am »
I already have an ST-Link v2. I assumed that JLink clone was something similar, but, since I haven't seen one in person, I was asking around for an opinion.
 

Offline brainwashTopic starter

  • Frequent Contributor
  • **
  • Posts: 463
  • Country: de
    • Hack Correlation
Re: Cheap JTAG debugger and speeds?
« Reply #6 on: November 05, 2017, 05:08:03 pm »
Just a quick update, I wired up the Olimex ARM-USB-Tiny-H to the ESP32 board, added the following lines:
adapter_khz 30000
ftdi_tdo_sample_edge falling
and the thing is now flying. Stepping over takes 1s and pausing is well under 1s. This seems impressive to me given that FreeRTOS information (7 threads) is updated instantly.
 

Offline amymcneil

  • Newbie
  • Posts: 8
  • Country: us
  • AB1WH
Re: Cheap JTAG debugger and speeds?
« Reply #7 on: November 08, 2017, 04:53:07 am »
I've been using the Black Magic Probe, V2.1, which is a (very) small and smart SWD/JTAG debugger for use with the ARM Cortex series processors. I've been working with ST32F series chips using it and it rocks. Really, seriously fast. It speaks native GDB extended remote protocol over a USB link as a serial com type device. It also has a TTL level UART serial port that can be connected to separately. I do my development work on Unix (FreeBSD), and this thing just works. No fuss, no heartaches. Costs about $60 USD. No utilities required, just point GDB at it and have fun!

https://github.com/blacksphere/blackmagic/wiki
Some mornings it's just not worth gnawing through the straps....
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf