Visual Studio Code Esp32



Visual-studio-code esp32. Follow asked Jan 26 at 14:17. Tom Lindley Tom Lindley. 191 1 1 gold badge 1 1 silver badge 11 11 bronze badges. Add a comment 1 Answer Active Oldest Votes. Assuming you've installed ESP. A tutorial about how to get started with development on the ESP32 in Visual Studio Code using the ESP-IDF. Below are some links that this tutorial is based u. The ESP32 series employs a Tensilica Xtensa LX6 microprocessor in both dual-core and single-core variations and includes in-built antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules. Well, it looks like the time has finally come because last week at work we decided to look into the ESP32 for its Bluetooth capabilities in order to get some kind of wireless data acquisition for remote debugging going. So I ordered a couple of ESP32-PICO-D4 boards to play around. My first goal was to get Bluetooth Classic Pairing working.

Adam-U/ESP32_VSCode_Debug


A guide/example project for JTAG debugging on the ESP32 with VS Code using openocd.

  • Users starred: 6
  • Users forked: 2
  • Users watching: 6
  • Updated at: 2020-03-29 07:35:33

Notes

This guide assumes you have setup the esp-idf environment in Windows and can currently run make flash monitor and other commands succesfully. Start with the ESP setup guide if not.

There are other existing setup guides but this serves as an example project where you can step-by-step debug inside VSCode with one-click and with minimal setup.

The example project is the default blink example, the only things added is the SDKCONFIG (where you will need to change the COM port to flash) and the .vscode folder which contains the necessary files to allow for intellisense and debugging. The files assume you have the esp-idf and openocd folder in 'C:esp' and msys in 'C:msys32'. If not simply change in the json files to where you have them.

Setup

  1. Download openocd and extract in the 'C:esp' folder alongside the esp-idf.
  1. Install the native-debug extension and also the official C/C++ extension for VS Code.
  1. Setup of drivers if necessary. See WROVER setup below if needed.

  2. Open the blink folder in VS Code and change the COM port in sdkconfig to your ESP32.

  3. Run make flash or make flash monitor (You can use Ctrl+J to bring up the integrated terminal)

  1. Launch Program in the debug menu when complete. An error like popup may appear click debug anyway.

Files

c_cpp_properties.json - Necessary for intellisense

launch.json - Allows you to click to start debugging, starts openocd before running

tasks.json - Runs openocd, change the appimage_offset to where the binary is flashed on the ESP if you have changed partition_layout.csv. 0x10000 is the default. This will allow you to set breakpoints succesfully.

Also enter the correct .cfg, this file assumes you are using the WROVER-KIT.

settings.json - Integrated terminal which will open MSYS in the current working directory so you can run 'make flash' and other commands inside VS Code.

Windows WROVER-KIT setup

You can skip this step if not using the WROVER-KIT from Espressif.

Full guide where this is extracted from here.If using the WROVER-KIT make sure to connect the jumpers on the JTAG pins and install the correct drivers.

  • Using standard USB A / micro USB B cable connect ESP32 WROVER KIT to the computer. Switch the WROVER KIT on.

  • Wait until USB ports of WROVER KIT are recognized by Windows and drives are installed. If they do not install automatically, then then download them from http://www.ftdichip.com/Drivers/D2XX.htm and install manually.

  • Download Zadig tool (Zadig_X.X.exe) from http://zadig.akeo.ie/ and run it.

  • In Zadig tool go to “Options” and check “List All Devices”.

  • Check the list of devices that should contain two WROVER specific USB entries: “Dual RS232-HS (Interface 0)” and “Dual RS232-HS (Interface 1)”. The driver name would be “FTDIBUS (vxxxx)” and USB ID: 0403 6010.Configuration of JTAG USB driver in Zadig tool

Visual Studio Code Esp32

  • The first device (Dual RS232-HS (Interface 0)) is connected to the JTAG port of the ESP32. Original “FTDIBUS (vxxxx)” driver of this device should be replaced with “WinUSB (v6xxxxx)”. To do so, select “Dual RS232-HS (Interface 0) and reinstall attached driver to the “WinUSB (v6xxxxx)”, see picture above.
Visual

Visual Studio Code Arduino Esp32

Limitations

  • The popup that appears is due to the way VS Code runs tasks. This can be ignored it doesn't affect the process. Just click debug anyway.

  • Step over does not work correctly due to the way the ESP works with debugging. So when stepping over you do not bypass function calls you will always step into the function. You can workaround by just setting breakpoints to where you want to go and using continue.

Programming Esp32 With Visual Studio

Useful Links + Further Reading