I have a problem using the USB-JTAG Bridge feature of the ESP32-S3.
I want to program to another MCU via the ESP32-S3's USB JTAG Bridge feature.
I used the code snippet suggested by ESP_Sprite in this thread: https://esp32.com/viewtopic.php?t=25670
Code: Select all
WRITE_PERI_REG(USB_SERIAL_JTAG_CONF0_REG, READ_PERI_REG(USB_SERIAL_JTAG_CONF0_REG)|USB_SERIAL_JTAG_USB_JTAG_BRIDGE_EN);
esp_rom_gpio_connect_out_signal(GPIO_NUM_43, 85, false, false); //tck
esp_rom_gpio_connect_out_signal(GPIO_NUM_44, 86, false, false); //tms
esp_rom_gpio_connect_out_signal(GPIO_NUM_45, false, false); //tdi
esp_rom_gpio_connect_out_signal(GPIO_NUM_39, 251, false, false); //trst, wire to reset or EN of target
esp_rom_gpio_connect_in_signal(GPIO_NUM_46, false); //tdo
I can confirm after checking with Logic Analyzer that TCK, TMS and TDI are in fact "bridged" to GPIO 43, 44 and 45 respectively. However, whenever I try to send an SRST HIGH (command nibble 9h via the JTAG command processor), it also resets the ESP32-S3 itself.
Upon checking the TRM 1.2, I found:
Again from TRM 1.2, I found:USB_SERIAL_JTAG_USB_JTAG_BRIDGE_EN Set this bit usb_jtag, the connection between
usb_jtag and internal JTAG is disconnected, and MTMS, MTDI, MTCK are output through GPIO
Matrix, MTDO is input through GPIO Matrix. (R/W)
Since this "bridge" feature is enabled by a code snippet inside the user APP, if the ESP32-S3 is restarted it will disable this "bridge" feature.... TCK, TMS, TDI and TDO are connected directly to the JTAG debugging logic of the
Xtensa CPUs. SRST is connected to the reset logic of the digital circuitry in the SoC and a high level on this line
will cause a digital system reset. Note that the USB Serial/JTAG Controller itself is not affected by SRST.
If this is the case, how can I use the JTAG bridge feature without resetting the ESP32-S3 each time I issue a reset cycle on the SRST line?
Furthermore, from TRM 1.2 I came across USBtoJTAG Control Requests:
VEND_JTAG_SETIO can bypass the JTAG command processor to set the internal TDI, TDO, TMS and
SRST lines to given values. These values are encoded in the wValue field in the format of 11’b0, srst, trst,
tck, tms, tdi.
It would appear that SRST and usb_jtag_trst can be controlled separately. What is the difference between srst and trst here when setting usb_jtag_trst high already effectively resets the ESP32-S3?
Best Regards,