Dalam tutorial ini, saya ingin berbicara tentang cara menggunakan debugger JTAG ultra-anggaran CJMCU FT232H dan RV-Debugger-Lite di PlatformIO untuk mem-flash dan men-debug perangkat pada platform ESP32 dan GD32. Saya tidak menemukan instruksi lengkap di Internet, dan selama proses penyiapan saya mengalami banyak masalah, jadi tutorial ini muncul di sini untuk kenyamanan Anda. Saya akan segera membuat reservasi bahwa pengaturannya ditulis untuk Linux, tetapi untuk Windows tidak ada perbedaan mendasar kecuali untuk menari dengan Zadig.
CJMCU FT232H + ESR32 Rev1 alias ESP32Dev
Maksud saya debugger ini berdasarkan chip FT232H:
Dan inilah papan ini berdasarkan ESP-WROOM-32:
Pengaturan platformio.ini:
[env:esp32dev]
platform = espressif32
framework = arduino
board = esp32dev
monitor_speed = 115200
upload_speed = 921600
debug_tool = minimodule
upload_protocol = minimodule
Di sini kami memiliki CJMCU FT232H untuk 700 rubel akan berpura-pura menjadi debugger MODUL MINI FT2232H untuk 4500. Untuk melakukan ini, Anda perlu melakukan perubahan berikut pada file (baris yang saya komentari dimulai dengan ##):
/home/<username>/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/interface/ftdi/minimodule.cfg
#
# FTDI MiniModule
#
# http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT2232H_Mini_Module.pdf
#
interface ftdi
##ftdi_device_desc "FT2232H MiniModule"
##ftdi_vid_pid 0x0403 0x6010
ftdi_vid_pid 0x0403 0x6014
# Every pin set as high impedance except TCK, TDI, TDO and TMS
ftdi_layout_init 0x0008 0x000b
# nSRST defined on pin CN2-13 of the MiniModule (pin ADBUS5 [AD5] on the FT2232H chip)
# This choice is arbitrary. Use other GPIO pin if desired.
##ftdi_layout_signal nSRST -data 0x0020 -oe 0x0020
## added
# interface 1 is the uart
ftdi_channel 0
reset_config none
minimodule"ftdi_device_desc",
CJMCU FT232H . VID/PID, :
/etc/udev/rules.d/99-platformio-udev.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6014",
GROUP="plugdev", MODE="0666"
.
:
JTAG |
CJMCU FT232H |
ESP32Dev |
TDO |
AD2 |
GPIO15 |
TDI |
AD1 |
GPIO12 |
TCK |
AD0 |
GPIO13 |
TMS |
AD3 |
GPIO14 |
|
|
+3.3V |
3V3 |
|
|
GND |
GND |
CJMCU FT232H + Sipeed Longan Nano
GD32VF103CBT6:
platformio.ini:
[env:sipeed-longan-nano]
platform = gd32v
framework = gd32vf103-sdk
board = sipeed-longan-nano
monitor_speed = 115200
debug_tool = um232h
upload_protocol = um232h
CJMCU FT232H UM232H 2000 . :
/home/<username>/.platformio/packages/tool-openocd-gd32v/share/openocd/scripts/interface/ftdi/um232h.cfg
#
# FTDI UM232H as a JTAG interface
#
# http://www.ftdichip.com/Products/Modules/DevelopmentModules.htm#UM232H
#
# This should also work with a UM232H-B, but that has not been tested.
# Note that UM232H and UM232H-B are 3.3V only.
#
interface ftdi
#ftdi_device_desc "UM232H"
ftdi_vid_pid 0x0403 0x6014
##ftdi_layout_init 0xfff8 0xfffb
##ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100
##ftdi_layout_signal nSRST -data 0x0200 -oe 0x0200
# interface 1 is the uart
ftdi_channel 0
# just TCK TDI TDO TMS, no reset
ftdi_layout_init 0x0008 0x000b
#ftdi_layout_init 0x0c08 0x0f1b
reset_config none
, ftdi_device_desc, 99-platformio-udev.rules.
libhidapi-hidraw0:
sudo apt-get install -y libhidapi-hidraw0
:
JTAG |
CJMCU FT232H |
Sipeed Longan Nano |
TDO |
AD2 |
JTDO |
TDI |
AD1 |
JTDI |
TCK |
AD0 |
JTCK |
TMS |
AD3 |
JTMS |
|
|
+3.3V |
3V3 |
|
|
GND |
GND |
RV-Debugger-Lite + Sipeed Longan Nano
, RV-Debugger-Lite 200 .
platformio.ini:
[env:sipeed-longan-nano]
platform = gd32v
framework = gd32vf103-sdk
board = sipeed-longan-nano
monitor_speed = 115200
debug_tool = sipeed-rv-debugger
upload_protocol = sipeed-rv-debugger
Sipeed RV-Debugger. , , , 1000 . :
/home/<username>/.platformio/packages/tool-openocd-gd32v/share/openocd/scripts/interface/ftdi/sipeed-rv-debugger.cfg
interface ftdi
##ftdi_device_desc "Dual RS232"
ftdi_vid_pid 0x0403 0x6010
#autoexit true
#interface cmsis-dap
transport select jtag
ftdi_layout_init 0x0008 0x001b
ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020
ftdi_device_desc, : RV-Debugger FT2232D, RV-Debugger-Lite FT2232C, CH552T. VID/PID .
:
JTAG |
RV-Debugger-Lite |
Sipeed Longan Nano |
TDO |
TDO |
JTDO |
TDI |
TDI |
JTDI |
TCK |
TCK |
JTCK |
TMS |
TMS |
JTMS |
|
|
3V3 |
3V3 |
|
|
GND |
GND |
, . , .
PIO (platformio) JTAG FT232H ESP32