question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JTAG Debugging problems on ESP32-LyraT v4.3 (and ESP32-PICO-KIT) (VSC-959)

See original GitHub issue

OS

Windows

Operating System version

Windows 10

Visual Studio Code version

1.70.2

ESP-IDF version

4.4.2

Python version

3.10.4

Doctor command output

---------------------------------------------- ESP-IDF Extension for Visual Studio Code report --------------------------------------------- OS win32 x64 10.0.19044 System environment variable IDF_PYTHON_ENV_PATH undefined System environment variable PATH C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin;C:\Users\jkull\AppData\Local\Programs\Python\Python310;C:\Users\jkull\AppData\Local\Programs\Python\Python310\Scripts;C:\Program Files\Git\cmd;C:\Program Files\R\R-4.2.0\bin;C:\Users\jkull\AppData\Local\Android\Sdk\platform-tools;C:\Users\jkull\AppData\Local\Programs\Python\Python310\Scripts;C:\Users\jkull\AppData\Local\Programs\Python\Python310;C:\Users\jkull\AppData\Local\Microsoft\WindowsApps;C:\Users\jkull\AppData\Local\GitHubDesktop\bin;C:\Users\jkull\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\jkull\AppData\Local\Programs\MiKTeX\miktex\bin\x64;C:\Users\jkull\Documents\GitRepo\flutter\bin; System environment variable PYTHON undefined Visual Studio Code version 1.70.2 Visual Studio Code language en Visual Studio Code shell C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ESP-IDF Extension version 1.5.0 Workspace folder c:\RockyMountain\code\esp_example_apps\blink ---------------------------------------------------- Extension configuration settings ------------------------------------------------------ ESP-ADF Path (idf.espAdfPath) c:\RockyMountain\code\esp\esp-adf ESP-IDF Path (idf.espIdfPath) c:\RockyMountain\code\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:\RockyMountain\code.espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\bin;c:\RockyMountain\code.espressif\tools\xtensa-esp32s2-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s2-elf\bin;c:\RockyMountain\code.espressif\tools\xtensa-esp32s3-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s3-elf\bin;c:\RockyMountain\code.espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin;c:\RockyMountain\code.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;c:\RockyMountain\code.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;c:\RockyMountain\code.espressif\tools\cmake\3.23.1\bin;c:\RockyMountain\code.espressif\tools\openocd-esp32\v0.11.0-esp32-20220411\openocd-esp32\bin;c:\RockyMountain\code.espressif\tools\ninja\1.10.2;c:\RockyMountain\code.espressif\tools\idf-exe\1.0.3;c:\RockyMountain\code.espressif\tools\ccache\4.3\ccache-4.3-windows-64;c:\RockyMountain\code.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64 Custom extra vars (idf.customExtraVars) {“OPENOCD_SCRIPTS”:“c:\RockyMountain\code\.espressif\tools\openocd-esp32\v0.11.0-esp32-20220411/openocd-esp32/share/openocd/scripts”,“IDF_CCACHE_ENABLE”:“1”} Virtual env Python Path (idf.pythonBinPath) c:\RockyMountain\code.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe Serial port (idf.port) COM19 OpenOCD Configs (idf.openOcdConfigs) interface/ftdi/esp32_devkitj_v1.cfg,target/esp32.cfg ESP-IDF Tools Path (idf.toolsPath) c:\RockyMountain\code.espressif Git Path (idf.gitPath) c:\Users\jkull\Documents\DeviceSolutions\projects\RockyMountain\code.espressif\tools\idf-git\2.30.1\cmd\git.exe -------------------------------------------------------- Configurations access ------------------------------------------------------------- Access to ESP-ADF Path (idf.espAdfPath) true 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:\RockyMountain\code.espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\bin: true Access to c:\RockyMountain\code.espressif\tools\xtensa-esp32s2-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s2-elf\bin: true Access to c:\RockyMountain\code.espressif\tools\xtensa-esp32s3-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s3-elf\bin: true Access to c:\RockyMountain\code.espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin: true Access to c:\RockyMountain\code.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin: true Access to c:\RockyMountain\code.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin: true Access to c:\RockyMountain\code.espressif\tools\cmake\3.23.1\bin: true Access to c:\RockyMountain\code.espressif\tools\openocd-esp32\v0.11.0-esp32-20220411\openocd-esp32\bin: true Access to c:\RockyMountain\code.espressif\tools\ninja\1.10.2: true Access to c:\RockyMountain\code.espressif\tools\idf-exe\1.0.3: true Access to c:\RockyMountain\code.espressif\tools\ccache\4.3\ccache-4.3-windows-64: true Access to c:\RockyMountain\code.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:\RockyMountain\code.espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\bin: false Spaces in c:\RockyMountain\code.espressif\tools\xtensa-esp32s2-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s2-elf\bin: false Spaces in c:\RockyMountain\code.espressif\tools\xtensa-esp32s3-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s3-elf\bin: false Spaces in c:\RockyMountain\code.espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin: false Spaces in c:\RockyMountain\code.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin: false Spaces in c:\RockyMountain\code.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin: false Spaces in c:\RockyMountain\code.espressif\tools\cmake\3.23.1\bin: false Spaces in c:\RockyMountain\code.espressif\tools\openocd-esp32\v0.11.0-esp32-20220411\openocd-esp32\bin: false Spaces in c:\RockyMountain\code.espressif\tools\ninja\1.10.2: false Spaces in c:\RockyMountain\code.espressif\tools\idf-exe\1.0.3: false Spaces in c:\RockyMountain\code.espressif\tools\ccache\4.3\ccache-4.3-windows-64: false Spaces in c:\RockyMountain\code.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 undefined ESP-IDF version undefined Python version undefined Python’s pip version undefined -------------------------------------------------- Python packages in idf.pythonBinPath ---------------------------------------------------- ---------------------------------------------------- Check ESP-IDF python requirements.txt ------------------------------------------------- Check ESP-IDF Python packages undefined ---------------------------------------------------- Check extension requirements.txt ------------------------------------------------------ Check Extension Python packages undefined ---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------ Check Debug AdapterPython packages undefined ----------------------------------------------------------- Latest error ----------------------------------------------------------------- Latest error at Command failed: “c:\Users\jkull\Documents\DeviceSolutions\projects\RockyMountain\code.espressif\tools\idf-git\2.30.1\cmd\git.exe” --version The system cannot find the path specified.


