.1 Installing Visual Studio Code

Installing You don’t have to have installed EDP-IDF first, the VS plugin is very good and can do it all for you. Install Visual Studio Code Install Python Install ESP-IDF Visual Studio Code Extension from: https://marketplace.visualstudio.com/items?itemName=espressif.esp-idf-extension Visual Studio Code > Menu > View > Command Palette (CTRL+SHIFT+P) > type: configure esp-idf extensionChoose the ESP-IDF: Configure ESP-IDF […]

Read More

.2 Making VS Code work the way we like

VS Code Options Our general settings for VS Code – see here ESP32 C programming specific settings Clear terminal when building (so it start fresh each time) Settings > Features > Debug > Terminal: Clear Before Reusing = ONSettings > Features > Debug > Cmake: Clear Output Before Build = ON Open files at the […]

Read More

.3 Creating a new project

Resources https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/basic_use.md NOTE: The esp-idf build system does not support spaces in paths to projects Create an example project in Visual Studio Code Menu > View > Command Palette (CTRL+SHIFT+P) > Type: ESP-IDF: Show Examples Projects (If it doesn’t come up, make sure VS Code isn’t in restricted safe mode)Choose “Use current ESP-IDF (\path\to\esp-idf)”.All of […]

Read More

.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 […]

Read More

.6 Releasing a project

ESP32 release config Check the ESP32 settings as detailed on this page menuconfig particular settings to check: Panic handler behaviour (CONFIG_ESP_SYSTEM_PANIC configuration) What happens when a fatal issue occurs and the CPU has to halt.Component config > ESP System Settings > Panic handler behaviour = Print registers and reboot Releasing files and setup for production […]

Read More

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 […]

Read More

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 […]

Read More

Log messages via JTAG interface

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

Read More