文章目录
ESP32 S3的两种JTAG调试方法
- ESP32 S3的有两种JTAG调试方法,直接连接板子上的JTAG引脚进行调试,或者用ESP32-S3 内置 JTAG 接口进行调试,这些方法有助于开发者在开发过程中进行更深入的调试。
1、ESP32-S3 内置 JTAG 接口
-
使用 ESP32-S3 内置 JTAG 接口ESP32-S3 芯片本身就集成了 JTAG 功能,这意味着你可以直接通过 USB 线连接到芯片的 D+ 和 D- 引脚来进行 JTAG 调试,而不需要额外的 JTAG 适配器。这种调试方式较为简便,只需要按照以下步骤操作:
- 硬件连接:将 USB 线的 D+ 和 D- 引脚连接到 ESP32-S3 的相应引脚上。注意不要将 USB 通信引脚误连到通常用于串行通信的 RxD 和 TxD 引脚上。
- 软件配置:使用支持 JTAG 调试的工具,如 OpenOCD。配置相应的 OpenOCD 配置文件,指定正确的 JTAG 配置和目标设备。
-
ESP32-S3 系列芯片集成了一个 USB 串口/JTAG 控制器,作为兼容 USB 2.0 全速模式的设备。GPIO19 和 GPIO20 可以分别作为 USB 的 D- 和 D+(通过USB进行直连的方法如以下原理图所示),线上建议预留串联电阻(初始值可为 0 Ω)和对地电容(初始可不上件),并注意靠近芯片端放置。

2、外部 JTAG 适配器

- 可以使用传统的 JTAG 适配器来实现调试。使用外部 JTAG 适配器的方法包括:硬件连接:连接 JTAG 适配器到 ESP32-S3 的 JTAG 接口,通常包括 TCK, TDI, TDO, TMS, nTRST 等引脚。软件配置:同样使用支持 JTAG 的调试工具,例如 OpenOCD。
内置 JTAG 接口调试过程
vcode + platformio 插件安装与测试


-
进入下载模式:EN上升沿时候GPIO0保持为低电平,即在烧录的过程中按住GPIO0,单片机和电脑进行 Serial port COM3 Connecting…时点击EN即可

-
对于本次测试用的硬件:https://oshwhub.com/z294933698/4-2-cun-mo-shui-ping-gai_copy

集成jtag驱动安装

-
驱动地址:https://dl.espressif.com/dl/idf-driver/idf-driver-esp32-usb-jtag-2021-07-15.zip
-
解压后右键点击 USB_JTAG_debug_unit.inf 进行安装


openocd安装(esp-idf安装)
- 注:在安装之前最好有一个能在环境变量中访问的python执行程序。
- 下载地址:https://dl.espressif.cn/dl/esp-idf/







-
还可使用EIM方式安装:下载后,只需运行安装程序即可。 它会自动检测并安装任何缺失的前置条件,并引导你完成设置过程。

-
Installation Log:
All offline installations completed successfully
Archive archive_vv5.5.2_windows-x64.zst processed successfully (1/1)
IDE configuration saved successfully
IDE configuration directory created
IDE configuration directory created
ESP-IDF version v5.5.2 configured successfully
Development tools configured successfully
Tools setup completed successfully
Python environment installed successfully
Installed tool: idf-exe-v1.0.3 (14/14)
Verified: idf-exe-v1.0.3
Starting download: idf-exe-v1.0.3
Installed tool: ccache-4.11.2-windows (13/14)
Verified: ccache-4.11.2-windows
Starting download: ccache-4.11.2-windows
Installed tool: riscv32-esp-elf (12/14)
Verified: riscv32-esp-elf
Starting download: riscv32-esp-elf
Installed tool: libs-clang-esp (11/14)
Verified: libs-clang-esp
Starting download: libs-clang-esp
Installed tool: ninja-win (10/14)
Verified: ninja-win
Starting download: ninja-win
Installed tool: cmake-3.30.2-windows (9/14)
Verified: cmake-3.30.2-windows
Starting download: cmake-3.30.2-windows
Installed tool: clang-esp-19.1.2_20250312 (8/14)
Verified: clang-esp-19.1.2_20250312
Starting download: clang-esp-19.1.2_20250312
Installed tool: xtensa-esp-elf (7/14)
Verified: xtensa-esp-elf
Starting download: xtensa-esp-elf
Installed tool: riscv32-esp-elf (6/14)
Verified: riscv32-esp-elf
Starting download: riscv32-esp-elf
Installed tool: xtensa-esp-elf (5/14)
Verified: xtensa-esp-elf
Starting download: xtensa-esp-elf
Starting download: openocd-esp32-win64
Installed tool: esp32ulp-elf-2.38_20240113 (2/14)
Verified: esp32ulp-elf-2.38_20240113
Starting download: esp32ulp-elf-2.38_20240113
Installed tool: esp-rom-elfs (1/14)
Verified: esp-rom-elfs
Starting download: esp-rom-elfs
Development tools copied successfully
Version paths configured for v5.5.2: C:\esp\v5.5.2\esp-idf
ESP-IDF copied successfully from offline archive
Prerequisites installed successfully from offline archive
Archive extracted and configured successfully
Created temporary directory: C:\Users\audit\AppData\Local\Temp\.tmpP4ts9b
Validated archive: C:\Users\audit\Downloads\archive_vv5.5.2_windows-x64.zst
Starting offline installation with 1 archive(s)

进入jtag模式
-
未连接USB端口

-
连接USB端口

-
点击板载复位按钮进入JTAG调试模式:

-
链接USB端口COM7进行调试,链接COM6进行应用程序加载和监视,即可进行调试
eFuse配置与jtag连接




进行调试
- PlatformIO项目配置文件如下:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32-s3-devkitm-1]
platform = espressif32
board = esp32-s3-devkitm-1
framework = arduino
upload_port = COM7
; upload_speed = 2000000
; monitor_speed = 115200
monitor_port = COM6
debug_tool = esp-builtin
; debug_init_break = break setup
debug_init_break = tbreak setup
build_type = debug
- 点击调试按钮进行程序调试

CG
- V0发布时间:2024.08.10.21:00
- ESP32 S3原理图设计手册
- S3模组电路设计
- 配置 ESP32-S3 内置 JTAG 接口
- esp32s3 规格书
- ESP-IDF用cmake和CMakeLists.txt配置与组织项目: 入门 ESP-IDF 工程结构【新手超详细教程】







1万+



被折叠的 条评论
为什么被折叠?



