ESP-Prog JTAG debugging with ESP32S3

skanky
Posts: 20
Joined: Mon Nov 21, 2022 12:58 pm

ESP-Prog JTAG debugging with ESP32S3

Postby skanky » Tue Jan 31, 2023 3:15 pm

I've been having a painful time getting debugging to work on the ESP32S3. I have a Espressif sample I2C application that runs fine when programmed over the serial port. Connect via JTAG using the ESP-Prog, I've jumped through various issues such as
1) "connect ECONNREFUSED 127.0.0.1:9998"
Solved in launch.json, changing mode to auto seems to solve this (no idea why because the Espressif sample code is "version": "0.2.0" and specified it as "manual"

2) Then I get "Failed to init Debug Adapter!" when trying to run with debugger. Looking at the OUTPUT window it shows "ERROR - Failed to wait for completion of command". So I find a resource telling me in launch.json, change tmoScaleFactor from 1 to 2 which I do.

Now when I run the debugger, I never get to my application, instead I get "Exception has occurred" errors occurring in the SDK code (e.g. cpu.c after esp_cpu_wait_for_intr()

Is there anyone who can help me solve this and just get the ESP32S3 up and running for JTAG debugging?

The Halt exception screen grab is attached.

I'm using VSCode for Windows, I've used the VSCode Espressif IDF plugin to perform my install.

Here's my launch.json

Code: Select all

{
	"version": "0.2.0",
	"configurations": [
	  {
		"name": "OpenOCD Debugging",
		"type": "espidf",
		"request": "launch",
		"debugPort": 9998,
		"logLevel": 2,
		"mode": "auto",
		"verifyAppBinBeforeDebug": false,
		"tmoScaleFactor": 2,
		"initGdbCommands": [
		  "target remote :3333",
		  "symbol-file /build/VimmsLite_main.elf",
		  "mon reset halt",
		  "flushregs",
		  "thb app_main",
		  "c"
		],
		"env": {
		  "CUSTOM_ENV_VAR": "SOME_VALUE"
		}
	  }
	]
}
Here's my OUTPUT window with an "Exception has occurred" halt

Code: Select all

[Debug Adapter]
DEBUG_ADAPTER_STARTED
2023-01-31 15:07:53,838 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STARTED
[Debug Adapter]
DEBUG_ADAPTER_READY2CONNECT
2023-01-31 15:07:53,842 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_READY2CONNECT
[OpenOCD]
Info : accepting 'gdb' connection on tcp/3333
[OpenOCD]
Info : New GDB Connection: 1, Target esp32s3.cpu0, state: halted
[Debug Adapter]
2023-01-31 15:08:01,352 - Debug Adapter (main) - WARNING - The operation took too long! - Measured 7.507739 s ( from ~ 15:07:53,844678)
[OpenOCD]
Info : dropped 'gdb' connection
[OpenOCD]
Info : accepting 'gdb' connection on tcp/3333
[OpenOCD]
Info : New GDB Connection: 1, Target esp32s3.cpu0, state: halted
Attachments
Capture.jpg
Capture.jpg (1.24 MiB) Viewed 14683 times

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: ESP-Prog JTAG debugging with ESP32S3

Postby ESP_bignacio » Wed Feb 01, 2023 3:23 am

Could you share the extension troubleshooting information ?

skanky
Posts: 20
Joined: Mon Nov 21, 2022 12:58 pm

Re: ESP-Prog JTAG debugging with ESP32S3

Postby skanky » Wed Feb 01, 2023 8:31 am

Thank you for the response

Log attached

ESP-IDF: Doctor command

Code: Select all

---------------------------------------------- ESP-IDF Extension for Visual Studio Code report ---------------------------------------------
OS win32 x64 10.0.22621 
System environment variable IDF_PYTHON_ENV_PATH 
 undefined 
System environment variable PATH 
 C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microchip\xc8\v1.45\bin;C:\Program Files (x86)\Microchip\xc32\v1.31\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Microchip\xc16\v1.26\bin;C:<HOMEPATH>\AppData\Local\Microsoft\WindowsApps;C:<HOMEPATH>\AppData\Local\GitHubDesktop\bin;C:<HOMEPATH>\AppData\Local\MaxTo\;C:<HOMEPATH>\.dotnet\tools;C:<HOMEPATH>\AppData\Local\Programs\Microsoft VS Code\bin;C:\Espressif\.espressif\python_env\idf5.0_py3.8_env\Scripts\; 
System environment variable PYTHON 
 undefined 
Visual Studio Code version 1.74.3 
Visual Studio Code language en 
Visual Studio Code shell C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe 
ESP-IDF Extension version 1.5.1 
Workspace folder c:\_Dropbox\Dropbox\_PROGRAMMING\zGIT_LIVE_MASTER\Dyena-VimmsLite-MainPcb\VimmsLite_main 
---------------------------------------------------- Extension configuration settings ------------------------------------------------------
ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH}
ESP-IDF Path (idf.espIdfPath) C:\Espressif\esp\esp-idf
ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH}
ESP-Matter Path (idf.espMatterPath) ${env:ESP_MATTER_PATH}
Custom extra paths (idf.customExtraPaths) C:\Espressif\.espressif\tools\xtensa-esp-elf-gdb\11.2_20220823\xtensa-esp-elf-gdb\bin;C:\Espressif\.espressif\tools\riscv32-esp-elf-gdb\11.2_20220823\riscv32-esp-elf-gdb\bin;C:\Espressif\.espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin;C:\Espressif\.espressif\tools\xtensa-esp32s2-elf\esp-2022r1-11.2.0\xtensa-esp32s2-elf\bin;C:\Espressif\.espressif\tools\xtensa-esp32s3-elf\esp-2022r1-11.2.0\xtensa-esp32s3-elf\bin;C:\Espressif\.espressif\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin;C:\Espressif\.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;C:\Espressif\.espressif\tools\cmake\3.24.0\bin;C:\Espressif\.espressif\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin;C:\Espressif\.espressif\tools\ninja\1.10.2;C:\Espressif\.espressif\tools\idf-exe\1.0.3;C:\Espressif\.espressif\tools\ccache\4.6.2\ccache-4.6.2-windows-x86_64;C:\Espressif\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64
Custom extra vars (idf.customExtraVars) {"OPENOCD_SCRIPTS":"C:\\Espressif\\.espressif\\tools\\openocd-esp32\\v0.11.0-esp32-20221026/openocd-esp32/share/openocd/scripts","IDF_CCACHE_ENABLE":"1"}
Virtual env Python Path (idf.pythonBinPath) C:\Espressif\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe
Serial port (idf.port) COM10
OpenOCD Configs (idf.openOcdConfigs) interface/ftdi/esp32_devkitj_v1.cfg,target/esp32s3.cfg
ESP-IDF Tools Path (idf.toolsPath) C:\Espressif\.espressif
Git Path (idf.gitPath) C:\Espressif\.espressif\tools\idf-git\2.30.1\cmd\git.exe
-------------------------------------------------------- Configurations access -------------------------------------------------------------
Access to ESP-ADF Path (idf.espAdfPath) false
Access to ESP-IDF Path (idf.espIdfPath) true
Access to ESP-MDF Path (idf.espMdfPath) false
Access to ESP-Matter Path (idf.espMatterPath) false
Access to ESP-IDF Custom extra paths
Access to C:\Espressif\.espressif\tools\xtensa-esp-elf-gdb\11.2_20220823\xtensa-esp-elf-gdb\bin: true
Access to C:\Espressif\.espressif\tools\riscv32-esp-elf-gdb\11.2_20220823\riscv32-esp-elf-gdb\bin: true
Access to C:\Espressif\.espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin: true
Access to C:\Espressif\.espressif\tools\xtensa-esp32s2-elf\esp-2022r1-11.2.0\xtensa-esp32s2-elf\bin: true
Access to C:\Espressif\.espressif\tools\xtensa-esp32s3-elf\esp-2022r1-11.2.0\xtensa-esp32s3-elf\bin: true
Access to C:\Espressif\.espressif\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin: true
Access to C:\Espressif\.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: true
Access to C:\Espressif\.espressif\tools\cmake\3.24.0\bin: true
Access to C:\Espressif\.espressif\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin: true
Access to C:\Espressif\.espressif\tools\ninja\1.10.2: true
Access to C:\Espressif\.espressif\tools\idf-exe\1.0.3: true
Access to C:\Espressif\.espressif\tools\ccache\4.6.2\ccache-4.6.2-windows-x86_64: true
Access to C:\Espressif\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64: true
Access to Virtual env Python Path (idf.pythonBinPath) true
Access to CMake in environment PATH undefined
Access to Ninja in environment PATH undefined
Access to ESP-IDF Tools Path (idf.toolsPath) true
-------------------------------------------------------- Configurations has spaces -------------------------------------------------------------
Spaces in system environment Path true
Spaces in ESP-ADF Path (idf.espAdfPath) false
Spaces in ESP-IDF Path (idf.espIdfPath) false
Spaces in ESP-MDF Path (idf.espMdfPath) false
Spaces in ESP-Matter Path (idf.espMatterPath) false
Spaces in ESP-IDF Custom extra paths
Spaces in C:\Espressif\.espressif\tools\xtensa-esp-elf-gdb\11.2_20220823\xtensa-esp-elf-gdb\bin: false
Spaces in C:\Espressif\.espressif\tools\riscv32-esp-elf-gdb\11.2_20220823\riscv32-esp-elf-gdb\bin: false
Spaces in C:\Espressif\.espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin: false
Spaces in C:\Espressif\.espressif\tools\xtensa-esp32s2-elf\esp-2022r1-11.2.0\xtensa-esp32s2-elf\bin: false
Spaces in C:\Espressif\.espressif\tools\xtensa-esp32s3-elf\esp-2022r1-11.2.0\xtensa-esp32s3-elf\bin: false
Spaces in C:\Espressif\.espressif\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin: false
Spaces in C:\Espressif\.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: false
Spaces in C:\Espressif\.espressif\tools\cmake\3.24.0\bin: false
Spaces in C:\Espressif\.espressif\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin: false
Spaces in C:\Espressif\.espressif\tools\ninja\1.10.2: false
Spaces in C:\Espressif\.espressif\tools\idf-exe\1.0.3: false
Spaces in C:\Espressif\.espressif\tools\ccache\4.6.2\ccache-4.6.2-windows-x86_64: false
Spaces in C:\Espressif\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64: false
Spaces in Virtual env Python Path (idf.pythonBinPath) false
Spaces in ESP-IDF Tools Path (idf.toolsPath) false
----------------------------------------------------------- Executables Versions -----------------------------------------------------------
Git version 2.30.1.windows.1
ESP-IDF version 5.0
Python version 3.8.7
Python's pip version 22.3.1
-------------------------------------------------- Python packages in idf.pythonBinPath ----------------------------------------------------
bitstring version: 3.1.9
CacheControl version: 0.12.11
certifi version: 2022.12.7
cffi version: 1.15.1
charset-normalizer version: 3.0.1
click version: 8.0.4
colorama version: 0.4.6
construct version: 2.10.68
contextlib2 version: 21.6.0
cryptography version: 36.0.2
ecdsa version: 0.18.0
esp-coredump version: 1.4.2
esptool version: 4.4
freertos-gdb version: 1.0.2
future version: 0.18.2
gcovr version: 5.2
idf-component-manager version: 1.2.2
idna version: 3.4
Jinja2 version: 3.0.3
kconfiglib version: 14.1.0
lockfile version: 0.12.2
lxml version: 4.9.2
MarkupSafe version: 2.1.2
msgpack version: 1.0.4
packaging version: 23.0
pip version: 22.3.1
psutil version: 5.9.4
pycparser version: 2.21
pyelftools version: 0.27
pygdbmi version: 0.9.0.2
Pygments version: 2.14.0
pyparsing version: 3.0.9
pyserial version: 3.5
pywin32 version: 305
PyYAML version: 6.0
reedsolo version: 1.5.4
requests version: 2.28.2
requests-file version: 1.5.1
requests-toolbelt version: 0.10.1
schema version: 0.7.5
setuptools version: 66.1.1
six version: 1.16.0
tqdm version: 4.64.1
urllib3 version: 1.26.14
websocket-client version: 1.4.2
wheel version: 0.36.2
windows-curses version: 2.3.1
xmlrunner version: 1.7.7
---------------------------------------------------- Check ESP-IDF python requirements.txt -------------------------------------------------
Check ESP-IDF Python packages Python requirements are satisfied.
---------------------------------------------------- Check extension requirements.txt ------------------------------------------------------
Check Extension Python packages Python requirements are satisfied.
---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------
Check Debug AdapterPython packages Python requirements are satisfied.
---------------------------------------------------- Visual Studio Code launch.json --------------------------------------------------------
{
	"version": "0.2.0",
	"configurations": [
	  {
		"name": "OpenOCD Debugging",
		"type": "espidf",
		"request": "launch",
		"debugPort": 9998,
		"logLevel": 2,
		"mode": "auto",
		"verifyAppBinBeforeDebug": false,
		"tmoScaleFactor": 2,
		"initGdbCommands": [
		  "target remote :3333",
		  "symbol-file /build/VimmsLite_main.elf",
		  "mon reset halt",
		  "flushregs",
		  "thb app_main",
		  "c"
		],
		"env": {
		  "CUSTOM_ENV_VAR": "SOME_VALUE"
		}
	  }
	]
}

 
---------------------------------------------------- Visual Studio Code c_cpp_properties.json ----------------------------------------------
{
    "configurations": [
        {
            "name": "ESP-IDF",
            "compilerPath": "C:\\Espressif\\.espressif\\tools\\xtensa-esp32s3-elf\\esp-2022r1-11.2.0\\xtensa-esp32s3-elf\\bin\\xtensa-esp32s3-elf-gcc.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "includePath": [
                "${config:idf.espIdfPath}/components/**",
                "${config:idf.espIdfPathWin}/components/**",
                "${config:idf.espAdfPath}/components/**",
                "${config:idf.espAdfPathWin}/components/**",
                "${workspaceFolder}/**"
            ],
            "browse": {
                "path": [
                    "${config:idf.espIdfPath}/components",
                    "${config:idf.espIdfPathWin}/components",
                    "${config:idf.espAdfPath}/components/**",
                    "${config:idf.espAdfPathWin}/components/**",
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": false
            }
        }
    ],
    "version": 4
}
 
