Debugging ESP32

Sysprogs forums Forums VisualGDB Debugging ESP32

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20153
    hf
    Participant

    We want to use the ESP32 in a project and started debugging using a Segger JLink. But we have many issues and getting it stable.

    Very often flashing is not working. Try it serveral times and sometimes with luck you get the connection.

    Next big issue. We see no values of the vars.

     

    We really like the IDE and want to use the ESP32 in a project, but at the moment no productive work can be done under these circumstances. Without debugging var values is almost impossible to write productive code.

     

    Best regards Holger.

    We need some help, and any infos to get a better debugging would be nice.

     

    Attachments:
    You must be logged in to view attached files.
    #20160
    support
    Keymaster

    Hi,

    The ESP32 flashing is unfortunately indeed unreliable. It is provided by the Espressif’s ESP32 OpenOCD port, so we would advise double-checking with Espressif whether they have a hotfix for this.

    We have rebuilt the OpenOCD executable using the latest patches from them here: http://sysprogs.com/files/tmp/openocd.exe;  feel free to try replacing the OpenOCD binary in the toolchain directory with it (we have not fully tested it yet).

    The issue with the variables is caused by the optimization. Using any other optimization level than -O0 makes GCC optimize out some variables, however using -O0 to build ESP-IDF code results in crashes during startup. As a workaround please try setting the optimization level to -O0 for specific files you want to debug (via the regular MSBuild File Properties). This should keep the ESP-IDF framework in a usable state, while providing full debug functionality for your code.

    If you encounter any further problems, feel free to contact us again and we will help you resolve them.

    #20181
    hf
    Participant

    Hello,

     

    thanks for the answer. This helped me a lot.

    It seems, that the variables have no values, if the taskFunction is on the top level. If you call call a function (of a class) then the variables are shown correct.

    This is a little issue, but is will not stop us to work on the project.

     

    Thx

    #20190
    support
    Keymaster

    Hi,

    Unfortunately this is also a known limitation of the ESP32 debugging that comes from the Xtensa toolchain (the ESP32 devices are not based on the ARM core; this helps reducing the price, however makes impossible to use the mature ecosystem of the ARM tools). Please feel free to look through the post covering other limitations of the ESP32 toolchain and known workarounds: https://sysprogs.com/w/limitations-of-the-esp32-debugging/

    The recommended workaround is to always have a top-level wrapper function in every thread.

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