Can esp32s3 use USB jtag instead of GPIO0 control?

dicethrow
Posts: 2
Joined: Tue Feb 13, 2024 7:05 am

Can esp32s3 use USB jtag instead of GPIO0 control?

Postby dicethrow » Wed May 29, 2024 2:48 pm

My goal here is to be able to flash my custom PCB, which I have not been able to do yet.

I had thought that I could use USB jtag on the esp32s3 board to get it into 'download mode'.

If I run this python code snippet, implementing the approach in section 33.4.2 of esp32s3 TRM v1.4:

Code: Select all

 
with serial.serial_for_url(args.port, args.baud, do_not_open=True) as serial_instance:
	serial_instance.dtr = False
	serial_instance.rts = False

	serial_instance.rts = False

	serial_instance.dtr = True # set download mode flag
	serial_instance.rts = False # propagate dtr flag

	serial_instance.rts = True 

	serial_instance.dtr = False # reset 
	serial_instance.rts = True # propagate dtr

	serial_instance.rts = False # clear download flag
then the jtag uart terminal displays this: (note, it would otherwise keep displaying the 'invalid header' line continuously)

Code: Select all

invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40049b23
0x40049b23: SPI_WakeUp in ROM

invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x0 (DOWNLOAD(USB/UART0))
Saved PC:0x40043d08
0x40043d08: _cvt in ROM

waiting for download
So that is what I was hoping would have the same effect/meaning as doing the GPIO0/reset boot strapping stuff, to make the esp32s3 ready to be reprogrammed. It looks like the TRM uses the phrase 'Joint Download Boot' to describe using GPIO0 during reset to get into a state for reprogramming, which could be relevant here, but it confuses me because above I was able to get the 'waiting for download' to be printed, and yet according to me leaving GPIO floating (and hence being pulled up), I was not in the 'Joint Download Boot' state. I was also able to reprogram esp32s3 devboards using just the above technique fine, without touching GPIO0, but now on my custom PCB this does not appear to work.

However, when I try do program it from this point, I can do a bunch of things, but it always errors out at the same point in commands like this, when I try to flash 'hello world' to it: This output contains some arguments to be more verbose.

Code: Select all

$ python -m esptool --chip esp32s3 --port /dev/ttyACM0 -b 9600 --trace --no-stub --before default_reset --after no_reset_stub write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/hello_world.bin
esptool.py v4.7.0
Serial port /dev/ttyACM0
Connecting...TRACE +0.000 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes: 
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.100 No serial data received.
.TRACE +0.050 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes: 
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.001 Read 1 bytes: c0
TRACE +0.000 Read 27 bytes: 
    0108040007071220 00000000c0c00108 | ....... ........
    0400070712200000 0000c0           | ..... .....
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Read 28 bytes: 
    c001080400070712 2000000000c0c001 | ........ .......
    0804000707122000 000000c0         | ...... .....
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Read 28 bytes: 
    c001080400070712 2000000000c0c001 | ........ .......
    0804000707122000 000000c0         | ...... .....
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Read 14 bytes: c0010804000707122000000000c0
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Read 14 bytes: c0010804000707122000000000c0
TRACE +0.000 Received full packet: 010804000707122000000000

TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=00100040
TRACE +0.000 Write 14 bytes: c0000a04000000000000100040c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000900000000000000c0
TRACE +0.000 Received full packet: 010a04000900000000000000
TRACE +0.000 command op=0x14 data len=0 wait_response=1 timeout=3.000 data=
TRACE +0.000 Write 10 bytes: c00014000000000000c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 33 bytes: 
    0114180009000000 0000000000000000 | ................
    0000000c09000000 0000000000000000 | ................
    c0                                | .
TRACE +0.000 Received full packet: 
    0114180009000000 0000000000000000 | ................
    0000000c09000000 0000000000000000 | ................
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=4cf1ce3f
TRACE +0.000 Write 14 bytes: c0000a0400000000004cf1ce3fc0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000400000000000000c0
TRACE +0.000 Received full packet: 010a04000400000000000000
TRACE +0.002 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=b0800060a13ad850ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 00b0800060a13ad8 | ............`.:.
    50ffffffff000000 00c0             | P.........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000400000000000000c0
TRACE +0.000 Received full packet: 010904000400000000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=9880006000000000ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0098800060000000 | ............`...
    00ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000400000000000000c0
TRACE +0.000 Received full packet: 010904000400000000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=b080006000000000ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 00b0800060000000 | ............`...
    00ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000400000000000000c0
TRACE +0.000 Received full packet: 010904000400000000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=b88000602a311d8fffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 00b88000602a311d | ............`*1.
    8fffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000400000000000000c0
TRACE +0.000 Received full packet: 010904000400000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=b4800060
TRACE +0.000 Write 14 bytes: c0000a040000000000b4800060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000b00400000000c0
TRACE +0.000 Received full packet: 010a04000000b00400000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=b48000600000b084ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 00b48000600000b0 | ............`...
    84ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000b00400000000c0
TRACE +0.000 Received full packet: 010904000000b00400000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=b880006000000000ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 00b8800060000000 | ............`...
    00ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000b00400000000c0