--------------------------------------------------------------------------------------------------------------------------------------------

OUTPUT ESP-IDF

Code: Select all

[OpenOCD]
Open On-Chip Debugger v0.11.0-esp32-20221026 (2022-10-26-14:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
[OpenOCD]
debug_level: 2

[OpenOCD]
adapter speed: 20000 kHz

[OpenOCD]
Info : Listening on port 6666 for tcl connections
[OpenOCD]
Info : Listening on port 4444 for telnet connections
[OpenOCD]
❌ Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPP[OpenOCD]
ORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi tdo_sample_edge falling"
Info : clock speed 20000 kHz
[OpenOCD]
Info : JTAG tap: esp32s3.cpu0 tap/d[OpenOCD]
evice found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
[OpenOCD]
Info : starting gdb server for esp32s3.cpu0[OpenOCD]
 on 3333
Info : Listening on port 3333 for gdb connections
[OpenOCD]
Info : [esp32s3.cpu0] Debug controller was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu1] Debug controller was reset.
[OpenOCD]
Info : [esp32s3.cpu1] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x40377561, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu0] Reset cause (1) - (Power on reset)
[OpenOCD]
Info : [esp32s3.cpu1] Target halted, PC=0x403788EA, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu1] Reset cause (1) - (Power on reset)
[OpenOCD]
Info : accepting 'tcl' connection on tcp/6666
Info : dropped 'tcl' connection
[OpenOCD]
Info : accepting 'tcl' connection on tcp/6666
[OpenOCD]
Flashing c:/_Dropbox/Dropbox/_PROGRAMMING/zGIT_LIVE_[OpenOCD]
MASTER/Dyena-VimmsLite-MainPcb/VimmsLite_main/build/bootloader/bootloader.bin at 0x0
[OpenOCD]
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tens[OpenOCD]
ilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
[OpenOCD]
Info : [esp32s3.cpu0] requesting targ[OpenOCD]
et halt and executing a soft reset
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x4037DB99, [OpenOCD]
debug_reason=00000000
Info : Set GDB target to 'esp32s3.cpu0'
[OpenOCD]
Info : [esp32s3.cpu1] Target halted, PC=0x403788E[OpenOCD]
A, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu0] Debug controller was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x500000EF, debug_reason=00[OpenOCD]
000000
[OpenOCD]
Info : [esp32s3.cpu0] Reset cause (3) - (Software core reset)
[OpenOCD]
Info : [esp32s3.cpu1] requesting target halt and executing a soft reset
[OpenOCD]
Info : [esp32s3.cpu0] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x4000040[OpenOCD]
0, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu1] Debug controller was rese[OpenOCD]
t.
Info : [esp32s3.cpu1] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32s3.cpu1] Reset cause (3) - (Softwar[OpenOCD]
e core reset)
[OpenOCD]
Info : [esp32s3.cpu0] Reset cause (3) - (Software core reset)
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : Flash mapping 0: 0x10020 -> 0x3c020020, 32 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 100 KB
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : Auto-detected flash bank 'esp32s3.cpu0.flash' size 16384 KB
Info : Using flash bank 'esp32s3.cpu0.flash' size 16384 KB
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : Flash mapping 0: 0x10020 -> 0x3c020020, 32 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 100 KB
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : Auto-detected flash bank 'esp32s3.cpu1.flash' size 16384 KB
Info : Using flash bank 'esp32s3.cpu1.flash' size 16384 KB
[OpenOCD]
** Programming Started **
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : PROF: Erased 24576 bytes in 191.777 ms
[OpenOCD]
Info : PROF: Data transferred in 79.426 ms @ 302.168 KB/s
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : PROF: Wrote 24576 bytes in 324.964 ms (data transfer time included)
[OpenOCD]
** Programming Finished in 927 ms **
[OpenOCD]
** Verify Started **
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : PROF: Flash verified in 43.01 ms 
[OpenOCD]
** Verify OK **
[OpenOCD]
** Flashing done for bootloader/bootloader.bin in 983 ms **
[OpenOCD]
Flashing c:/_Dropbox/Dropbox/_PROGRAMMING/zGIT_LIVE_MASTER/Dyena-VimmsLite-MainPcb/[OpenOCD]
VimmsLite_main/build/VimmsLite_main.bin at 0x10000
[OpenOCD]
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x12[OpenOCD]
0034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
[OpenOCD]
Info : [esp32s3.cpu0] requesting target halt and executing a soft reset
[OpenOCD]
Info : [esp32s3.cpu0] Debug controller was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x500000EF, debug_reason=00000[OpenOCD]
000
[OpenOCD]
Info : [esp32s3.cpu0] Reset cause (3) - [OpenOCD]
(Software core reset)
[OpenOCD]
Info : [esp32s3.cpu1] requesting target halt and executing a soft reset
Info : [esp32s3.cpu0] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x400004[OpenOCD]
00, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu1] Debug controller was reset.
Info : [esp32s3.cpu1] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu1] Target halted, PC=0x400[OpenOCD]
00400, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu1] Reset cause (3) - (Software core reset)
[OpenOCD]
Info : [esp32s3.cpu0] Reset cause (3) - (Softw[OpenOCD]
are core reset)
[OpenOCD]
** Programming Started **
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482,[OpenOCD]
 debug_reason=00000001
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_r[OpenOCD]
eason=00000001
[OpenOCD]
Info : PROF: Erased 200704 bytes in 676.528 ms
[OpenOCD]
Info : PROF: Data transferred in 756.29 ms @ 259.16 KB/s
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : PROF: Wrote 200704 bytes in 1059.11 ms (data transfer time included)
[OpenOCD]
** Programming Finished in 1986 ms **
[OpenOCD]
** Verify Started **
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : PROF: Flash verified in 140.454 ms 
[OpenOCD]
** Verify OK **
[OpenOCD]
** Flashing done for VimmsLite_main.bin in 2139 ms **
[OpenOCD]
Flashing c:/_Dropbox/Dropbox/_PROGR[OpenOCD]
AMMING/zGIT_LIVE_MASTER/Dyena-VimmsLite-MainPcb/VimmsLite_main/build/partition_table/partition-table.bin at 0x8000
[OpenOCD]
Info : JTAG tap: esp32s3.cpu0 tap/device[OpenOCD]
 found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
