Passing log messages over the JTAG interface, instead of UART0 Espressif resources https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/app_trace.html#app-trace-logging-to-host Getting it working esp_app_trace.h needs app_trace adding to your AMakeLists.txt Then in your project: A work in progress…so far we’ve been unable to make this feature actually work…!Got to here: https://www.esp32.com/viewtopic.php?f=13&t=33205&p=112706#p112706
Category: Visual Studio Code
Rename project
See here
.5 Debugging tips and info
Sharing IO pins – UART See here. Sharing IO pins – JTAG See here. Log output Get a runtime full log output via the serial port using esp-idf debug.
Moving or renaming a project
Delete your projects “\build” folder. Update project() with a new project name in CMakeLists.txt (in projects root folder)
Issues with Programming & Debugging
Where to look for indications of the problem The Espressif troubleshooting page has a good guide (and is what they’ll probably ask you for if you request help) Useful troubleshooting changes you can do in in launch.json JTAG debugging issues we’ve encountered (using ESP-Prog and VSCode) “connect ECONNREFUSED 127.0.0.1:9998” In launch.json, changing mode to auto […]
Programming with VS Code
ESP-IDF Build, Flash and Monitor To exit from IDF monitor use “Ctrl+]”
Project settings
Rename (or move) project Close the project then rename its folder. Delete the \build\ directory so you delete the compiler cache etc. Open CMakeLists.txt in your project root and update: project(MyProjectName) Configure project SDK Configuration editor Menu > View > Command Palette > Type: “ESP-IDF: SDK Configuration editor” (or use CTRL+E then G)Wait for it […]
Compiler
Config UI Command Pallet (CTRL + SHIFT + P) > Edit Configurations UI This will give you a UI view, instead of editing the c_cpp_properties.json file directly Compiler config files .vscode/c_cpp_properties.json https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference Include Paths .vscode/c_cpp_properties.json > “includePath” /** on the end of a path makes it recursive, meaning that all sub directories will also be […]
.2 Making VS Code work the way we like
VS Code Options File > Preferences > Keyboard shortcuts Transform to Uppercase ctrl + shift + u Transform to Lowercase ctrl + shift + l Use tabs not spaces Settings > Text editor > Insert spaces = OFF Settings > Text editor > Detect Indentation = OFF Turn off auto closing Settings > Text Editor […]
.4 Debugging with VS Code
ESP-Prog programmer / debugger For details on installing see here. Installing debugger VS Code has a built-in debugger, its setup documentation is here. Apparently some people use it successfully for Espressif chips (launch.json “type”: “gdb”). Espressif have a dedicated VS Code extension for debugging which is likely the better choice (launch.json “type”: “espidf”) and that’s […]