Based on "ESP32 - Getting Started with ESP-IDF using Visual Studio Code [Easiest Method]" and "ESP32 - How to create your First ESP IDF project (From Scratch)".
https://code.visualstudio.com/
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html
File > Save Workspace As... > start-esp-idf.code-workspace
Add ESP-IDF Terminal parameters for Windows:
{
"folders": [
{
"path": "."
}
],
"settings": {
"terminal.integrated.tabs.title": "ESP-IDF Terminal",
"terminal.integrated.env.windows": {
"IDF_TOOLS_PATH": "C:\\Espressif",
"PATH": "C:\\Espressif\\python_env\\idf4.4_py3.8_env\\Scripts;${env:PATH}"
},
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k",
"C:\\Espressif\\frameworks\\esp-idf-v4.4\\export.bat"
],
}
}
"QUICK FIX for IDF Terminal inside VS CODE"
idf.py create-project blank_poject
It is important to add start
keyword before idf.py menuconfig
to open it in a new window. Otherwise, it will open in the VSCode terminal and up/down arrow keys will not work.
start idf.py menuconfig
Component Config > ESP32-specific > CPU frequency > 240MHz
According to LOLIN32 board, the flash size is 4MBytes.
Serial flasher config > Flash size > 4MB
After saving the menuconfig
settings, two files will be created: sdkconfig
and sdkconfig.old
.
Also a build
folder will be created for project build outputs. Put the build
folder in the .gitignore
file.
Note: According to the contents of $ENV{IDF_PATH}/tools/cmake/project.cmake
the name of the directory containing source files
should be main
.
idf.py build
idf.py flash -p COM1
idf.py monitor -p COM1
idf.py fullclean
idf.py flash -p COM1 -b 921600 monitor
Based on "ESP32 - DEBUGGING your ESP-IDF code using JTAG [VS CODE]"
Start OpenOCD GDB server on port 3333.
openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "set ESP32_FLASH_VOLTAGE 3.3" -c "set ESP_RTOS none" -c "adapter speed 1000"
WeMos LOLIN32 V1.0