[OpenOCD]
Info : [esp32s3.cpu0] requesting [OpenOCD]
target halt and executing a soft reset
[OpenOCD]
Info : [esp32s3.cpu0] Debug controller was reset.
In[OpenOCD]
fo : [esp32s3.cpu0] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x500000EF, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu0] Reset cause (3) - (Software core reset)
[OpenOCD]
Info : [esp32s3.cpu1] requestin[OpenOCD]
g target halt and executing a soft reset
[OpenOCD]
Info : [esp32s3.cpu0] Core was r[OpenOCD]
eset.
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x40[OpenOCD]
000400, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu1] Debug controller was reset.
Info : [esp32s3.cpu1] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu1] Target halted, P[OpenOCD]
C=0x40000400, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu1] Reset cau[OpenOCD]
se (3) - (Software core reset)
[OpenOCD]
Info : [esp32s3.cpu0] Reset cause (3) - (Software c[OpenOCD]
ore reset)
[OpenOCD]
** Programming Started **
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : PROF: Erased 4096 bytes in 58.385 ms
[OpenOCD]
Info : PROF: Data transferred in 32.217 ms @ 124.158 KB/s
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : PROF: Wrote 4096 bytes in 244.099 ms [OpenOCD]
(data transfer time included)
[OpenOCD]
** Programming Finished in 546 ms **
[OpenOCD]
** Verify Started **
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : PROF: Flash verified in 36.418 ms 
[OpenOCD]
** Verify OK **
[OpenOCD]
** Flashing done for partition_table/partition-table.bin in 59[OpenOCD]
5 ms **
[OpenOCD]
** Total programming time 3725 ms **[OpenOCD]

