Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
Page Index Toggle Pages: 1
Send Topic Print
EDP-IDF Compiling + OpenOCD GDB JTAG Debugging? (Read 54 times)
goj immypi
Junior Member

Posts: 14
EDP-IDF Compiling + OpenOCD GDB JTAG Debugging?
Sep 27th, 2021 at 2:49am
I noticed in another post that:

> We have something that we think will open things up nicely for IDF and others.

> Hopefully we have time to complete the implementation during the coming couple of months

However, I've not been able to find any details on the current status.

I'm currently trying to use Visual Micro to use a Segger J-Link to single-step JTAG debug an Espressif ESP32 ESP-IDF project as mentioned on twitter.

I've struggled quite a bit. Not only needing to manually edit my json file to look like this:

  // GDB Project:  "$(ProjectName)"
  // Microsoft MI: https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md#customlaunchsetupcommands
  // Visualizations: https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2019
  // User Guide: https://www.visualmicro.com/page/User-Guide.aspx?doc=Arduino-gdb-Tutorial.html
  // Tips: To access resolved Arduino 3rd party hardware spec. properties, use $(variables) with the same name as the mi json prpperties
  //       To access Visual Studio macros and environment variables or hard code
  // This file is for advanced use. Please use the pre-configured built-in hardware debuggers where possible.

  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  //"environment": [],
  //"customLaunchSetupCommands": [],
  "MIDebuggerServerAddress": "localhost:3333",
  "cwd": "C:\\workspace\\wolfssl-esp32\\wolfssl_ssh_server\\build",

  "MIDebuggerPath": "C:\\Users\\gojimmypi\\.espressif\\tools\\xtensa-esp32-elf\\esp-2021r1-8.4.0\\xtensa-esp32-elf\\bin\\xtensa-esp32-elf-gdb.exe",
  "MIDebuggerArgs": "build/wolfssl_ssh_server.elf -x gdbinit",

  "debugServerPath": "C:\\Users\\gojimmypi\\.espressif\\tools\\openocd-esp32\\v0.10.0-esp32-20210401\\openocd-esp32\\bin\\openocd.exe",
  "debugServerArgs": "-f interface/jlink.cfg -c adapter_khz 1000 -f target/esp32.cfg",
  //  "setupCommands": [],
  "program": "C:\\workspace\\wolfssl-esp32\\wolfssl_ssh_server\\build\\wolfssl_ssh_server.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false


... but I've also had to edit the project properties "Extra c flags" as well as "extra cpp flags" to include other system libraries that Visual Micro does not find, but should be searched for in the

btw - it was really quite annoying to find the the include file settings in the normal project properties location kept getting overwritten (with Arduino paths nonetheless) at build time.  Wink Thanks to this post for an alternative solution.

Even after getting the application to at least compile, I still ended up with a ton of linker errors like this:

ld.exe: main\server.c.o:(.literal.PwMapNew+0x0): undefined reference to wc_InitSha256
ld.exe: main\server.c.o:(.literal.PwMapNew+0x4): undefined reference to wc_Sha256Update
ld.exe: main\server.c.o:(.literal.PwMapNew+0x8): undefined reference to wc_Sha256Final

And this is all before even trying to get the OpenOCD/GDB JTAG debugger going.

I should note that the code as-is otherwise compiles just fine from a WSL prompt using
in the IDF environment. I have the the project on github.

Any tips on using the ESP-IDF from within Visual Studio instead of the Arduino libraries?

I'm using Visual Studio 2019 Enterprise 16.10.3 and Visual Micro 2021.917.0. I believe all my project settings can be found in the __vm directory

Back to top
IP Logged
Page Index Toggle Pages: 1
Send Topic Print