Cheap JTAG debugger and speeds? - Page 1
Forum section: electronics / general

author: brainwash
author_rank: Frequent Contributor
timestamp: November 03, 2017, 01:26:56 pm
content: 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.

author: stmdude
author_rank: Frequent Contributor
timestamp: November 03, 2017, 04:59:59 pm
content: Quote from: brainwash on November 03, 2017, 01:26:56 pmI 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/secI've seen JLinks (pro version) transferring at 1MB/secOf course, when flashing firmware you'll be limited by the performance of the NAND flash in your MCU.

author: brainwash
author_rank: Frequent Contributor
timestamp: November 03, 2017, 05:33:27 pm
content: 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.htmlI 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

author: andersm
author_rank: Super Contributor
timestamp: November 03, 2017, 05:46:30 pm
content: Quote from: stmdude on November 03, 2017, 04:59:59 pmSWD is an ARM-specific interface. The ESP32 uses a standard JTAG port.

author: stmdude
author_rank: Frequent Contributor
timestamp: November 03, 2017, 05:57:09 pm
content: 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..

author: brainwash
author_rank: Frequent Contributor
timestamp: November 05, 2017, 11:17:23 am
content: 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.

author: brainwash
author_rank: Frequent Contributor
timestamp: November 05, 2017, 05:08:03 pm
content: Just a quick update, I wired up the Olimex ARM-USB-Tiny-H to the ESP32 board, added the following lines:adapter_khz 30000ftdi_tdo_sample_edge fallingand 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.

author: amymcneil
author_rank: Contributor
timestamp: November 08, 2017, 04:53:07 am
content: 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