首页 > 其他分享 >ESP32的JTAG调试方法

ESP32的JTAG调试方法

时间:2023-06-05 22:23:06浏览次数:57  
标签:USB ESP32 idf board debug JTAG 调试

Report of JTAG

Introduction:

Figuring out a bug that is caused by two threads, running even simultaneously on two different CPU cores, can take a long time when all you have are printf () statements. A better (and in many cases quicker) way to debug such problems is by using a debugger, connected to the processors over a debug port. This is what JTAG does.

Preparation:

Hardware:

  • An ESP32S3 board.
  • USB cable - USB A / micro USB B.
  • Computer running Windows, Linux, or macOS.

hardware settings

Using the ESP32-S3-DevKitC-1 development board as an example:

The development board features two USB interfaces,One is the USB Port, and the other is the USB-to-UART Port.

Port description:

![ESP32-S3-DevKitC-1 - 正面](C:\Users\doinc\Desktop\submit_report\Report of JTAG.assets\ESP32-S3-DevKitC-1_v2-annotated-photo.png)

USB Port :ESP32-S3 full-speed USB OTG interface, compliant with the USB 1.1 specification. The interface is used for power supply to the board, for flashing applications to the chip, for communication with the chip using USB 1.1 protocols, as well as for JTAG debugging.

USB-to-UART Port :A Micro-USB port used for power supply to the board, for flashing applications to the chip, as well as for communication with the chip via the on-board USB-to-UART bridge.

So,JTAG needs to use USB Port to connect the development board to the computer

software preparation

  1. VSCode Extension

  2. Linux and macOS

  3. Install OpenOCD

    If you have already set up ESP-IDF with CMake build system according to the Getting Started Guide, then OpenOCD is already installed. After setting up the environment in your terminal, you should be able to run OpenOCD. Check this by executing the following command:

    	openocd --version
    

    The output should be as follows (although the version may be more recent than listed here):

    Open On-Chip Debugger 0.11.0
    Licensed under GNU GPL v2
    For bug reports, read
    	http://openocd.org/doc/doxygen/bugs.html
    
    

JTAG debug settings(vscode):

vscode settings:

  1. Set the interface:
    Select the /dev/ttyACM0 serial port.

  2. Set the chip type.
    Select an Espressif target (esp32, esp32s2, etc.) with the ESP-IDF: Set Espressif device target command. Default is esp32 and the one used in this tutorial.

  3. Compile the files and download

  4. JTAG debug

JTAG debug example(vs code):

  1. create a new "blink" project

  2. Perform the following configurations at the bottom of the UI

    ESP-IDF: Set Espressif device target : esp32s3

    ESP-IDF: Select Flash Method : JTAG

    ESP-IDF: Select port to use : usbserial

  3. Build project and flash device

  4. Begin debug (F5)

TIP:command method:

command shortcuts function
F5 continue
F10 step over
F11 single step debugging
Shift + F10 step out
Shift + F5 stop

JTAG debug example (Command )

  1. open idf.py

    cd blink
    . $HOME/esp/esp-idf/export.sh
    
  2. set ESP32-S3 as the target,build the project

    idf.py set-target esp32s3
    idf.py build
    
  3. download

    idf.py flash
    
  4. gdb

    idf.py gdbtui
    

  • break num ---------- set breakpoint
  • c ---------------continue

标签:USB,ESP32,idf,board,debug,JTAG,调试
From: https://www.cnblogs.com/doincli/p/17459080.html

相关文章

  • pycharm的scrapy框架-断点调试
    在文件根目录,也就是settings.py的上级目录,scrapy.cfg的同级目录,创建main.py:fromscrapy.cmdlineimportexecuteimportosimportsysif__name__=='__main__':sys.path.append(os.path.dirname(os.path.abspath(__file__)))execute(['scrapy','crawl......
  • Grafana 汉化调试(四)
    Grafana汉化调试(四)Grafana最新的9.5.2版本现在已经支持中文了,不用再安装插件去汉化了1、首先进入用户的个人资料2、把语言类型修改成“中文(简体)”3、保存修改4、这是发现界面已经变成中文了......
  • 关于荣耀X40打开USB调试之后仍然无法连接adb
    解决方案:1-打开开发者选项关于手机-多次点击版本号-提示您正处于开发者选项模式2-进入系统和更新-点击开发人员选项-开启USB调试备注:此时输出adbdevices可能无法连接,需要进一步进行设置3-选择USB配置,勾选RNDIS(USB以太网),会弹出......
  • 一分钟搭建 Web 版的 PHP 代码调试利器
    引言俗话说:"工欲善其事,必先利其器"。作为一门程序员,我们在工作中,经常需要调试某一片段的代码,但是又不想打开繁重的IDE(代码编辑器)。使用在线工具调试代码有时有苦于网速太渣,运行结果迟迟出不来。在这种情况下,我们就需要一个离线版的代码调试神奇了,所以我今天就介绍一款PHP代码......
  • nodejs调试工具
    Node应用调试工具debugger文档 http://nodejs.org/api/debugger.html内置的调试工具,支持基本的断点功能NodeInspector主页 https://github.com/node-inspector/node-inspector通过BlinkDeveloperTools提供的网页版JS调试工具来调试Node程序.NodeEclipse主页 http:......
  • Ofbiz安装, 调试 和 迁移数据库
    如何将OFBIZ(opentaps)默认数据库迁移至mysql[url]http://blog.sina.com.cn/s/blog_4a4820f9010008oo.html[/url]OFBiz12.4数据库转变成Mysql[url]http://wxynxyo.iteye.com/blog/1955648[/url]Ofbiz的安装[url]http://tomhat.iteye.com/blog/1330491[......
  • PECMD 是一种管理和调试 Windows PE 系统的命令行工具,主要用于在 WinPE 环境下进行系
    PECMD是一种管理和调试WindowsPE系统的命令行工具,主要用于在WinPE环境下进行系统管理、修复和救援等操作。根据资料记录,PECMD已经发布了如下版本:PECMD2003:发布于2003年,适用于WindowsPE1.0版本。PECMD2005:发布于2005年,适用于WindowsPE2.0版本,新增支持更......
  • 基于ESP32的TCP/IP传输实现
    TCP/IP协议原理TCP/IP协议是Internet互联网最基本的协议,TCP/IP协议的应用层的主要协议有HTTP、Telnet、FTP、SMTP等,是用来读取来自传输层的数据或者将数据传输写入传输层;传输层的主要协议有UDP、TCP,实现端对端的数据传输;网络层的主要协议有ICMP、IP、IGMP,主要负责网络中数据包的......
  • vue 浏览器调试 定位具体行数
    module.exports={lintOnSave:false,devServer:{//开发环境下设置为编译好以后直接打开浏览器浏览open:true,},configureWebpack:(config)=>{//调试JSconfig.devtool="eval-source-map"},css:{//查看CSS属于哪个css文件......
  • Python | VSCode代码调试技巧
    VScode开启代码调试点击左侧的调试按钮:打上断点后:左侧可以监测变量的变化;主要用到的单步调试栏:主要有单步跳过、单步进入、单步跳出等。......