espressif / esptool

Espressif SoC serial bootloader utility
https://docs.espressif.com/projects/esptool
GNU General Public License v2.0
5.52k stars 1.37k forks source link

esptool flashes but does not erase flash (ESPTOOL-666) #870

Closed jouellnyc closed 1 year ago

jouellnyc commented 1 year ago

Operating System

Linux / uname -a 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Esptool Version

esptool.py v4.6-dev

Python Version

Python 3.10.6

Chip Description

ESP32

Device Description

ESP32-DevKitC-VE Development Board

This one: https://www.amazon.com/gp/product/B087TNPQCV/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Hardware Configuration

2.8 Inch ILI93414 screen

How is Esptool Run

No

Full Esptool Command Line that Was Run

./esptool.py --port /dev/ttyUSB0 write_flash -z 0x1000 /tmp/firmware/esp32spiram-20230405-unstable-v1.19.1-1008-gc046b23ea.bin

Esptool Output

== w/o --trace:

/esptool.py   --port /dev/ttyUSB0 write_flash -z 0x1000   ~/esp32/firmware/esp32spiram-20230405-unstable-v1.19.1-1008-gc046b23ea.bin
esptool.py v4.6-dev
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 40:22:d8:06:f5:58
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00175fff...
Compressed 1527632 bytes to 990167...
Wrote 1527632 bytes (990167 compressed) at 0x00001000 in 87.3 seconds (effective 140.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin.../esptool.py   --port /dev/ttyUSB0 write_flash -z 0x1000   ~/esp32/firmware/esp32spiram-20230405-unstable-v1.19.1-1008-gc046b23ea.bin
esptool.py v4.6-dev
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 40:22:d8:06:f5:58
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00175fff...
Compressed 1527632 bytes to 990167...
Wrote 1527632 bytes (990167 compressed) at 0x00001000 in 87.3 seconds (effective 140.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

== with --trace:

esptool.py v4.6-dev
Serial port /dev/ttyUSB0
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.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.003 Read 1 bytes: c0
TRACE +0.000 Read 31 bytes: 
    0108040007122055 00000000c0c00108 | ...... U........
    0400071220550000 0000c0c0010804   | .... U.........
TRACE +0.000 Received full packet: 010804000712205500000000
TRACE +0.000 Received full packet: 010804000712205500000000
TRACE +0.003 Read 1 bytes: 00
TRACE +0.000 Read 31 bytes: 
    0712205500000000 c0c0010804000712 | .. U............
    205500000000c0c0 01080400071220   |  U............ 
TRACE +0.000 Received full packet: 010804000712205500000000
TRACE +0.000 Received full packet: 010804000712205500000000
TRACE +0.003 Read 1 bytes: 55
TRACE +0.000 Read 31 bytes: 
    00000000c0c00108 0400071220550000 | ............ U..
    0000c0c001080400 07122055000000   | .......... U...
TRACE +0.000 Received full packet: 010804000712205500000000
TRACE +0.000 Received full packet: 010804000712205500000000
TRACE +0.003 Read 1 bytes: 00
TRACE +0.000 Read 15 bytes: c0c0010804000712205500000000c0
TRACE +0.000 Received full packet: 010804000712205500000000
TRACE +0.000 Received full packet: 010804000712205500000000

Detecting chip type...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.004 Read 1 bytes: c0
TRACE +0.000 Read 31 bytes: 
    0108040007122055 01050000c0c00108 | ...... U........
    0400071220550105 0000c0c0010804   | .... U.........
TRACE +0.000 Received full packet: 010804000712205501050000
 Unsupported detection protocol, switching and trying again...
Connecting...TRACE +0.156 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.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.007 Read 1 bytes: c0
TRACE +0.000 Read 31 bytes: 
    0108040007205555 00000000c0c00108 | ..... UU........
    0400072055550000 0000c0c0010804   | ... UU.........
TRACE +0.000 Received full packet: 010804000720555500000000
TRACE +0.000 Received full packet: 010804000720555500000000
TRACE +0.003 Read 1 bytes: 00
TRACE +0.000 Read 31 bytes: 
    0720555500000000 c0c0010804000720 | . UU........... 
    555500000000c0c0 01080400072055   | UU........... U
TRACE +0.000 Received full packet: 010804000720555500000000
TRACE +0.000 Received full packet: 010804000720555500000000
TRACE +0.003 Read 1 bytes: 55
TRACE +0.000 Read 31 bytes: 
    00000000c0c00108 0400072055550000 | ........... UU..
    0000c0c001080400 07205555000000   | ......... UU...
TRACE +0.000 Received full packet: 010804000720555500000000
TRACE +0.000 Received full packet: 010804000720555500000000
TRACE +0.003 Read 1 bytes: 00
TRACE +0.000 Read 15 bytes: c0c0010804000720555500000000c0
TRACE +0.000 Received full packet: 010804000720555500000000
TRACE +0.000 Received full packet: 010804000720555500000000

Detecting chip type...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.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400831df00000000000c0
TRACE +0.000 Received full packet: 010a0400831df00000000000
 ESP32
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=0ca0f53f
TRACE +0.000 Write 14 bytes: c0000a0400000000000ca0f53fc0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a040000a0000000000000c0
TRACE +0.000 Received full packet: 010a040000a0000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=0ca0f53f
TRACE +0.000 Write 14 bytes: c0000a0400000000000ca0f53fc0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a040000a0000000000000c0
TRACE +0.000 Received full packet: 010a040000a0000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=14a0f53f
TRACE +0.000 Write 14 bytes: c0000a04000000000014a0f53fc0
TRACE +0.005 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=7c60f63f
TRACE +0.000 Write 14 bytes: c0000a0400000000007c60f63fc0
TRACE +0.004 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000020041600000000c0
TRACE +0.000 Received full packet: 010a04000020041600000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=14a0f53f
TRACE +0.000 Write 14 bytes: c0000a04000000000014a0f53fc0
TRACE +0.005 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=0ca0f53f
TRACE +0.000 Write 14 bytes: c0000a0400000000000ca0f53fc0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a040000a0000000000000c0
TRACE +0.000 Received full packet: 010a040000a0000000000000
Chip is ESP32-D0WDQ6 (revision v1.0)
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=0ca0f53f
TRACE +0.000 Write 14 bytes: c0000a0400000000000ca0f53fc0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a040000a0000000000000c0
TRACE +0.000 Received full packet: 010a040000a0000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=0ca0f53f
TRACE +0.000 Write 14 bytes: c0000a0400000000000ca0f53fc0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a040000a0000000000000c0
TRACE +0.000 Received full packet: 010a040000a0000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=10a0f53f
TRACE +0.000 Write 14 bytes: c0000a04000000000010a0f53fc0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04003511000000000000c0
TRACE +0.000 Received full packet: 010a04003511000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=18a0f53f
TRACE +0.000 Write 14 bytes: c0000a04000000000018a0f53fc0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000400000000000000c0
TRACE +0.000 Received full packet: 010a04000400000000000000
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=1400f43f
TRACE +0.000 Write 14 bytes: c0000a0400000000001400f43fc0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04006301000000000000c0
TRACE +0.000 Received full packet: 010a04006301000000000000
Crystal is 40MHz
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=08a0f53f
TRACE +0.000 Write 14 bytes: c0000a04000000000008a0f53fc0
TRACE +0.004 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04002240bd0000000000c0
TRACE +0.000 Received full packet: 010a04002240bd0000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=04a0f53f
TRACE +0.000 Write 14 bytes: c0000a04000000000004a0f53fc0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a040058f506d800000000c0
TRACE +0.000 Received full packet: 010a040058f506d800000000
MAC: 40:22:d8:06:f5:58
Uploading stub...
TRACE +0.000 command op=0x05 data len=16 wait_response=1 timeout=3.000 data=580d0000010000000018000000e00b40
TRACE +0.000 Write 26 bytes: 
    c000051000000000 00580d0000010000 | .........X......
    000018000000e00b 40c0             | ........@.
TRACE +0.006 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 0105040058f506d800000000c0
TRACE +0.000 Received full packet: 0105040058f506d800000000
TRACE +0.000 command op=0x07 data len=3432 wait_response=1 timeout=3.000 data=
    580d000000000000 0000000000000000 | X...............
    0800f43f1c00f43f 0000f43f00c0fc3f | ...?...?...?...?
    1000f43f36410021 faffc02000380241 | ...?6A.!... .8.A
    f9ffc02000280420 20749ce206050000 | ... .(.  t......
    0041f5ff81f6ffc0 2000a8048808a0a0 | .A...... .......
    74e008000b226602 e786f4ff21f1ffc0 | t...."f.....!...
    200039021df00000 a0ebfd3f186bfd3f |  .9........?.k.?
    8480000040400000 58abfd3fa4ebfd3f | ....@@..X..?...?
    364100b1f9ff20a0 74101120a5c70096 | 6A.... .t.. ....
    1a0681f6ff92a101 9099119a98c02000 | .............. .
    b80991f3ffa0a074 9a88c02000921800 | .......t... ....
    9090f41bc9c0c0f4 c02000c258009a9b | ......... ..X...

<output is too long for github :( >

    eeb4f23fdbdc52d4 9ba9ff7d5881c86d | ...?..R....}X..m
    6bd474875544509b 9d0e4727b779af03 | k.t.UDP...G'.y..
    08f1df239236fac1 91f00175b7b6634a | ...#.6.....u..cJ
    daf22617137915de 93e2f538b6534586 | ..&..y.....8.SE.
    23c6528c4431939a 5a4d7114257d2c49 | #.R.D1..ZMq.%},I
    e51f2d5a233c4b59 6ce87729fac5e7f4 | ..-Z#<KYl.w)....
    9724df2549b19b51 1a081bd69e9314e5 | .$.%I..Q........
    1aae299c951069fe 1f92a3cb2ffaff82 | ..)...i...../...
    3ef093963bc6f8af 24a2b05d9a45d9b4 | >...;...$..].E..
    5aeabb9fef7ebefb f9eee7bb9fef7ebe | Z....~........~.
    fbf9fffbe7b3d19f dfdf9df3e70d8e9a | ................
    671dab36479c38d3 dbdd9c5f91fcab87 | g..6G.8...._....
    9cbec9c18943675f dff2bf01f3be3857 | .....Cg_......8W
    c0                                | .
TRACE +0.631 Read 1 bytes: c0
TRACE +0.000 Read 8 bytes: 0111020000000000
TRACE +0.002 Read 1 bytes: 00
TRACE +0.000 Read 2 bytes: 00c0
TRACE +0.000 Received full packet: 01110200000000000000
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.079 Read 1 bytes: c0
TRACE +0.000 Read 11 bytes: 010a0200831df0000000c0
TRACE +0.000 Received full packet: 010a0200831df0000000
Wrote 1527632 bytes (990167 compressed) at 0x00001000 in 88.2 seconds (effective 138.6 kbit/s)...
TRACE +0.000 command op=0x13 data len=16 wait_response=1 timeout=12.221 data=00100000504f17000000000000000000
TRACE +0.000 Write 26 bytes: 
    c000131000000000 0000100000504f17 | .............PO.
    0000000000000000 00c0             | ..........
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 8 bytes: 0113120000000000
TRACE +2.010 Read 1 bytes: 23
TRACE +0.000 Read 18 bytes: 
    99265b37917ee67e a1dc08dccbda4000 | .&[7.~.~......@.
    00c0                              | ..
TRACE +0.000 Received full packet: 
    0113120000000000 2399265b37917ee6 | ........#.&[7.~.
    7ea1dc08dccbda40 0000             | ~......@..
Hash of data verified.

Leaving...
TRACE +0.000 command op=0x02 data len=16 wait_response=1 timeout=3.000 data=00000000000000000040000000000000
TRACE +0.000 Write 26 bytes: 
    c000021000000000 0000000000000000 | ................
    0000400000000000 00c0             | ..@.......
TRACE +0.006 Read 1 bytes: c0
TRACE +0.000 Read 11 bytes: 01020200000000000000c0
TRACE +0.000 Received full packet: 01020200000000000000
TRACE +0.000 command op=0x12 data len=4 wait_response=1 timeout=3.000 data=01000000
TRACE +0.000 Write 14 bytes: c0001204000000000001000000c0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 11 bytes: 01120200000000000000c0
TRACE +0.000 Received full packet: 01120200000000000000
Hard resetting via RTS pin...

More Information

It does not seem specific to this board at all.

Other Steps to Reproduce

No response

I Have Read the Troubleshooting Guide

dobairoland commented 1 year ago

I'm sorry but I don't get it what is wrong. The output seems normal to me.

jouellnyc commented 1 year ago

Hi @dobairoland

I'm terribly sorry. I entered this in error!

radimkarnis commented 1 year ago

@jouellnyc so can this ticket be closed or will you provide another log?