Jason2866 / ESP_Flasher

Tasmota Flasher for ESP8266 and ESP32x
MIT License
190 stars 24 forks source link

XIAO ESP32-C6 gives: "Unexpected error: Error while writing flash: Packet content transfer stopped (received 2 bytes)" #52

Closed mi-hol closed 1 month ago

mi-hol commented 1 month ago

I'm new to the world of ESP32 and bought a Seeed Studio XIAO ESP32C6 with 4Mb flash. Tried to flash on Windows 11 (winver details below).

  1. tried to flash "released Tasmota for 4MB Flash (english)" using WebInstaller but that was hanging at 15% complete
  2. tried to flash this Tasmota C6 image using ESP_Flasher but this gave the error msg in title

I found a possibly related case here but couldn't make sense out of it as several topics got mixed there :(

Any suggestion how to get over this hurdle?

Details from Tasmota ESP_Flasher 3.0.3:

Console:

Using 'COM3' as serial port.
Unexpected error: could not open port 'COM3': PermissionError(13, 'Access is denied.', None, 5)

Progress window:

Using 'COM3' as serial port.
Connecting...
Detecting chip type... ESP32-C6
Connecting...

Chip Info:
 - Chip Family: ESP32
 - Chip Model: ESP32-C6FH4 (QFN32) (revision v0.1)
 - Number of Cores: 1
 - Max CPU Frequency: 80MHz
 - Has Bluetooth: YES
 - Has Embedded Flash: NO
 - Has Factory-Calibrated ADC: NO
 - MAC Address: F0:F5:BD:2C:F8:CC
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 1500000
Changed.
 - Flash Size: 4MB
