Is redirecting stdout over JTAG possible?

moefear85
Posts: 43
Joined: Sun Sep 05, 2021 4:55 pm

Is redirecting stdout over JTAG possible?

Postby moefear85 » Sat Dec 30, 2023 11:27 pm

Hi,

I've recently begun debugging esp32 through openocd/jtag. However, serial output is sent to UART0. Is it possible to send this data in-band over JTAG?

RandomInternetGuy
Posts: 48
Joined: Fri Aug 11, 2023 4:56 am

Re: Is redirecting stdout over JTAG possible?

Postby RandomInternetGuy » Mon Jan 01, 2024 9:38 am

The search terms you seek are "Semihosting" and "Segger RTT". From the name, you can guess that one company kind of drove the adoption, but it's a simple array of circular queues that allows for separate streams for stdin, stdout, files, console, and more.

I've not reviewed these articles in depth at this moment, but seemingly providing reasonable overviews at a glance, we have (at least):
https://www.codeinsideout.com/blog/stm3 ... #debugging
https://www.segger.com/products/debug-p ... -transfer/
https://www.segger.com/news/231109-pr-j-link-vscode/
https://stackoverflow.com/questions/380 ... bugging-fr

... and more. With a little work, you can create your serial console to shove data into the semihosting system, have openocd/jlink/gdb noticed that the tail pointers moved, shovel them over DMA, and then have clever software on the host side format it, syntax highlight it, display errors, or whatever floats your boat.

The basic process seemed to first be popularized on STM parts, but it's now on CH32, most ESP32 devices, and multiple RISC-V devices and cores. Each has some funky rules, but the process is recognizable everywhere.

jackliu@zyate.com
Posts: 1
Joined: Wed Jan 03, 2024 9:16 am

Re: Is redirecting stdout over JTAG possible?

Postby jackliu@zyate.com » Wed Jan 03, 2024 9:46 am

I want to use the JTAG interface to update the ESP32-WROVER-E program. Do you have a burner with JTAG that can be used?

Who is online

Users browsing this forum: No registered users and 110 guests