Environment
- Windows 10
- Eclipse 2021-06
- ESP-IDF v4.3
- OpenOCD v0.10.0-esp32-20210401
- ESP-PROG
- ESP32-DevKitM-1
Blink example is used for the below.
Flashing over UART
If you flash over UART by strictly following the user guide only then the application will not run and the device will reset every 6 seconds or so.
Since this is a single core device you must enable single core mode. In Eclipse this can be done through sdkconfig -> Component config -> FreeRTOS and ticking "Run FreeRTOS only on first core". Now the application can be successfully flashed over UART.
https://docs.espressif.com/projects/esp ... ware-setup
Flashing and debugging over JTAG
Connect the ESP-PROG JTAG pins to the ESP32-DevKitM-1.
The menuconfig set up for flashing over UART above must be completed first before trying to flash and debug over JTAG.
I found this guide very helpful setting up JTAG debugging and flashing:
https://www.beyondlogic.org/debugging-with-jtag/
However, since this guide is for Ubuntu and a dual core ESP32 some changes need to be made to get it working for Windows and a single core device like the ESP32-DevKitM-1.
First, on windows the the ESP-PROG driver needs to be replaced using Zadig.
https://docs.espressif.com/projects/esp ... -jtag.html
Second, the OpenOCD config options need to be set up for single core operation. ESP32_ONLYCPU.
https://docs.espressif.com/projects/esp ... figure-tar
The guide above says to change the configuration to
Doing so will give you an error when you try to debug:-s ${openocd_path}/share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover-kit-3.3v.cfg
One way to fix this is to create a copy of the "esp32_devkitj_v1.cfg" file located in ${openocd_path}/share/openocd/scripts/ interface/ftdi, rename it, I renamed it to "esp32_devkitj_v1_singlecore.cfg", and add these lines to the end of the file and save:Warn : JTAG tap: esp32.cpu1 UNEXPECTED: 0xffffffff (mfg: 0x7ff (<invalid>), part: 0xffff, ver: 0xf)
Error: JTAG tap: esp32.cpu1 expected 1 of 1: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Code: Select all
# Single core version of ESP32
set ESP32_ONLYCPU 1
Code: Select all
-s ${openocd_path}/share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1_singlecore.cfg -f board/esp32-wrover-kit-3.3v.cfg
This is due to incompatibility of Windows Eclipse and OpenOCD file path syntax, forward slash vs. back slash.** Programming Started **
Error: couldn't open C:eclipse-workspaceesp32-iotlinkuildlink.bin
embedded:startup.tcl:449: Error: ** Programming Failed **
https://github.com/espressif/openocd-esp32/issues/92
Not sure if there are other ways but, the easiest way I found to fix this problem is to use absolute paths. For example:
Code: Select all
mon program_esp C:/eclipse-workspace/esp32-iot/blink/build/blink.bin 0x10000 verify