ImHoTep

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: ESP32 Arduino: wrong GDB path / KeyNotFound core 3.3.12 #37452
    ImHoTep
    Participant

    Sorry, I could’ not upload the script here.
    Go:
    https://mindmake.de/dl/visualgdb/

     

    in reply to: ESP32 Arduino: wrong GDB path / KeyNotFound core 3.3.12 #37451
    ImHoTep
    Participant

    Hello Sysprogs team,

    Thank you very much for reproducing the problem and for the detailed explanation, that helps a lot.

    Since my VisualGDB 6.1 setup is working reliably for my ESP-IDF projects, I would prefer not to replace it with a development build. I will wait for a stable release of VisualGDB 6.2 (and CodeVROOM) and will be happy to test the new Arduino core support then.

    In the meantime, I found a workaround that works well with VisualGDB 6.1, and I’d like to share it in case it is useful for you or other users. I use the Arduino core as an ESP-IDF component in a regular VisualGDB ESP-IDF project:

    – ESP-IDF 6.1.0, ESP32 (Consolidated) toolchain
    – espressif/arduino-esp32 4.0.0-rc1 from the ESP Component Registry (based on ESP-IDF 6.1)
    – Tested on ESP32 (FTDI JTAG) and ESP32-S3 (built-in USB-JTAG): build, flash, breakpoints, stepping and terminal all work.

    Changes required on a freshly generated project:

    1. main/idf_component.yml: dependency espressif/arduino-esp32: “4.0.0-rc1”
    2. sdkconfig: CONFIG_FREERTOS_HZ=1000
    3. sdkconfig: CONFIG_MBEDTLS_PSK_MODES=y and CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y (required by NetworkClientSecure)
    4. Top-level CMakeLists.txt, before project(): idf_build_set_property(COMPILE_OPTIONS “-Wno-error=missing-field-initializers” APPEND) (ESP_I2S.cpp in the RC1 vs. new fields in i2s_chan_config_t)
    5. Top-level CMakeLists.txt, after project(): -Wno-error=cpp for the Arduino component only (on ESP32-S3, ESP_SR emits a #warning about the partition table):
    idf_component_get_property(arduino_lib espressif__arduino-esp32 COMPONENT_LIB)
    target_compile_options(${arduino_lib} PRIVATE -Wno-error=cpp)
    6. Main source converted to .cpp, app_main declared extern “C” and calling initArduino().
    7. Advanced GDB Settings: “Use file names only when setting breakpoints” (UseRelativePathsOnly) enabled.

    I have automated all of these steps in a small Python script (attached, standard library only). Usage:

    1. Create a new ESP-IDF project with the VisualGDB wizard and let it configure once.
    2. Unload the project in Visual Studio.
    3. Copy idf_arduino_setup.py into the project root (next to sdkconfig and the .vgdbproj file) and run it (double-click or “python idf_arduino_setup.py”).
    4. Reload the project and build. The first build downloads the Arduino core.

    The script creates .bak backups of all modified files and can safely be run multiple times.

    Two observations that might be worth checking in 6.2, since your reply only covered the GDB path:

    – With “Program FLASH using: OpenOCD”, the Arduino project type failed with a KeyNotFoundException in ESP32StartupSequence.BuildFLASHImages (core 3.3.12, ESP32 Dev Module).
    – Point 7 above: without this option, Visual Studio froze or crashed and restarted itself as soon as the target stopped at a breakpoint. The GDB log ended in the middle of the response to -file-list-exec-source-files. With the Arduino core and its dependencies, this source file list becomes very large. This might also affect the Arduino project type in 6.2.

    Thank you again for your support.

    Best regards,
    Thomas

    in reply to: Missing ESP32-S31 in device list #37440
    ImHoTep
    Participant

    So I got it.., I was able to get the ESP32-S31 listed as an available device by downloading the ESP-IDF 6.1 checkout via “Download another IDF/ADF checkout”. Unfortunately, debugging does not work, because VisualGDB cannot find an esp32s31.cfg file for the debug configuration. Is there a solution for this?

    in reply to: Missing ESP32-S31 in device list #37439
    ImHoTep
    Participant

    Sorry there was a typo in my Post, I’m using IDF 6.1

    in reply to: ESP-Prog-2 #36977
    ImHoTep
    Participant

    Thaks.

    It works with the Debug settings “OpenOCD “and  the “esp32-bridge.cfg”

    in reply to: VGDB6.1B4 Problems adding a custom component #36941
    ImHoTep
    Participant

    Thanks for the fast reply and help. That works!

    This was likely the same reason why the try to integrate the Arduino framework as a component failed. I will test this further…

Viewing 6 posts - 1 through 6 (of 6 total)