[OpenOCD]
** Resetting Target **
[OpenOCD]
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1[OpenOCD]
 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
[OpenOCD]
Info : [esp32s3.cpu0] requesting target halt [OpenOCD]
and executing a soft reset
[OpenOCD]
Info : [esp32s3.cpu0] Debug controller was reset.
Info : [OpenOCD]
[esp32s3.cpu0] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x500000EF, [OpenOCD]
debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu0] Reset cause (3) -[OpenOCD]
 (Software core reset)
[OpenOCD]
Info : [esp32s3.cpu1] requesting target halt and executing a soft reset
[OpenOCD]
Info : [esp32s3.cpu0] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu1] Debug controller was reset.
[OpenOCD]
Info : [esp32s3.cpu1] Core was reset.
[OpenOCD]
0
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x40056F5E, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu0] Reset cause (3) - [OpenOCD]
(Software core reset)
[OpenOCD]
Info : [esp32s3.cpu1] Target halted, PC=0x40043A3B,[OpenOCD]
 debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu1] Reset cause (3) - (Software core reset)
[OpenOCD]
Info : [esp32s3.cpu1] Debug controller was reset.
[OpenOCD]
Info : [esp32s3.cpu1] Core was reset.
[OpenOCD]
Info : [esp32s3.cpu1] Target halted, PC=0x403788EA, debug_r[OpenOCD]
eason=00000000
[OpenOCD]
Info : [esp32s3.cpu1] Reset cause (3) - (Software core re[OpenOCD]
set)
[Debug Adapter]
2023-02-01 08:28:19,621 - Debug Adapter (main) - INFO - Working directory: C:\Users\adam\AppData\Local\Programs\Microsoft VS Code
2023-02-01 08:28:19,622 - Debug Adapter (main) - INFO - Arguments: 
{   'app_flash_off': 65536,
    'board_type': None,
    'cmdfile': 'c:\\_Dropbox\\Dropbox\\_PROGRAMMING\\zGIT_LIVE_MASTER\\Dyena-VimmsLite-MainPcb\\VimmsLite_main\\esp-idf-vscode-generated.gdb',
    'core_file': (),
    'debug': 3,
    'developer_mode': 'none',
    'device_name': 'esp32s3',
    'elfpath': (   'c:\\_Dropbox\\Dropbox\\_PROGRAMMING\\zGIT_LIVE_MASTER\\Dyena-VimmsLite-MainPcb\\VimmsLite_main\\build\\VimmsLite_main.elf',),
    'log_file': 'c:\\_Dropbox\\Dropbox\\_PROGRAMMING\\zGIT_LIVE_MASTER\\Dyena-VimmsLite-MainPcb\\VimmsLite_main\\debug.log',
    'log_mult_files': None,
    'log_no_debug_console': None,
    'oocd': 'openocd',
    'oocd_args': None,
    'oocd_ip': 'localhost',
    'oocd_mode': 'connect_to_instance',
    'oocd_scripts': None,
    'port': 9998,
    'postmortem': False,
    'tmo_scale_factor': 2,
    'toolchain_prefix': 'xtensa-esp32s3-elf-'}
DEBUG_ADAPTER_STARTED
2023-02-01 08:28:19,623 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STARTED
2023-02-01 08:28:19,623 - Debug Adapter (main) - INFO - Starting. Cmd: c:\Users\adam\.vscode\extensions\espressif.esp-idf-extension-1.5.1\esp_debug_adapter\debug_adapter_main.py -d 3 -e c:\_Dropbox\Dropbox\_PROGRAMMING\zGIT_LIVE_MASTER\Dyena-VimmsLite-MainPcb\VimmsLite_main\build\VimmsLite_main.elf -l c:\_Dropbox\Dropbox\_PROGRAMMING\zGIT_LIVE_MASTER\Dyena-VimmsLite-MainPcb\VimmsLite_main\debug.log -p 9998 -dn esp32s3 -a 0x10000 -t xtensa-esp32s3-elf- -x c:\_Dropbox\Dropbox\_PROGRAMMING\zGIT_LIVE_MASTER\Dyena-VimmsLite-MainPcb\VimmsLite_main\esp-idf-vscode-generated.gdb -tsf 2

[Debug Adapter]
2023-02-01 08:28:19,627 - Debug Adapter (main) - INFO - Listening on port 9998
DEBUG_ADAPTER_READY2CONNECT
2023-02-01 08:28:19,627 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_READY2CONNECT
[Debug Adapter]
2023-02-01 08:28:20,514 - Gdb - INFO - NOTIFY: thread-group-added {'id': 'i1'}
[OpenOCD]
Info : accepting 'gdb' connection on tcp/3333
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x4037DB7F, debug_reason=00000000
[OpenOCD]
Info : [esp32s3.cpu1] Target halted, PC=0x403788EA, debug_reason=00000000
[OpenOCD]
Warn : No symbols for FreeRTOS!
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : Flash mapping 0: 0x10020 -> 0x3c020020, 32 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 100 KB
Info : Using flas[OpenOCD]
h bank 'esp32s3.cpu0.irom' size 104 KB
[OpenOCD]
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
[OpenOCD]
Info : Flash mapping 0: 0x10020 -> 0x3c020020, 32 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 100 KB
Info : Using flash b[OpenOCD]
ank 'esp32s3.cpu0.drom' size 36 KB
Info : New GDB Connection: 1, Target esp32s3.cpu0, state: halted
[OpenOCD]
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
[OpenOCD]
Info : Detected FreeRTOS version: (10.4.3)
[Debug Adapter]
2023-02-01 08:28:28,088 - Gdb - INFO - NOTIFY: thread-group-started {'id': 'i1', 'pid': '42000'}
2023-02-01 08:28:28,088 - Gdb - INFO - NOTIFY: thread-created {'group-id': 'i1', 'id': '1'}
[Debug Adapter]
2023-02-01 08:28:28,088 - Gdb - INFO - CONS: ('0x4037db7f in systimer_hal_get_counter_value (hal=0x3fc94198 <systimer_hal>, '
 'counter_id=0) at '
 'C:/Espressif/esp/esp-idf/components/hal/systimer_hal.c:38\\n')
2023-02-01 08:28:28,088 - Gdb - INFO - CONS: '38\\t    while (!systimer_ll_is_counter_value_valid(hal->dev, counter_id));\\n'
2023-02-01 08:28:28,089 - Gdb - INFO - NOTIFY: stopped {'frame': {'addr': '0x4037db7f',
           'arch': 'xtensa',
           'args': [{'name': 'hal', 'value': '0x3fc94198 <systimer_hal>'},
                    {'name': 'counter_id', 'value': '0'}],
           'file': 'C:/Espressif/esp/esp-idf/components/hal/systimer_hal.c',
           'fullname': 'C:\\Espressif\\esp\\esp-idf\\components\\hal\\systimer_hal.c',
           'func': 'systimer_hal_get_counter_value',
           'line': '38'},
 'stopped-threads': 'all',
 'thread-id': '1'}
[Debug Adapter]
2023-02-01 08:28:28,089 - Debug Adapter (main) - WARNING - The operation took too long! - Measured 8.455070 s ( from ~ 08:28:19,634181)
[OpenOCD]
Info : dropped 'gdb' connection
[OpenOCD]
Info : accepting 'gdb' connection on tcp/3333
[OpenOCD]
Info : New GDB Connection: 1, Target esp32s3.cpu0, st[OpenOCD]
ate: halted
[Debug Adapter]
2023-02-01 08:28:38,093 - Gdb - INFO - NOTIFY: thread-exited {'group-id': 'i1', 'id': '1'}
[Debug Adapter]
2023-02-01 08:28:38,093 - Gdb - INFO - NOTIFY: thread-group-exited {'id': 'i1'}
2023-02-01 08:28:38,093 - Gdb - INFO - NOTIFY: thread-group-started {'id': 'i1', 'pid': '42000'}
2023-02-01 08:28:38,093 - Gdb - INFO - NOTIFY: thread-created {'group-id': 'i1', 'id': '1'}
2023-02-01 08:28:38,093 - Gdb - INFO - NOTIFY: thread-created {'group-id': 'i1', 'id': '2'}
2023-02-01 08:28:38,093 - Gdb - INFO - NOTIFY: thread-created {'group-id': 'i1', 'id': '3'}
2023-02-01 08:28:38,093 - Gdb - INFO - NOTIFY: thread-created {'group-id': 'i1', 'id': '4'}
[Debug Adapter]
2023-02-01 08:28:38,093 - Gdb - INFO - NOTIFY: thread-created {'group-id': 'i1', 'id': '5'}
2023-02-01 08:28:38,093 - Gdb - INFO - NOTIFY: thread-created {'group-id': 'i1', 'id': '6'}
2023-02-01 08:28:38,094 - Gdb - INFO - CONS: '[Switching to Thread 1070549848]\\n'
[Debug Adapter]
2023-02-01 08:28:38,094 - Gdb - INFO - CONS: ('0x4037db7f in systimer_hal_get_counter_value (hal=0x3fc94198 <systimer_hal>, '
 'counter_id=0) at '
 'C:/Espressif/esp/esp-idf/components/hal/systimer_hal.c:38\\n')
