ESP32 download program under VScode

The download method of ESP32-S3 can be downloaded through UART0, USB, JTAG, and WIFI can be used for remote OTA upgrade program.

Introduction to the buttons on the bottom bar of the plug-in:

①Select the serial port number , such as COM3; ②Select the chip model ; ③Project idf setting, equivalent to menuconfig; ④Clear all compiled files; ⑤Compile; ⑥Program method , such as uart, jtag and DFU; To compile and burn, configure the uart burning port first, choose according to your actual port number, and then select the chip model, be sure to select the target chip, otherwise the compilation will report an error, I chose ESP32-S3 (ESP-PROG JTAG), which is the external jtag;

1. UART0 download method.

Hardware environment:

Use the tool "USB to serial port";

3.3V power supply, GND, EN enable;

Before powering on, the IO0 pin is grounded first. If you use the serial port tool to view the output information of UART0, as shown in the figure below

Use VScode to download the program.

The IO0 pin is grounded first, powered on, and the .bin file is generated after compilation.

After compiling, click the button in the picture to download.

After the download is complete, output the above information.

Two, online debugging

Uart0 can download programs, but cannot perform online debugging. Online debugging needs to use JTAG, and ESP32 does not support SWD mode.

working principle

Introduce how ESP32-S3, JTAG (Joint Test Action Group) interface, OpenOCD and GDB are connected to each other, so as to realize the debugging function of ESP32-S3

Select JTAG Adapter

如果您想使用单独的 JTAG 适配器,请确保其与 ESP32-S3 的电平电压和 OpenOCD 软件都兼容。ESP32-S3 使用的是业界标准的 JTAG 接口,它未使用(实际上也并不需要)TRST 信号脚。JTAG 使用的 IO 管脚由 VDD_3P3_RTC 电源管脚供电(通常连接到外部 3.3 V 的电源轨),因此 JTAG 硬件适配器的管脚需要能够在该电压范围内正常工作。

在软件方面,OpenOCD 支持相当多数量的 JTAG 适配器,请参阅 OpenOCD 支持的适配器列表 (请注意这一列表并不完整),其中还列出了兼容 SWD 接口的适配器,但请注意,ESP32-S3 目前并不支持 SWD。此外,被硬编码为只支持特定产品线的 JTAG 适配器也无法在 ESP32-S3 上工作,例如仅针对 STM32 系列产品的 ST-LINK 适配器。

JTAG 正常工作至少需要连接的信号线有:TDI、TDO、TCK、TMS 和 GND。一些 JTAG 适配器还需要 ESP32-S3 提供一路电源到适配器的某个管脚上(比如 Vtar),用于设置适配器的工作电压。您也可以选择将 SRST 信号线连接到 ESP32-S3 的 CH_PD 管脚上,但请注意,目前 OpenOCD 对该信号线提供的支持相当有限。

ESP-Prog 中展示了使用外部电路板进行调试的实例,方法是将其连接到 ESP32-S3 的 JTAG 管脚上。

参考文章

【esp32开发】vscode+espidf开发环境搭建(实现单步调试) - vscode单步调试ostream - 实验室设备网 (zztongyun.com)

【esp32开发】vscode+espidf开发环境搭建(实现单步调试) - vscode单步调试ostream - 实验室设备网 (zztongyun.com)

(42条消息) ESP32S3 固件烧录需满足的硬件环境整理_25March的博客-CSDN博客

JTAG 调试 - ESP32-S3 - — ESP-IDF 编程指南 v4.4 文档 (espressif.com)

Guess you like

Origin blog.csdn.net/m0_38012497/article/details/129283097