TRACE +0.000 Received full packet: 010904000000b00400000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.001 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400b4e4008000000000c0
TRACE +0.000 Received full packet: 010a0400b4e4008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.001 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400b4e4008000000000c0
TRACE +0.000 Received full packet: 010a0400b4e4008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400b4e4008000000000c0
TRACE +0.000 Received full packet: 010a0400b4e4008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.000 Read 14 bytes: c0010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
Chip is ESP32-S3 (QFN56) (revision v0.2)
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.000 Read 14 bytes: c0010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.001 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=54700060
TRACE +0.000 Write 14 bytes: c0000a04000000000054700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400c878dadc00000000c0
TRACE +0.000 Received full packet: 010a0400c878dadc00000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=54700060
TRACE +0.000 Write 14 bytes: c0000a04000000000054700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400c878dadc00000000c0
TRACE +0.000 Received full packet: 010a0400c878dadc00000000
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_3v3)
Crystal is 40MHz
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=44700060
TRACE +0.000 Write 14 bytes: c0000a04000000000044700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400204806f900000000c0
TRACE +0.000 Received full packet: 010a0400204806f900000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=48700060
TRACE +0.000 Write 14 bytes: c0000a04000000000048700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04003030000000000000c0
TRACE +0.000 Received full packet: 010a04003030000000000000
MAC: 30:30:f9:06:48:20
Enabling default SPI flash mode...
TRACE +0.000 command op=0x0d data len=8 wait_response=1 timeout=3.000 data=0000000000000000
TRACE +0.000 Write 18 bytes: 
    c0000d0800000000 0000000000000000 | ................
    00c0                              | ..
TRACE +0.001 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010d04003030000000000000c0
TRACE +0.000 Received full packet: 010d04003030000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=18200060
TRACE +0.000 Write 14 bytes: c0000a04000000000018200060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000008000000000c0
TRACE +0.000 Received full packet: 010a04000000008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=20200060
TRACE +0.000 Write 14 bytes: c0000a04000000000020200060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000007000000000c0
TRACE +0.000 Received full packet: 010a04000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=2820006017000000ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0028200060170000 | .........( .`...
    00ffffffff000000 00c0             | ..........
TRACE +0.001 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=1820006000000090ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0018200060000000 | .......... .`...
    90ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=202000609f000070ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 00202000609f0000 | .........  .`...
    70ffffffff000000 00c0             | p.........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=5820006000000000ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0058200060000000 | .........X .`...
    00ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=0020006000000400ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0000200060000004 | .......... .`...
    00ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=00200060
TRACE +0.000 Write 14 bytes: c0000a04000000000000200060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000000000000c0
TRACE +0.000 Received full packet: 010a04000000000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58200060
TRACE +0.000 Write 14 bytes: c0000a04000000000058200060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04007fffff0000000000c0
TRACE +0.000 Received full packet: 010a04007fffff0000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=1820006000000080ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0018200060000000 | .......... .`...
    80ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904007fffff0000000000c0
TRACE +0.000 Received full packet: 010904007fffff0000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=2020006000000070ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0020200060000000 | .........  .`...
    70ffffffff000000 00c0             | p.........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904007fffff0000000000c0
TRACE +0.000 Received full packet: 010904007fffff0000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=18200060
TRACE +0.000 Write 14 bytes: c0000a04000000000018200060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000008000000000c0
TRACE +0.000 Received full packet: 010a04000000008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=20200060
TRACE +0.000 Write 14 bytes: c0000a04000000000020200060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000007000000000c0
TRACE +0.000 Received full packet: 010a04000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=2820006007000000ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0028200060070000 | .........( .`...
    00ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=1c2000600700005cffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 001c200060070000 | .......... .`...
    5cffffffff000000 00c0             | \.........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=18200060000000f0ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0018200060000000 | .......... .`...
    f0ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=202000605a000070ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 00202000605a0000 | .........  .`Z..
    70ffffffff000000 00c0             | p.........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=0420006010000000ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0004200060100000 | .......... .`...
    00ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=5820006000000000ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0058200060000000 | .........X .`...
    00ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=0020006000000400ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0000200060000004 | .......... .`...
    00ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=00200060
TRACE +0.000 Write 14 bytes: c0000a04000000000000200060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000000000000c0
TRACE +0.000 Received full packet: 010a04000000000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58200060
TRACE +0.000 Write 14 bytes: c0000a04000000000058200060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400ff00000000000000c0
TRACE +0.000 Received full packet: 010a0400ff00000000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=1820006000000080ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0018200060000000 | .......... .`...
    80ffffffff000000 00c0             | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 01090400ff00000000000000c0
TRACE +0.000 Received full packet: 01090400ff00000000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=2020006000000070ffffffff00000000
TRACE +0.000 Write 26 bytes: 
    c000091000000000 0020200060000000 | .........  .`...
    70ffffffff000000 00c0             | p.........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 01090400ff00000000000000c0
TRACE +0.000 Received full packet: 01090400ff00000000000000
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0xffff7f, SizeID=0xff), defaulting to 4MB
TRACE +0.000 command op=0x0b data len=24 wait_response=1 timeout=3.000 data=
    0000000000004000 0000010000100000 | ......@.........
    00010000ffff0000                  | ........