2023-02-01 08:28:38,094 - Gdb - INFO - CONS: '38\\t    while (!systimer_ll_is_counter_value_valid(hal->dev, counter_id));\\n'
2023-02-01 08:28:38,094 - Gdb - INFO - NOTIFY: stopped {'frame': {'addr': '0x4037db7f',
           'arch': 'xtensa',
           'args': [{'name': 'hal', 'value': '0x3fc94198 <systimer_hal>'},
                    {'name': 'counter_id', 'value': '0'}],
           'file': 'C:/Espressif/esp/esp-idf/components/hal/systimer_hal.c',
           'fullname': 'C:\\Espressif\\esp\\esp-idf\\components\\hal\\systimer_hal.c',
           'func': 'systimer_hal_get_counter_value',
           'line': '38'},
 'stopped-threads': 'all',
 'thread-id': '1'}
[Debug Adapter]
2023-02-01 08:28:38,594 - Gdb - INFO - CONS: '[Switching to thread 1 (Thread 1070549848)]\\n'
[Debug Adapter]
2023-02-01 08:28:38,594 - Gdb - INFO - CONS: ('#0  0x4037db7f in systimer_hal_get_counter_value (hal=0x3fc94198 '
 '<systimer_hal>, counter_id=0) at '
 'C:/Espressif/esp/esp-idf/components/hal/systimer_hal.c:38\\n')
