ESP32 S2 bootloading using JTag on VScode not working with ESP-Prog

RalphD
Posts: 103
Joined: Thu Nov 25, 2021 9:02 pm

ESP32 S2 bootloading using JTag on VScode not working with ESP-Prog

Postby RalphD » Sat Dec 11, 2021 8:06 pm

Basically the custom board is just an ESP32 S2 sticking on the board with a 3.3V supply and Jtag connector.

Reading to the poor documentation I could find in reasonable time I believe that just Jtag should be enough, no reset pin or anything else required using Jtag for flashing.

In VScode I figured out that the flashing procedures are different invoked from ESP-IDF: Flash (with Jtag) or from the flash button in the status bar. And from both I have different messages.

Flashing from the status bar gives me this error message:

Code: Select all

esptool.py v3.1-dev
Serial port COM18
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32-S2: Timed out waiting for packet header
The terminal process "C:\.espressif\python_env\idf4.3_py3.8_env\Scripts\python.exe 'C:\esp-idf\components\esptool_py\esptool\esptool.py', '-p', 'COM18', '-b', '460800', '--before', 'default_reset', '--after', 'hard_reset', '--chip', 'esp32s2', 'write_flash', '--flash_mode', 'dio', '--flash_freq', '80m', '--flash_size', 'detect', '0x10000', 'simple.bin', '0x1000', 'bootloader/bootloader.bin', '0x8000', 'partition_table/partition-table.bin'" terminated with exit code: 2.
I can see that the ESP-Prog is working, the green LED is flashing, I checked the cable to the Jtag connector and the connection to the ESP32 S2 module. All pins toggle but no clock is ever generated on TCKL. I used different ESP-Prog and cables.

If I try flashing from the command pallete using IDF> flash (using Jtag) the error message is like this from openOCD debugger.
I have configured before to the right config file /devkit1V1.cfg or /devkit1_V1.cfg by copying because first one is searched.

Code: Select all

Info : accepting 'tcl' connection on tcp/6666
Info : dropped 'tcl' connection
Info : accepting 'tcl' connection on tcp/6666
Flashing c:/Users/ralph/vscode/server/build/partition_table/partition-table.bin at 0x8000
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0xffffffff (mfg: 0x7ff (<invalid>), part: 0xffff, ver: 0xf)
Warn : JTAG tap: esp32.cpu1       UNEXPECTED: 0xffffffff (mfg: 0x7ff (<invalid>❌ ), part: 0xffff, ver: 0xf)
Error: JTAG tap: ❌ esp32.cpu1  expected 1 of 1: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Error: Trying to use configured scan chain anyway...
❌ Error: esp32.cpu1: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
❌ Error: Couldn't halt target before SoC reset
** Flashing Failed **
-1
I developed and flashed using JTag flawlessly on the kaluga board. Can you help with any interpretation of the situation?

best wishes

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 S2 bootloading using JTag on VScode not working with ESP-Prog

Postby ESP_Sprite » Sun Dec 12, 2021 2:54 am

Flashing from the status bar tries to use serial; if you don't have a serial connection, that's not gonna work. Your JTAG connection only seems to be partially functioning: suggest you check the connection, perhaps lower the adapter speed (sorry, I have no idea how to do that under vscode as I don't use that) and make sure you don't have any firmware loaded that re-uses the JTAG pins for something else.

Who is online

Users browsing this forum: No registered users and 52 guests