TRACE +0.000 Write 34 bytes: 
    c0000b1800000000 0000000000000040 | ...............@
    0000000100001000 0000010000ffff00 | ................
    00c0                              | ..
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010b0400ff00000000000000c0
TRACE +0.000 Received full packet: 010b0400ff00000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=38700060
TRACE +0.000 Write 14 bytes: c0000a04000000000038700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000000000000c0
TRACE +0.000 Received full packet: 010a04000000000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400b4e4008000000000c0
TRACE +0.000 Received full packet: 010a0400b4e4008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400b4e4008000000000c0
TRACE +0.000 Received full packet: 010a0400b4e4008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400b4e4008000000000c0
TRACE +0.000 Received full packet: 010a0400b4e4008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.001 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400b4e4008000000000c0
TRACE +0.000 Received full packet: 010a0400b4e4008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400b4e4008000000000c0
TRACE +0.000 Received full packet: 010a0400b4e4008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400b4e4008000000000c0
TRACE +0.000 Received full packet: 010a0400b4e4008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=30700060
TRACE +0.000 Write 14 bytes: c0000a04000000000030700060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000000000000c0
TRACE +0.000 Received full packet: 010a04000000000000000000
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x00045fff...
Erasing flash...
Flash params set to 0x022f
TRACE +0.001 command op=0x02 data len=20 wait_response=1 timeout=3.000 data=
    2052000015000000 0004000000000000 |  R..............
    00000000                          | ....
TRACE +0.000 Write 30 bytes: 
    c000021400000000 0020520000150000 | ......... R.....
    0000040000000000 0000000000c0     | ..............
TRACE +3.003 Serial data stream stopped: Possible serial noise or corruption.

A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.
After playing around with making an `esptool.cfg` file with this content, specifically re. the 'custom_reset_sequence' which I believe implements the same thing as my python snippet above. Note the idea for this file came from reading this page: https://docs.espressif.com/projects/esp ... -file.html

Code: Select all

# esptool.cfg file to configure internal settings of esptool
[esptool]
chip_erase_timeout = 140
serial_write_timeout = 8.5
connect_attempts = 7
write_block_attempts = 2
reset_delay = 0.75
# Overriding the default reset sequence to work in an abnormal environment
custom_reset_sequence = D0|R1|W0.5|D1|R0|W0.5|D0
Then, somewhat intermittently, the output looks like this; note there are some of the 'invalid header' lines too:

Code: Select all

$ python -m esptool --chip esp32s3 --port /dev/ttyACM0 -b 9600 --trace --no-stub --before default_reset --after no_reset_stub write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/hello_world.bin
esptool.py v4.7.0
Loaded custom configuration from /home/ubuntu/esp/my_tests/hello_world/esptool.cfg
Serial port /dev/ttyACM0
Connecting...TRACE +0.000 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes: 
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +1.386 Read 4095 bytes: 
    7866666666666666 660d0a696e76616c | xffffffff..inval
    6964206865616465 723a203078666666 | id header: 0xfff
    66666666660d0a69 6e76616c69642068 | fffff..invalid h
    65616465723a2030 7866666666666666 | eader: 0xfffffff
    660d0a696e76616c 6964206865616465 | f..invalid heade
    723a203078666666 66666666660d0a69 | r: 0xffffffff..i
    6e76616c69642068 65616465723a2030 | nvalid header: 0
    7866666666666666 660d0a696e76616c | xffffffff..inval
But it keeps erroring out. Any ideas? I'm hoping that there is some little change I need to make. Thanks!

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Can esp32s3 use USB jtag instead of GPIO0 control?

Postby ESP_Sprite » Thu May 30, 2024 2:40 am

Can you post the schematic of your custom PCB?

dicethrow
Posts: 2
Joined: Tue Feb 13, 2024 7:05 am

Re: Can esp32s3 use USB jtag instead of GPIO0 control?

Postby dicethrow » Thu May 30, 2024 1:27 pm

Ok I think I worked it out. I used the ESP32-S3R8 chip, which I have just realised doesn't have internal flash, and so perhaps the behavior we are seeing makes sense as there is no flash chip in the system - as that's where the error occurs.

Looks like someone else had a similar experience (https://community.platformio.org/t/my-c ... gs/35736/7), so I'll try to copy their fix: order a chip with internal flash (ESP32-S3FN8) and try that on the next build of my custom PCB.

Thanks for the help!

Out of curiosity - is there any way to 'flash' code into the PSRAM of the ESP32-S3R8, without having to use any flash memory?

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Can esp32s3 use USB jtag instead of GPIO0 control?

Postby ESP_Sprite » Fri May 31, 2024 1:00 am

dicethrow wrote:
Thu May 30, 2024 1:27 pm

Out of curiosity - is there any way to 'flash' code into the PSRAM of the ESP32-S3R8, without having to use any flash memory?
Technically, this is possible, but we do not have software support for this at the moment.

Who is online

Users browsing this forum: No registered users and 169 guests