Creating esp32c6 image...
Successfully created esp32c6 image.
Erasing flash (this may take a while)...
Chip erase completed successfully in 15.0s
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000d2fff...
Flash will be erased from 0x000e0000 to 0x002d9fff...
Compressed 13280 bytes to 9048...
Writing at 0x00000000... (100 %)
Wrote 13280 bytes (9048 compressed) at 0x00000000 in 0.2 seconds (effective 497.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 134...
Writing at 0x00008000... (100 %)
Unexpected error: Error while writing flash: Packet content transfer stopped (received 2 bytes)

Windows 11 details: image

mi-hol commented 1 month ago

Update: My first unsuccessful attempt was with Chrome-based browser Vivaldi 6.9.3447.44 (Stable channel) (64-bit)

Success was achieved using Chrome 128.0.6613.138 (Official Build) (64-bit) image

And after closing all Browser windows with ESP_Flasher too!

`Using 'COM5' as serial port. Connecting... Detecting chip type... ESP32-C6 Connecting...

Chip Info:

Leaving... Hard Resetting... Hard resetting via RTS pin... Done! Flashing is complete!

Showing logs: [13:57:37]00:00:00.160 SER: Set to 8N1 115200 bit/s [13:57:37]00:00:00.160 SER: HWCDC supports 115200 bit/s only [13:57:37]00:00:00.162 QPC: Reset [13:57:37]00:00:00.467 BRY: Berry initialized, RAM used 5548 bytes [13:57:37]00:00:00.474 Project tasmota - Tasmota Version 14.2.0.4(717bc01-tasmota32)-3_0_4(2024-09-17T19:51:07) [13:57:38]00:00:00.864 WIF: WifiManager active for 3 minutes [13:57:39]00:00:01.400 HTP: Web server active on tasmota-2CF8C8-7724 with IP address 192.168.4.1 [13:57:42] [13:57:42] [13:57:42]Core 0 register dump: [13:57:42]MEPC : 0x40806d18 RA : 0x420bac06 SP : 0x408227b0 GP : 0x4080e2c4
[13:57:42]TP : 0x40789be8 T0 : 0x420babde T1 : 0x40809bd6 T2 : 0x00000000
[13:57:42]S0/FP : 0x408176e8 S1 : 0x00000001 A0 : 0x00000001 A1 : 0x000000fe
[13:57:42]A2 : 0x00000008 A3 : 0x00000040 A4 : 0x4081e000 A5 : 0x00000000
[13:57:42]A6 : 0x00000000 A7 : 0x00000000 S2 : 0x408176e8 S3 : 0x4081e000
[13:57:42]S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
[13:57:42]S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
[13:57:42]T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
[13:57:42]MSTATUS : 0x40821da8 MTVEC : 0x4081793c MCAUSE : 0x4081e000 MTVAL : 0x4214e162
[13:57:42]MHARTID : 0x00000000
[13:57:42] [13:57:42]Stack memory: [13:57:42]408227b0: 0x40821da8 0x4081793c 0x4081e000 0x4214e162 0x00000000 0x00000000 0x00000000 0x00000000 [13:57:42]408227d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 [13:57:42]408227f0: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 [13:57:42]40822810: 0x00000160 0xabba1234 0x00000154 0x40822730 0x2371ae2e 0x40817994 0x40817994 0x4082281c [13:57:42]40822830: 0x4081798c 0x00000019 0x4f575ccd 0x8b46d7d5 0x4082281c 0x00000000 0x00000000 0x40821f0c [13:57:42]40822850: 0x454c4449 0xdac52800 0x10758c39 0x00047c52 0x00000000 0x40822800 0x00000000 0x00000000 [13:57:42]40822870: 0x00000000 0x00000000 0x00000000 0x4081e52c 0x4081e594 0x4081e5fc 0x00000000 0x00000000 [13:57:42]40822890: 0x00000001 0x00000000 0x00000000 0x00000000 0x4214017e 0x00000000 0x00000000 0x00000000 [13:57:42]408228b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 [13:57:42]408228d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 [13:57:42]408228f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 [13:57:42]40822910: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 [13:57:42]40822930: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 [13:57:42]40822950: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xff000200 [13:57:42]40822970: 0xbaad5678 0x0000080c 0xabba1234 0x00000800 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x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42]40822ad0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 [13:57:42]40822af0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 [13:57:42]40822b10: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 [13:57:42]40822b30: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 [13:57:42]40822b50: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 [13:57:42]40822b70: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 [13:57:42]40822b90: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 [13:57:42] [13:57:42] [13:57:42] [13:57:42]ELF file SHA256: bf26f8e8c5505955 [13:57:42] [13:57:42]Rebooting... [13:57:42]ESP-ROM:esp32c6-20220919 [13:57:42]Build:Sep 19 2022 [13:57:42]rst:0xc (SW_CPU),boot:0x1e (SPI_FAST_FLASH_BOOT) [13:57:42]Saved PC:0x4001975a [13:57:42]SPIWP:0xee [13:57:42]mode:DIO, clock div:2 [13:57:42]load:0x4086c000,len:0xf80 [13:57:42]load:0x4086e610,len:0x21f8 [13:57:42]load:0x40875610,len:0x210 [13:57:43]entry 0x4086c410 [13:57:43] [13:57:43]00:00:00.000 CMD: Using USB CDC [13:57:43]00:00:00.001 HDW: ESP32-C6FH4 v0.1 [13:57:43]00:00:00.006 UFS: FlashFS mounted with 308 kB free [13:57:43]00:00:00.012 CFG: Loaded from File, Count 3 [13:57:43]00:00:00.014 SER: Set to 8N1 115200 bit/s [13:57:43]00:00:00.014 SER: HWCDC supports 115200 bit/s only [13:57:43]00:00:00.015 FRC: Some settings have been reset (2) [13:57:43]00:00:00.320 BRY: Berry initialized, RAM used 5548 bytes [13:57:43]00:00:00.326 Project tasmota - Tasmota Version 14.2.0.4(717bc01-tasmota32)-3_0_4(2024-09-17T19:51:07) [13:57:43]00:00:00.578 WIF: WifiManager active for 3 minutes [13:57:44]00:00:01.258 HTP: Web server active on tasmota-2CF8C8-7724 with IP address 192.168.4.1 `

mi-hol commented 1 month ago

Suspected root cause of error:

I had left the Vivaldi Browser Window open before I started ESP_Flasher! Likely WebInstaller window interferes with ESP_Flasher

  1. Maybe this little detail should be mentioned in ReadMe?
  2. Maybe the code could check for other processes accessing the same COM port as ESP_Flasher?
Jason2866 commented 1 month ago

The check is there. See your log.

Using 'COM3' as serial port.
Unexpected error: could not open port 'COM3': PermissionError(13, 'Access is denied.', None, 5)

Clearly says could not open port 'COM3'

mi-hol commented 1 month ago

Clearly says could not open port 'COM3'

right, but from the message the necessary action to fix issue is not clear to a new user. This is the part I tried to express via "Maybe this little detail should be mentioned in ReadMe?"