ESP32 How to : JTAG, OpenOCD

ESPRESSIF|2021. 1. 3. 18:52

1. Basic connection

   Main IC : ESP32

   IDF : IDF3.3, Ubuntu 

 

 

2. Hardware connection

 

 

 

3. Check USB Device. it must be "plugdev". otherwise, you need to copy "rule" file. 

 

4. Check FTDI driver

 

5. intall OpenOCD

https://github.com/espressif/openocd-esp32/releases

 

6. Run Openocd 

 

openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg

 

 

7. Test JTAG flash

 

openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "program_esp32 hello-world.bin 0x10000 verify exit" 

 

 

 

*** If errors happen.

 

1. check dependency problem. 

sudo apt-get install make

sudo apt-get install libtool

sudo apt-get install pkg-config

sudo apt-get install autoconf

sudo apt-get install automake

sudo apt-get install texinfo

sudo apt-get install libusb-1.0

 

2. Copy rule file. 

 

Step1) Change authority of /etc/udev

sudo chmod –R 777 udev

 

Step2) Copy OpenOCD from the original(openocd-esp32) to /etc/udev/rules.d

 

Original file location : /openocd-esp32/share/openocd/contrib/60-openocd.rules

Copy locaton : /etc/udev/rules.d/

 

Step3) Reload

sudo udevadm control --reload-rules