For getting started with C/C++ development and also debug step line-by-line through the source code a few easy steps are needed
- Buy an EasyDevKit
- Install a IDE
- Plug in the EasyDevKit
- Install the USB driver
- Open a C/C++ project in the IDE and configure it for EasyDevKit use
- Build, flash and start the application on the EasyDevKit
- Set a break point in the IDE, attach the debugger and step through the program line by line
Buy an EasyDevKit
Go the shop and buy an EasyDevkit
Install a IDE
As an example you can install the free IDE Microsoft Visual Studio Code. For getting the IDE working with an ESP32 EasyDevKit you can install the Espressif IDF plugin for Visual Studio Code.
Plug in the EasyDevKit
Plug in the EasyDevKit into one USB port. No breadboard, no other wires needed. Only the EasyDevKit and a micro USB cable.
For Windows you need to install the correct USB driver. Skip this step for Linux.
- Download and start the Zadig tool
- Click Options => List all devices
- For a FTDI FT2232H based EasyDevKit select EasyDevKit (Interface 0) and install the WinUSB driver
- For a WCH CH347T based EasyDevKit select EasyDevKit (Interface 2) and install the WinUSB driver
Open your C/C++ project, select the serial port for flashing via UART
For getting started really quick you can open the “Hello World” sample application from the esp samples directory. Selecting the right serial port is done in the status bar in Visual Studio code.
Build, flash and start the application on the EasyDevKit
There is the little flame icon in the status bar of Visual Studio code. You can build, flash, start and monitor the UART output via one click.
Start JTAG debugging
Copy the launch.json into your .vscode directory. Add the OpenOCD interface and board configurations to your settings.json which located in the .vscode directory.
For FTDI FT2232H based EasyDevKits
"idf.openOcdConfigs": [
"interface/ftdi/easydevkits-ftdi.cfg",
"board/esp32-wrover.cfg"
]
For WCH CH347T based EasyDevKits
"idf.openOcdConfigs": [
"interface/easydevkits-wch.cfg",
"board/esp32-wrover.cfg"
]
Start OpenOCD Server with a click to “OpenOCD Server” at the status bar. Then set a breakpoint and launch you application for JTAG debugging via F5. Wait until a breakpoint is hit.
Happy debugging!
If you like you can watch the getting started video. It describes all steps in more detail.
The two files mentioned in the video are here: