Author Topic: What can i use to program an ESP32-H2 via JTAG?  (Read 321 times)

0 Members and 1 Guest are viewing this topic.

Offline JPorticiTopic starter

  • Super Contributor
  • ***
  • Posts: 3634
  • Country: it
What can i use to program an ESP32-H2 via JTAG?
« on: April 23, 2025, 01:09:32 pm »
I probably dun goof'd this pcb.
I've been playing around an ESP32 H2 devboard
I then designed a prototype, but i can't figure out how to program/debug it.

I routed all the JTAG pins, UART, RESET and BOOT to a connector. Turns out i forgot that ST-Link/J-Link can't program devices other than ST, so i don't have a programmer for it.
It was my understanding that i just had to apply power to the device with BOOT low in order to enter download mode, which i did, but "A fatal error occurred: Failed to connect to ESP32-H2: No serial data received" - 75% sure the connections are correct as the device power ups and spits the wrong checksum error through the terminal

* i did not route the USB pins as i plan for USB to NOT be accessible in production so they are not reachable. Too bad because it would have been problem solved, as the H2 features USB-JTAG by default *

What can i do?
I do have a couple of ESP devboards here and there, i did a quick google to see if i could convert them to a debug probe... but besides not being able to find a project, would that even work? these are RISC-V and not ARM..
I probably have an usb-uart that routes the control pins
And of course i have several programmers, but they are all tied to the manufacturer
Which programmer should i get, besides a genuine JLink which is too much at this moment?
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 655
  • Country: ie
    • LinkedIn
Re: What can i use to program an ESP32-H2 via JTAG?
« Reply #1 on: April 23, 2025, 01:50:16 pm »
As datasheet says by default JTAG port connected to internal USB Serial (and disconnected from physical JTAG pins), so any external JTAG adapter do not help.
Only one possible solution is to use UART pins. Any external USB-UART adapter will work out.

Quote
It was my understanding that i just had to apply power to the device with BOOT low in order to enter download mode, which i did, but "A fatal error occurred: Failed to connect to ESP32-H2: No serial data received"

Check connection of UART - especially UART levels (I have some troubles with CH340 USB-UART bridge - it generates TX signal with low level about 0.9V. ESP32 sometimes don't understand it)


 

Offline JPorticiTopic starter

  • Super Contributor
  • ***
  • Posts: 3634
  • Country: it
Re: What can i use to program an ESP32-H2 via JTAG?
« Reply #2 on: April 23, 2025, 03:37:43 pm »
As datasheet says by default JTAG port connected to internal USB Serial (and disconnected from physical JTAG pins), so any external JTAG adapter do not help.
Only one possible solution is to use UART pins. Any external USB-UART adapter will work out.

Quote
It was my understanding that i just had to apply power to the device with BOOT low in order to enter download mode, which i did, but "A fatal error occurred: Failed to connect to ESP32-H2: No serial data received"

Check connection of UART - especially UART levels (I have some troubles with CH340 USB-UART bridge - it generates TX signal with low level about 0.9V. ESP32 sometimes don't understand it)

Ah! That sucks. What do people do for production programming then?

Ultimately: my problem was that i pulled down GPIO8 instead of pulling it up :palm: now it can be programmed with the UART bootloader, but the board will be -obviously- reworked
 

Offline Fire Doger

  • Regular Contributor
  • *
  • Posts: 225
  • Country: gr
  • Stefanos
Re: What can i use to program an ESP32-H2 via JTAG?
« Reply #3 on: April 23, 2025, 03:52:16 pm »
To use always the JTAG pins burn fuse "EFUSE_DIS_USB_JTAG" via uart https://docs.espressif.com/projects/esptool/en/latest/esp32h2/espefuse/burn-efuse-cmd.html

Code: [Select]
espefuse.py --port COMxx burn_efuse  DIS_USB_JTAG 1
To use normal jlink as debugger change the driver with zadig to winusb. (I can't remember if cracked STLinkReflash works too, but it will also require winusb driver)

I use ESP-Prog https://www.aliexpress.com/item/1005006149037453.html
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf