Help on ESP32-S3 builtin JTAG debug on VSCODE (Windows 10)

ifoxbr
Posts: 8
Joined: Mon Jun 20, 2022 1:48 pm

Help on ESP32-S3 builtin JTAG debug on VSCODE (Windows 10)

Postby ifoxbr » Wed Aug 24, 2022 8:43 pm

Please, I need help to make debug work on ESP32S3.
Trying with "Hello World" sample
First I tried debug using Esp-IDF version 4.4.2... many Jtag errors. It was impossible to flash code. Read and tried almost every suggestion I found on Google.
Then decided to try new version, I´ve installed version release branch 5.0, improved a lot, now I can flash code using Builtin JTAG.
The problem is that when the I start Debugging (play button/F5) , the debugger doesn't stop at the app_main() statement, but debug controls are on top page (see image).

When start debugging (Play button / F5) I receive message on DEBUG_CONSOLE as you can see in "terminal_debug_console.txt" file attached.

If I press "pause", I receive message on DEBUG_CONSOLE as you can see in "terminal_debug_console_press_pause.txt" file attached.

If I press "step over", I receive message this message

1: (259542) <-1025-exec-next
1: (259544) ->1025^error,msg="Cannot find bounds of current function"
1: (259544) ->(gdb)
1: (259544) 1025: elapsed time 2
1: (259544) ->&"\n"
1: (259544) ->^done
1: (259544) ->(gdb)
1: (259548) Send Event AD7MessageEvent
ERROR: Unexpected GDB output from command "-exec-next". Cannot find bounds of current function


terminal_debug_console_press_stepover.txt" file attached.

This is my LAUNCH.JSON
{
"configurations": [
{
// "preLaunchTask": "PreRun",
"name": "ESP32 Debug",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}/build",
"program": "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
"miDebuggerPath": "C:\\Espressif\\tools\\xtensa-esp32s3-elf\\esp-2022r1-RC1-11.2.0\\xtensa-esp32s3-elf\\bin\\xtensa-esp32s3-elf-gdb.exe",
"setupCommands": [
{"text": "target remote 127.0.0.1:3333" },
{"text": "set remote hardware-watchpoint-limit 2"},
{"text": "monitor reset halt"},
{"text": "flushregs"}
// este código abaixo automatiza a gravação de todos os arquivos na flash
//{"text": "mon program_esp build/bootloader/bootloader.bin 0x1000 verify"},
//{"text": "mon program_esp build/partition_table/partition-table.bin 0x8000 verify"},
//{"text": "mon program_esp build/iSmartX3_IDF.bin.bin 0x10000 verify"},
//{"text": "monitor reset halt"},
//{"text": "flushregs"},
],
"logging": {
"engineLogging": true,
}
}
]
}


This is my "SETTINGS.JSON"

{
"C_Cpp.intelliSenseEngine": "Tag Parser",
"idf.adapterTargetName": "esp32s3",
"idf.customExtraPaths": "C:\\Espressif\\tools\\xtensa-esp-elf-gdb\\11.2_20220808\\xtensa-esp-elf-gdb\\bin;C:\\Espressif\\tools\\riscv32-esp-elf-gdb\\11.2_20220808\\riscv32-esp-elf-gdb\\bin;C:\\Espressif\\tools\\xtensa-esp32-elf\\esp-2022r1-RC1-11.2.0\\xtensa-esp32-elf\\bin;C:\\Espressif\\tools\\xtensa-esp32s2-elf\\esp-2022r1-RC1-11.2.0\\xtensa-esp32s2-elf\\bin;C:\\Espressif\\tools\\xtensa-esp32s3-elf\\esp-2022r1-RC1-11.2.0\\xtensa-esp32s3-elf\\bin;C:\\Espressif\\tools\\riscv32-esp-elf\\esp-2022r1-RC1-11.2.0\\riscv32-esp-elf\\bin;C:\\Espressif\\tools\\esp32ulp-elf\\2.28.51-esp-20191205\\esp32ulp-elf-binutils\\bin;C:\\Espressif\\tools\\esp32s2ulp-elf\\2.28.51-esp-20191205\\esp32s2ulp-elf-binutils\\bin;C:\\Espressif\\tools\\cmake\\3.23.1\\bin;C:\\Espressif\\tools\\openocd-esp32\\v0.11.0-esp32-20220706\\openocd-esp32\\bin;C:\\Espressif\\tools\\ninja\\1.10.2;C:\\Espressif\\tools\\idf-exe\\1.0.3;C:\\Espressif\\tools\\ccache\\4.3\\ccache-4.3-windows-64;C:\\Espressif\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64",
"idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"C:\\\\Espressif\\\\tools\\\\openocd-esp32\\\\v0.11.0-esp32-20220706/openocd-esp32/share/openocd/scripts\",\"IDF_CCACHE_ENABLE\":\"1\"}",
"idf.espIdfPathWin": "C:\\Users\\pc-linux\\esp\\esp-idf",
"idf.openOcdConfigs": [
"board/esp32s3-builtin.cfg"
],
"idf.portWin": "COM12",
"idf.pythonBinPathWin": "C:\\Espressif\\python_env\\idf5.0_py3.8_env\\Scripts\\python.exe",
"idf.toolsPathWin": "C:\\Espressif",
"idf.flashType": "JTAG"
}