2023-02-01 08:28:38,594 - Gdb - INFO - CONS: '38\\t    while (!systimer_ll_is_counter_value_valid(hal->dev, counter_id));\\n'
2023-02-01 08:28:38,594 - Gdb - INFO - NOTIFY: thread-selected {'frame': {'addr': '0x4037db7f',
           'arch': 'xtensa',
           'args': [{'name': 'hal', 'value': '0x3fc94198 <systimer_hal>'},
                    {'name': 'counter_id', 'value': '0'}],
           'file': 'C:/Espressif/esp/esp-idf/components/hal/systimer_hal.c',
           'fullname': 'C:\\Espressif\\esp\\esp-idf\\components\\hal\\systimer_hal.c',
           'func': 'systimer_hal_get_counter_value',
           'level': '0',
           'line': '38'},
 'id': '1'}
[OpenOCD]
Info : dropped 'gdb' connection
[Debug Adapter]
Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
Exception in thread Thread-2:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "threading.py", line 870, in run
  File "subprocess.py", line 1366, in _readerthread
  File "subprocess.py", line 1366, in _readerthread
OSError: [Errno 22] Invalid argument
OSError: [Errno 22] Invalid argument
[Debug Adapter]
hola juan
hola juan
hola juan
DEBUG_ADAPTER_STOPPED
2023-02-01 08:28:45,409 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STOPPED
[Stopped] : ESP-IDF Debug Adapter
Your troubleshooting page also requests "Heap Trace, OpenOCD and SDK Configuration Editor.", but it doesn't say how and it's not immediately clear to me where I would get these from?
Attachments
esp_idf_vsc_ext.log
(268.52 KiB) Downloaded 238 times

skanky
Posts: 20
Joined: Mon Nov 21, 2022 12:58 pm

Re: ESP-Prog JTAG debugging with ESP32S3

Postby skanky » Thu Feb 02, 2023 6:50 am

Hi support, can you please respond to this? I am in the United Kingdom and need this issue with your debugger tool resolved urgently please

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: ESP-Prog JTAG debugging with ESP32S3

Postby ESP_bignacio » Thu Feb 02, 2023 8:28 am

It seems something went wrong after switching threads in your application. In your .vscode/launch.json could you change your logLevel to 4 to increase the output from debug adapter. This should give us a bit more detail about the error.

You could also play with the tmoScaleFactor to increase the waiting time from the debug adapter, maybe it helps.

skanky
Posts: 20
Joined: Mon Nov 21, 2022 12:58 pm

Re: ESP-Prog JTAG debugging with ESP32S3

Postby skanky » Thu Feb 02, 2023 8:48 am

I have set "logLevel": 4, and "tmoScaleFactor": 4,
Clean > Build
Flash
F5 to Debug
Issue is the same except that it seems to take longer to occur, "Exception has occurred", this time in system_hal.c > systimer_hal_get_counter_value() > while (!systimer_ll_is_counter_value_valid(hal->dev, counter_id));

I am located in the United Kingdom, so in a different time zone to you. I need this issue with your build tool resolved urgently please as it is stopping us from delivering a new product development using the ESP32S3.

Log file attached



DEBUG CONSOLE:

Code: Select all

Got json: {
    "arguments": {
        "frameId": 1000
    },
    "command": "scopes",
    "seq": 9,
    "type": "request"
}
Processed command: scopes
Got json: {
    "arguments": {
        "format": {},
        "variablesReference": 12
    },
    "command": "variables",
    "seq": 10,
    "type": "request"
}
Processed command: variables
Processed command: variables
Attachments
OUTPUT window.txt
(208.37 KiB) Downloaded 443 times
esp_idf_vsc_ext.log
(294.45 KiB) Downloaded 492 times

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: ESP-Prog JTAG debugging with ESP32S3

Postby ESP_bignacio » Fri Feb 03, 2023 8:29 am

I see the issue now.

You have defined

Code: Select all

"initGdbCommands": [
            "target remote :3333",
            "symbol-file /build/VimmsLite_main.elf",
            "mon reset halt",
            "flushregs",
            "thb app_main",
            "c"
        ]
and as specified in the debugging documentation but initGdbCommands doesn't need to be defined by default. The error in the log is because /build/VimmsLite_main.elf cannot be found by gdb

skanky
Posts: 20
Joined: Mon Nov 21, 2022 12:58 pm

Re: ESP-Prog JTAG debugging with ESP32S3

Postby skanky » Fri Feb 03, 2023 9:04 am

Hi thank you, I have tried deleting the initGdbCommands block and it now works so that is great thank you :-)

So I can understand and avoid a similar issue in the future, please can you tell me:

1) Is it better that the "initGdbCommands" block is used? I am confused why it is on your "debugging documentation" page if it is not needed? Can you tell me why it is included in the example there / in what circumstances it is better to use it, so I can fully understand?

2) The file "\VimmsLite_main\build\VimmsLite_main.elf" does exist and is renewed when my project is built. Is there an error in how I have specified my "symbol-file /path/to/program.elf", ?

Thank you very much

Who is online

Users browsing this forum: No registered users and 261 guests