esp32-s3 的gpio无法设置JTAG接口

liucheng
Posts: 4
Joined: Thu Aug 18, 2022 7:14 am

esp32-s3 的gpio无法设置JTAG接口

Postby liucheng » Thu Aug 18, 2022 7:29 am

根据文档(https://docs.espressif.com/projects/esp ... -jtag.html)描述:“烧录 JTAG_SEL_ENABLE eFuse 后,JTAG 接口的选择将由 strapping 管脚 GPIO3 来决定。ESP32-S3 复位时,如果该 strapping 管脚为低电平,JTAG 接口将使用 GPIO39-GPIO42,如果为高电平,USB_SERIAL_JTAG 将被用作 JTAG 接口。”

我需要执行:espefuse.py -p /dev/ttyUSB0 burn_efuse JTAG_SEL_ENAB
使能esp32-s3的管脚为JTAG接口失败

Code: Select all

#espefuse.py -p /dev/ttyUSB0  burn_efuse JTAG_SEL_ENABLE
/home/lc/esp/esp-idf/components/esptool_py/esptool/espsecure.py:18: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography import exceptions
Connecting....
Detecting chip type... ESP32-S3
espefuse.py v3.3.2-dev

A fatal error occurred: Invalid the efuse name 'JTAG_SEL_ENABLE'. Available the efuse names: ['WR_DIS', 'RD_DIS', 'DIS_ICACHE', 'DIS_DCACHE', 'DIS_DOWNLOAD_ICACHE', 'DIS_DOWNLOAD_DCACHE', 'DIS_FORCE_DOWNLOAD', 'DIS_USB', 'DIS_CAN', 'DIS_APP_CPU', 'SOFT_DIS_JTAG', 'HARD_DIS_JTAG', 'DIS_DOWNLOAD_MANUAL_ENCRYPT', 'USB_EXCHG_PINS', 'EXT_PHY_ENABLE', 'BTLC_GPIO_ENABLE', 'VDD_SPI_XPD', 'VDD_SPI_TIEH', 'VDD_SPI_FORCE', 'WDT_DELAY_SEL', 'SPI_BOOT_CRYPT_CNT', 'SECURE_BOOT_KEY_REVOKE0', 'SECURE_BOOT_KEY_REVOKE1', 'SECURE_BOOT_KEY_REVOKE2', 'KEY_PURPOSE_0', 'KEY_PURPOSE_1', 'KEY_PURPOSE_2', 'KEY_PURPOSE_3', 'KEY_PURPOSE_4', 'KEY_PURPOSE_5', 'SECURE_BOOT_EN', 'SECURE_BOOT_AGGRESSIVE_REVOKE', 'DIS_USB_JTAG', 'DIS_USB_SERIAL_JTAG', 'STRAP_JTAG_SEL', 'USB_PHY_SEL', 'FLASH_TPUW', 'DIS_DOWNLOAD_MODE', 'DIS_DIRECT_BOOT', 'DIS_USB_SERIAL_JTAG_ROM_PRINT', 'FLASH_ECC_MODE', 'DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE', 'ENABLE_SECURITY_DOWNLOAD', 'UART_PRINT_CONTROL', 'PIN_POWER_SELECTION', 'FLASH_TYPE', 'FLASH_PAGE_SIZE', 'FLASH_ECC_EN', 'FORCE_SEND_RESUME', 'SECURE_VERSION', 'DIS_USB_OTG_DOWNLOAD_MODE', 'MAC', 'SPI_PAD_CONFIG_CLK', 'SPI_PAD_CONFIG_Q', 'SPI_PAD_CONFIG_D', 'SPI_PAD_CONFIG_CS', 'SPI_PAD_CONFIG_HD', 'SPI_PAD_CONFIG_WP', 'SPI_PAD_CONFIG_DQS', 'SPI_PAD_CONFIG_D4', 'SPI_PAD_CONFIG_D5', 'SPI_PAD_CONFIG_D6', 'SPI_PAD_CONFIG_D7', 'WAFER_VERSION', 'PKG_VERSION', 'BLOCK1_VERSION', 'OPTIONAL_UNIQUE_ID', 'BLOCK2_VERSION', 'CUSTOM_MAC', 'BLOCK_USR_DATA', 'BLOCK_KEY0', 'BLOCK_KEY1', 'BLOCK_KEY2', 'BLOCK_KEY3', 'BLOCK_KEY4', 'BLOCK_KEY5', 'BLOCK_SYS_DATA2']


请问原因是什么如何解决?

liucheng
Posts: 4
Joined: Thu Aug 18, 2022 7:14 am

Re: esp32-s3 的gpio无法设置JTAG接口

Postby liucheng » Thu Aug 18, 2022 7:33 am

我已经验证过,编译环境是ok的,下载,命令,打印log都命令都可以正常执行
idf.py set-target esp32s3 (ok)
idf.py build (ok)
idf.py -p /dev/ttyUSB0 -b 460800 flash (ok)
idf.py -p /dev/ttyUSB0 monitor (ok)

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: esp32-s3 的gpio无法设置JTAG接口

Postby ESP_Gargamel » Thu Aug 18, 2022 7:51 am

文档有问题,对于 S3,应该是 STRAP_JTAG_SEL
JTAG_SEL_ENABLE 是针对 C3 的。

liucheng
Posts: 4
Joined: Thu Aug 18, 2022 7:14 am

Re: esp32-s3 的gpio无法设置JTAG接口

Postby liucheng » Thu Aug 18, 2022 8:44 am

1 输入命令:STRAP_JTAG_SEL

Code: Select all

#espefuse.py -p /dev/ttyUSB0  burn_efuse STRAP_JTAG_SEL
/home/lc/esp/esp-idf/components/esptool_py/esptool/espsecure.py:18: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography import exceptions
Connecting....
Detecting chip type... ESP32-S3
espefuse.py v3.3.2-dev

=== Run "burn_efuse" command ===
The efuses to burn:
  from BLOCK0
     - STRAP_JTAG_SEL

Burning efuses:

    - 'STRAP_JTAG_SEL' (Enable selection between usb_to_jtagor pad_to_jtag through GPIO3) 0b0 -> 0b1

Check all blocks for burn...
idx, BLOCK_NAME,          Conclusion
[00] BLOCK0               is not empty
	(written ): 0x0000000080000100000000000000d1f50000000000000000
	(to write): 0x000000000000000001000000000000000000000000000000
	(coding scheme = NONE)
. 
This is an irreversible operation!
Type 'BURN' (all capitals) to continue.

Aborting.
2 将GPIO3 接地,重启开发板
3 启动openOCD调试:

Code: Select all

lc@ubuntu:~$ 
lc@ubuntu:~$ sudo /usr/local/bin/openocd -c "adapter driver  cmsis-dap"
Open On-Chip Debugger  v0.11.0-esp32-20220706-52-g7e1f6985 (2022-08-17-20:34)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: JTAG supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: FW Version = 0254
Info : CMSIS-DAP: Serial# = 110136024420312051534838333037203630303297969903
Info : CMSIS-DAP: Interface Initialised (JTAG)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Error: CMSIS-DAP command CMD_DAP_SWJ_CLOCK failed.
我认为步骤1,2,应该已经调试到JTAG模式了,但是步骤3中还是报错“Error: CMSIS-DAP command CMD_DAP_SWJ_CLOCK failed.”
请问有解决思路吗?我感觉还是管脚设置不对呀。。。

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: esp32-s3 的gpio无法设置JTAG接口

Postby ESP_Gargamel » Thu Aug 18, 2022 9:22 am

1、esp openocd 应该还没有支持 CMSIS-DAP
2、为什么不直接用 builtin 的 jtag?
3、你要用 jtag 的话,要么整个 https://item.taobao.com/item.htm?spm=a1 ... 062944&mt=

liucheng
Posts: 4
Joined: Thu Aug 18, 2022 7:14 am

Re: esp32-s3 的gpio无法设置JTAG接口

Postby liucheng » Fri Aug 19, 2022 2:35 am

问题解决

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: esp32-s3 的gpio无法设置JTAG接口

Postby ESP_Gargamel » Fri Aug 19, 2022 3:29 am

麻烦解释一下,也利于其他遇到类似问题的开发者。另外,使用的是哪种 JTAG?

Who is online

Users browsing this forum: No registered users and 26 guests