In diesem Tutorial möchte ich darüber sprechen, wie die Ultra-Budget-JTAG-Debugger CJMCU FT232H und RV-Debugger-Lite in PlatformIO zum Flashen und Debuggen von Geräten auf ESP32- und GD32-Plattformen verwendet werden. Ich habe im Internet keine vollständige Anleitung gefunden und bin während des Einrichtungsvorgangs auf viele Probleme gestoßen. Daher wird dieses Tutorial hier zur Vereinfachung angezeigt. Ich werde sofort reservieren, dass die Einstellung für Linux geschrieben ist, aber für Windows gibt es keinen grundlegenden Unterschied, außer für das Tanzen mit Zadig.
CJMCU FT232H + ESR32 Rev1 aka ESP32Dev
Ich meine diesen Debugger, der auf dem FT232H-Chip basiert:
Und hier ist dieses Board, das auf ESP-WROOM-32 basiert:
Platformio.ini-Einstellungen:
[env:esp32dev]
platform = espressif32
framework = arduino
board = esp32dev
monitor_speed = 115200
upload_speed = 921600
debug_tool = minimodule
upload_protocol = minimodule
Hier haben wir eine CJMCU FT232H für 700 Rubel, die vorgibt, ein FT2232H MINI MODULE-Debugger für 4500 zu sein. Dazu müssen Sie die folgenden Änderungen an der Datei vornehmen (die Zeilen, die ich auskommentiert habe, beginnen mit ##):
/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