ESP32 C3 semihosting

Sysprogs forums Forums VisualGDB ESP32 C3 semihosting

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31897
    mattia
    Participant

    Hello,

    I’m using VGDB 5.6R2 (build 4506). I’m debugging an ESP32-C3 with idf 5.0 dev through the USB JTAG. I enabled the semihosting, set the app level tracing to JTAG. However, when I call the code:

    char buffer[128];
    sprintf(buffer, “Iteration %d\n”, i);
    esp_apptrace_write(ESP_APPTRACE_DEST_TRAX, buffer, strlen(buffer), ESP_APPTRACE_TMO_INFINITE);
    esp_apptrace_flush(ESP_APPTRACE_DEST_TRAX, ESP_APPTRACE_TMO_INFINITE);

    I see no output in the window VisualGDB Output->ESP32 Semihosting

    Is there anything else I should do to enable semihosting or logging via JTAG?

    Thank you,

    Mattia Berton

    #31900
    support
    Keymaster

    Hi,

    ESP-IDF 5.0 is not a stable release. It might be buggy, incompatible with tools like OpenOCD, or might be missing some functionality. Unless you are fine doing the troubleshooting on your side, please consider using stable releases only (e.g. ESP-IDF v4.3.1).

    #31910
    mattia
    Participant

    Hello,

    I tried to use the ESP-IDF 4.3.1, but I can’t follow your example https://visualgdb.com/tutorials/esp32/apptrace/

    Can you try to reproduce the tutorial on ESP32-C3?

    Thank you,

    Mattia

    #31934
    support
    Keymaster

    Hi,

    We have rechecked the ESP32-C3 apptrace on the latest stable ESP-IDF 4.3.1 and it indeed triggered build errors inside ESP-IDF. The same ESP-IDF version worked with the regular ESP32 chip, so it looks like a bug in ESP-IDF specific to ESP32-C3.

    Either way, the semihosting/apptrace is fully handled by the Espressif’s tools. VisualGDB simply turns it on by issuing the following command to OpenOCD via gdb (the actual path to the temporary file would be different):

    monitor esp apptrace start "file://C:/temp/file.txt" 1

    The Espressif’s port of OpenOCD then begins polling the apptrace memory, decoding its contents and writing it to the temporary file, where VisualGDB picks it up.

    As the support for ESP32-C3 semihosting appears broken in the latest stable ESP-IDF release, our best advice would be to try other versions of ESP-IDF and see if the “monitor esp apptrace start” command works as expected. If not, please consider reporting it to Espressif – if the OpenOCD tool is not able to read the semihosting data correctly, VisualGDB won’t be able to display it.

    If running the “apptrace” command in OpenOCD manually works, but the VisualGDB-level functionality (e.g. the semihosting window doesn’t), please let us know and we will investigate it further.

    On our side, we have updated the OpenOCD package based on the latest sources from Espressif. You can install it via the VisualGDB Package Manager, although we cannot guarantee that it will work better.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.