if someone has already managed to connect with ESP-PROG, it would help me a lot as well, as you managed to do this, I tried several ways, but without success.

I really appreciate if anyone can help me, I have this problem for two weeks

Thank You
Attachments
terminal_debug_console_press_pause.txt
(2.1 KiB) Downloaded 318 times
terminal_debug_console.txt
(11.15 KiB) Downloaded 326 times
erro2.png
erro2.png (24.68 KiB) Viewed 5503 times

ifoxbr
Posts: 8
Joined: Mon Jun 20, 2022 1:48 pm

Re: Help on ESP32-S3 builtin JTAG debug on VSCODE (Windows 10)

Postby ifoxbr » Fri Aug 26, 2022 5:03 pm

Solved !!!

Most of my problems were the wrong documentation

username
Posts: 539
Joined: Thu May 03, 2018 1:18 pm

Re: Help on ESP32-S3 builtin JTAG debug on VSCODE (Windows 10)

Postby username » Sat Aug 27, 2022 3:40 am

Glad you solved it. But what was the corect doc's that fixed it.

silibit
Posts: 1
Joined: Wed Oct 12, 2022 10:11 am

Re: Help on ESP32-S3 builtin JTAG debug on VSCODE (Windows 10)

Postby silibit » Wed Oct 12, 2022 10:14 am

Hi! Can you tell us how have you correct all? I'm still trying to find a solution to debug ESP32-S3-DevKitC-1 using the onboard USB-JTAG without any success!

Thanks!

Dario

ifoxbr
Posts: 8
Joined: Mon Jun 20, 2022 1:48 pm

Re: Help on ESP32-S3 builtin JTAG debug on VSCODE (Windows 10)

Postby ifoxbr » Thu Oct 27, 2022 5:23 pm

Please, install ESP-IDF Versin 5.0 from VS Config IDF extension
And change your "settings.json" to this
  1. {
  2.     "C_Cpp.intelliSenseEngine": "Tag Parser",
  3.     "idf.adapterTargetName": "esp32s3",
  4.     "idf.customExtraPaths": "C:\\Espressif\\tools\\xtensa-esp-elf-gdb\\11.2_20220823\\xtensa-esp-elf-gdb\\bin;C:\\Espressif\\tools\\riscv32-esp-elf-gdb\\11.2_20220823\\riscv32-esp-elf-gdb\\bin;C:\\Espressif\\tools\\xtensa-esp32-elf\\esp-2022r1-11.2.0\\xtensa-esp32-elf\\bin;C:\\Espressif\\tools\\xtensa-esp32s2-elf\\esp-2022r1-11.2.0\\xtensa-esp32s2-elf\\bin;C:\\Espressif\\tools\\xtensa-esp32s3-elf\\esp-2022r1-11.2.0\\xtensa-esp32s3-elf\\bin;C:\\Espressif\\tools\\riscv32-esp-elf\\esp-2022r1-11.2.0\\riscv32-esp-elf\\bin;C:\\Espressif\\tools\\esp32ulp-elf\\2.28.51-esp-20191205\\esp32ulp-elf-binutils\\bin;C:\\Espressif\\tools\\esp32s2ulp-elf\\2.28.51-esp-20191205\\esp32s2ulp-elf-binutils\\bin;C:\\Espressif\\tools\\cmake\\3.23.1\\bin;C:\\Espressif\\tools\\openocd-esp32\\v0.11.0-esp32-20220706\\openocd-esp32\\bin;C:\\Espressif\\tools\\ninja\\1.10.2;C:\\Espressif\\tools\\idf-exe\\1.0.3;C:\\Espressif\\tools\\ccache\\4.6.2\\ccache-4.6.2-windows-x86_64;C:\\Espressif\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64",
  5.     "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"C:\\\\Espressif\\\\tools\\\\openocd-esp32\\\\v0.11.0-esp32-20220706/openocd-esp32/share/openocd/scripts\",\"IDF_CCACHE_ENABLE\":\"1\"}",
  6.     "idf.espIdfPathWin": "C:\\Users\\pc-linux\\esp\\esp-idf",
  7.     "idf.openOcdConfigs": [
  8.         "interface/ftdi/esp32_devkitj_v1.cfg",
  9.         "target/esp32s3.cfg"
  10.     ],
  11.     "idf.portWin": "COM23",
  12.     "idf.pythonBinPathWin": "C:\\Espressif\\python_env\\idf5.0_py3.8_env\\Scripts\\python.exe",
  13.     "idf.toolsPathWin": "C:\\Espressif",
  14.     "idf.flashType": "UART"
  15. }

Who is online

Users browsing this forum: No registered users and 107 guests