Extension

esp-idf_doctor_command_output_20220826.txt esp32-lyrat_v4.3_debuglevel_3_flash_start_debug_reset_start_debug_again_log_20220826.txt

Description

I am new to Espressif and so I’m not very familiar with the device and the dev tools. I am sending this issue report because I would really like to get the JTAG debugger working consistently so that I can set breakpoints when testing my code.

I’m having issues when I start the debugging session after I flash the PICO32-LyraT v4.3 audio dev board. I am getting different results, depending on the debug session that I run, for example: 1, FreeRTOS.c:856 freertos_update_threads(): FreeRTOS maximum used priority is unreasonably big, not proceeding: 126 2. FreeRTOS.c:893 freertos_update_threads(): Too large number of threads 1103303849! 3. I would get an exception in one of the threads, but if I hit the Run button, the app will start running. image

I’ve also tried the same steps on the ESP32-PICO-KIT board and I saw similar results.

I was expecting that I would be able to start debugging immediately after flashing the LyraT board and that it would work consistently.

Please advise on how to fix this.

Thank you.

Debug Message

I've attached my debug log file in the Extensions text box. It's too long for the web form.

Other Steps to Reproduce

  1. Enable JTAG by setting the following dip switches: 1-2 OFF, 3-7 ON, 8 OFF

  2. Connect the JTAG header and Vdd3.3 and GND of LyraT to the ESP-PROG JTAG connector

  3. Plug in the ESP-PROG mini USB connector to the PC

  4. Plug in the LyraT Power and UART mini USB connectors to the PC

  5. In VSCode, I am running the Blink example from ESP-IDF examples folder.

    • Set ESP-IDF COM port to the ESP-PROG USB port (I did install the WinUSB (v6.1.7600.16385) driver using Zadig for Dual RS232-HS Interface 0 device)
    • Set the Device Target to “esp32”
    • Set OpenOCD board configuration file to “ESP-32 chip (via ESP-PROG)”, i.e., interface/ftdi/ esp32_devkitj_v1.cfg
    • Edited SDK Configuration to replace Blink GPIO number from 5 to 22, then saved the changes
    • Did a clean build of the Blink project
    • Flashed the LyraT board (I had to press BOOT and RST buttons together, then release RST before BOOT in order for flash to work)
    • Clicked on Run->Start Debugging – at this point I saw the “FreeRTOS maximum used priority is unreasonably big, not proceeding” error message and the debugger stops.
    • I then pressed the RST button on the LyraT board and did Run->Start Debugging again and at this point, the app seems to run. Sometimes, the app doesn’t run even after multiple resets of the board.

Note that sometimes I also get a “FreeRTOS.c:893 freertos_update_threads(): Too large number of threads [large number here]!” but when I tried to capture it for this problem report, it somehow didn’t show up.

I would try to start the debugging multiple times using the JTAG. I see different results depending on the debug session.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
joyk3872commented, Sep 14, 2022

Hi @gerekon,

Prior to seeing your message above, I reinstalled the esp-idf tools manually because our repo structure had changed so I had to update the paths in my project to the new directory structure. It seems that I was able to get the OpenOCD v0.11.0-esp32-20220706 with the Windows installer (I used esp-idf-tools-setup-online-2.16 installer). After building with the new setup, I was able to flash via JTAG without having to press the RST/BOOT buttons and I can now start debugging without seeing any errors in VSCode. Could the old version of ESP OOCD (v0.11.0-esp32-20220411) be the cause of the issues I was seeing?

I’m cautiously optimistic…I’ve flashed and started/stopped debugging multiple times on the Blink and my own project and it seems to be working fine now.

Thanks for all your help.

1reaction
gerekoncommented, Aug 31, 2022

@brianignacio5 Ahh, yes. But it looks like unused in the debug adapter itself. It is used in debug backend package only.

I am not sure if there are any timeouts used in DebugAdapter itself. So this is just a notice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

can't start debug session in VSCode - ESP-IDF
The JTAG debugging issues I was having when using VSCode, ESP-IDF Extension, and ESP-PROG *may* have been caused by the ESP-OpenOCD v0.11.0- ...
Read more >
DEBUGGING your ESP-IDF code using JTAG [VS CODE]
How to DEBUG your ESP32 IDF application inside Visual Studio Code using an external debugger tool. We'll be using the ESP-PROG, a JTAG...
Read more >
JTAG Debugging - ESP32 - — ESP-IDF Programming ...
A better (and in many cases quicker) way to debug such problems is by using a debugger, connected to the processors over a...
Read more >
ESP32-LyraT V4.3 Hardware Reference
The development board supports a MicroSD card in SPI/1-bit/4-bit modes, and can store or play audio files in the MicroSD card. Note that...
Read more >
Debugging the ESP32-LyraT board via JTAG
This tutorial shows how to debug the ESP32-LyraT board using a JTAG debugger with VisualGDB. We will clone the play_mp3_control sample, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found