Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors flashing Waveshare ESP32-S3-Touch-LCD-7 (ver1.1) #677

Closed
robert-chiniquy opened this issue Sep 4, 2024 · 16 comments
Closed

Errors flashing Waveshare ESP32-S3-Touch-LCD-7 (ver1.1) #677

robert-chiniquy opened this issue Sep 4, 2024 · 16 comments

Comments

@robert-chiniquy
Copy link

Ran into this MemData error: #637 and, after adding --no-stub, am now getting this FlashDeflData error:

[2024-09-04T21:20:42Z INFO ] Connecting...
Chip type:         esp32s3 (revision v0.2)
Crystal frequency: 40 MHz
Flash size:        8MB
Features:          WiFi, BLE
MAC address:       f0:f5:bd:4b:9f:24
App/part. size:    524,400/1,048,576 bytes, 50.01%
Error:   × The bootloader returned an error
  ├─▶ Error while running FlashDeflData command
  ╰─▶ Other

I've experimented with flash mode, no-reset, and baud rates, running out of ideas.

Thanks!

@robert-chiniquy
Copy link
Author

In case it helps, here's the RUST_LOG=debug output:

[2024-09-04T21:23:25Z INFO ] Connecting...
[2024-09-04T21:23:25Z DEBUG] Using UnixTight reset strategy with delay of 50ms
[2024-09-04T21:23:25Z DEBUG] Boot Mode: 0x0
[2024-09-04T21:23:25Z DEBUG] Download Mode: false
[2024-09-04T21:23:25Z DEBUG] Writing command: Sync
[2024-09-04T21:23:25Z DEBUG] Writing command: Sync
[2024-09-04T21:23:25Z DEBUG] Writing command: ReadReg { address: 1073745920 }
[2024-09-04T21:23:25Z DEBUG] Attempting flash enable with: SpiAttachParams { clk: 0, q: 0, d: 0, hd: 0, cs: 0 }
[2024-09-04T21:23:25Z DEBUG] Writing command: SpiAttach { spi_params: SpiAttachParams { clk: 0, q: 0, d: 0, hd: 0, cs: 0 } }
[2024-09-04T21:23:25Z DEBUG] Writing command: ReadReg { address: 1610620952 }
[2024-09-04T21:23:25Z DEBUG] Writing command: ReadReg { address: 1610620960 }
[2024-09-04T21:23:25Z DEBUG] Writing command: WriteReg { address: 1610620952, value: 2415919104, mask: None }
[2024-09-04T21:23:25Z DEBUG] Writing command: WriteReg { address: 1610620960, value: 1879048351, mask: None }
[2024-09-04T21:23:25Z DEBUG] Writing command: WriteReg { address: 1610620968, value: 23, mask: None }
[2024-09-04T21:23:25Z DEBUG] Writing command: WriteReg { address: 1610621016, value: 0, mask: None }
[2024-09-04T21:23:25Z DEBUG] Writing command: WriteReg { address: 1610620928, value: 262144, mask: None }
[2024-09-04T21:23:25Z DEBUG] Writing command: ReadReg { address: 1610620952 }
[2024-09-04T21:23:25Z DEBUG] Writing command: ReadReg { address: 1610621016 }
[2024-09-04T21:23:25Z DEBUG] Writing command: WriteReg { address: 1610620952, value: 2147483648, mask: None }
[2024-09-04T21:23:25Z DEBUG] Writing command: WriteReg { address: 1610620960, value: 1879048192, mask: None }
[2024-09-04T21:23:26Z DEBUG] Flash detect OK!
[2024-09-04T21:23:26Z DEBUG] Writing command: SpiSetParams { spi_params: SpiSetParams { fl_id: 0, total_size: 8388608, block_size: 65536, sector_size: 4096, page_size: 256, status_mask: 65535 } }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641496 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641496 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641488 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641496 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641488 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641496 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641496 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641488 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641496 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641488 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641476 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641480 }
Chip type:         esp32s3 (revision v0.2)
Crystal frequency: 40 MHz
Flash size:        8MB
Features:          WiFi, BLE
MAC address:       f0:f5:bd:4b:9f:24
[2024-09-04T21:23:26Z DEBUG] Writing command: SpiAttach { spi_params: SpiAttachParams { clk: 0, q: 0, d: 0, hd: 0, cs: 0 } }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641496 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641496 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641488 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641496 }
[2024-09-04T21:23:26Z DEBUG] Writing command: ReadReg { address: 1610641488 }
App/part. size:    524,400/1,048,576 bytes, 50.01%
[2024-09-04T21:23:26Z DEBUG] Writing command: FlashMd5 { offset: 0, size: 21008 }
[2024-09-04T21:23:26Z DEBUG] Writing command: FlashDeflBegin { size: 21008, blocks: 14, block_size: 1024, offset: 0, supports_encryption: true }
[2024-09-04T21:23:26Z DEBUG] Writing command: FlashDeflData { data: [120, 218, 173, 123, 11, 124, 19, 85, 214, 248, 157, 201, 163, 105, 58, 64, 250, 32, 22, 168, 56, 73, 73, 105, 145, 98, 218, 2, 45, 8, 75, 82, 106, 161, 8, 90, 42, 20, 68, 252, 72, 218, 78, 104, 177, 47, 218, 148, 215, 118, 215, 76, 171, 37, 69, 248, 182, 45, 238, 210, 186, 184, 59, 19, 141, 20, 86, 62, 74, 125, 33, 218, 181, 97, 181, 139, 10, 44, 160, 174, 168, 176, 86, 52, 174, 242, 146, 85, 250, 72, 31, 153, 255, 185, 51, 105, 41, 8, 174, 251, 125, 127, 126, 156, 204, 220, 115, 239, 61, 247, 220, 123, 206, 61, 247, 156, 115, 167, 223, 202, 73, 90, 213, 52, 199, 116, 5, 33, 20, 12, 128, 114, 241, 15, 34, 34, 83, 78, 204, 235, 213, 34, 36, 192, 191, 9, 128, 192, 16, 21, 128, 216, 76, 57, 234, 157, 44, 67, 4, 110, 121, 149, 176, 224, 135, 28, 64, 1, 160, 4, 8, 2, 48, 151, 151, 51, 101, 118, 218, 102, 45, 40, 100, 242, 232, 130, 98, 218, 80, 62, 21, 96, 182, 33, 143, 142, 53, 148, 199, 141, 82, 35, 107, 78, 73, 153, 61, 54, 142, 222, 104, 45, 167, 115, 173, 133, 184, 153, 213, 78, 103, 206, 167, 141, 155, 12, 198, 148, 77, 208, 34, 167, 164, 196, 142, 38, 60, 98, 188, 55, 41, 161, 232, 62, 232, 86, 88, 17, 135, 73, 208, 133, 37, 214, 60, 186, 212, 90, 102, 47, 176, 23, 148, 20, 211, 118, 107, 78, 33, 67, 51, 101, 101, 37, 101, 58, 104, 93, 164, 70, 116, 65, 57, 93, 92, 98, 167, 49, 1, 92, 121, 43, 34, 233, 214, 92, 123, 73, 217, 102, 218, 90, 90, 122, 157, 150, 161, 92, 34, 240, 19, 237, 237, 76, 185, 253, 103, 119, 122, 112, 153, 249, 198, 182, 116, 121, 33, 240, 101, 200, 187, 161, 79, 98, 81, 198, 136, 62, 105, 5, 229, 192, 115, 65, 241, 90, 58, 235, 129, 5, 52, 99, 45, 43, 220, 76, 51, 197, 246, 178, 146, 210, 205, 116, 121, 73, 69, 89, 46, 51, 109, 218, 52, 169, 119, 90, 214, 131, 75, 110, 53, 108, 70, 145, 117, 45, 67, 231, 150, 20, 219, 173, 5, 197, 229, 116, 81, 69, 161, 189, 160, 20, 214, 200, 80, 78, 151, 51, 107, 139, 128, 90, 249, 52, 250, 193, 98, 32, 108, 207, 103, 232, 66, 43, 204, 168, 164, 152, 161, 55, 22, 20, 22, 210, 57, 12, 93, 4, 44, 51, 121, 129, 49, 50, 134, 199, 184, 145, 205, 197, 32, 4, 44, 50, 152, 157, 173, 172, 164, 104, 196, 20, 65, 138, 37, 54, 91, 57, 99, 199, 146, 220, 116, 219, 181, 185, 15, 11, 12, 107, 198, 198, 178, 2, 59, 179, 6, 36, 149, 103, 181, 91, 233, 146, 82, 166, 204, 138, 233, 76, 195, 34, 165, 231, 222, 76, 228, 70, 46, 30, 130, 81, 64, 48, 21, 214, 66, 26, 8, 172, 41, 103, 214, 207, 133, 58, 76, 53, 64, 239, 17, 227, 163, 183, 229, 0, 171, 7, 214, 37, 166, 108, 77, 17, 204, 57, 22, 70, 42, 220, 52, 149, 22, 31, 113, 1, 213, 149, 58, 103, 165, 211, 152, 24, 26, 18, 62, 90, 81, 144, 94, 32, 161, 30, 200, 126, 136, 126, 140, 217, 92, 142, 24, 91, 69, 57, 131, 150, 23, 63, 86, 92, 178, 177, 88, 170, 195, 226, 23, 95, 134, 176, 184, 107, 64, 39, 144, 237, 186, 2, 162, 10, 169, 254, 103, 50, 41, 241, 120, 19, 139, 183, 84, 89, 113, 243, 217, 75, 232, 13, 76, 89, 129, 109, 243, 205, 123, 230, 182, 171, 154, 57, 220, 110, 25, 110, 55, 251, 182, 13, 163, 163, 233, 197, 214, 28, 166, 144, 30, 241, 111, 121, 57, 86, 190, 225, 127, 203, 54, 151, 50, 244, 67, 203, 232, 7, 37, 149, 160, 233, 197, 76, 241, 90, 123, 254, 109, 73, 26, 18, 243, 104, 67, 124, 194, 204, 242, 161, 95, 99, 226, 166, 161, 159, 148, 194, 192, 239, 109, 123, 223, 87, 156, 7, 202, 247, 19, 19, 189, 113, 133, 176, 206, 20, 20, 219, 74, 70, 110, 208, 130, 45, 176, 81, 176, 14, 149, 195, 202, 149, 208, 229, 69, 96, 155, 232, 216, 162, 130, 226, 130, 162, 138, 34, 216, 186, 116, 206, 102, 80, 131, 184, 219, 239, 95, 198, 102, 197, 27, 14, 54, 48, 172, 252, 144, 148, 11, 240, 150, 188, 109, 159, 7, 110, 106, 56, 149, 182, 151, 109, 198, 20, 176, 178, 24, 127, 138, 125, 81, 191, 70, 176, 95, 80, 188, 193, 90, 88, 144, 55, 21, 232, 21, 138, 70, 36, 199, 154, 251, 216, 8, 70, 254, 23, 180, 104, 43, 44, 106, 241, 48, 133, 169, 146, 157, 176, 99, 213, 133, 231, 112, 243, 219, 91, 65, 152, 221, 144, 37, 150, 204, 231, 200, 33, 68, 19, 116, 123, 121, 37, 21, 173, 184, 65, 163, 111, 156, 212, 176, 49, 134, 51, 164, 4, 219, 179, 225, 113, 134, 41, 254, 44, 174, 110, 176, 209, 229, 63, 201, 149, 13, 204, 101, 254, 26, 92, 85, 126, 43, 170, 215, 251, 24, 242, 134, 23, 48, 126, 132, 65, 4, 21, 22, 85, 76, 122, 101, 54, 229, 50, 76, 94, 57, 45, 82, 165, 115, 243, 11, 74, 71, 212, 222, 254, 88, 193, 83, 197, 22, 123, 73, 218, 12, 232, 196, 228, 62, 86, 14, 170, 9, 10, 11, 203, 83, 178, 241, 39, 44, 66, 70, 113, 110, 73, 89, 25, 147, 107, 191, 161, 231, 109, 155, 223, 114, 50, 160, 159, 5, 185, 116, 113, 69, 81, 14, 83, 246, 211, 22, 254, 230, 35, 58, 223, 138, 143, 101, 16, 90, 25, 236, 38, 171, 184, 67, 240, 193, 6, 26, 133, 15, 107, 145, 186, 68, 139, 41, 47, 93, 35, 238, 131, 91, 81], pad_to: 0, pad_byte: 255, sequence: 0 }
Error:   × The bootloader returned an error
  ├─▶ Error while running FlashDeflData command
  ╰─▶ Other

@SergioGasquez
Copy link
Member

Hi! Which espflash version are you using? Have you tried using esptool or espflash@2.1?

@robert-chiniquy
Copy link
Author

I've been using espflash@3.1.1, I'll see if I can try 2.1.

@robert-chiniquy
Copy link
Author

2.1 looks the same except FlashDeflData is FlashDeflateData.

@robert-chiniquy
Copy link
Author

With esptool.py 4.7.0, I can't find a way to disable use of a stub, so this may not be helpful, but:

Connecting....
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_3v3)
Crystal is 40MHz
MAC: f0:f5:bd:4b:9f:24
Uploading stub...

A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)

@SergioGasquez
Copy link
Member

With esptool.py 4.7.0, I can't find a way to disable use of a stub, so this may not be helpful, but:

There is also a --no-stub flag: https://docs.espressif.com/projects/esptool/en/latest/esp32/esptool/flasher-stub.html#disabling-the-stub-loader

@robert-chiniquy
Copy link
Author

Ah thank you, I don't know how I missed that.

I'm still checking my work, maybe my offsets are wrong? With lower baud rates I just get a timeout. The cable is known good, I can flash all my other boards with it. But these are the errors I'm currently encountering with esptool:

# espflash board-info  --no-stub
[2024-09-06T16:05:14Z INFO ] 🚀 A new version of espflash is available: v3.1.1
[2024-09-06T16:05:14Z INFO ] Detected 4 serial ports
[2024-09-06T16:05:14Z INFO ] Ports which match a known common dev board are highlighted
[2024-09-06T16:05:14Z INFO ] Please select a port
[2024-09-06T16:05:15Z INFO ] Serial port: '/dev/cu.usbmodem58750032371'
[2024-09-06T16:05:15Z INFO ] Connecting...
Chip type:         esp32s3 (revision v0.2)
Crystal frequency: 40MHz
Flash size:        8MB
Features:          WiFi, BLE
MAC address:       f0:f5:bd:4b:9f:24

# esptool.py --no-stub --chip esp32s3 --port /dev/cu.usbmodem58750032371 --baud 57600 write_flash \
 0x1000 target/xtensa-esp32s3-espidf/release/bootloader.bin \
 0x8000 target/xtensa-esp32s3-espidf/release/partition-table.bin \
 0x10000 target/xtensa-esp32s3-espidf/release/try-esplash.bin
esptool.py v4.7.0
Serial port /dev/cu.usbmodem58750032371
Connecting....
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_3v3)
Crystal is 40MHz
MAC: f0:f5:bd:4b:9f:24
Enabling default SPI flash mode...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x00072fff...
Erasing flash...
Took 0.09s to erase flash block
Writing at 0x00001000... (4 %)
A fatal error occurred: Failed to write to target Flash after seq 0 (result was 01050000: Requested resource not found)

# esptool.py --chip esp32s3 --port /dev/cu.usbmodem58750032371 --baud 57600 write_flash \
 0x1000 target/xtensa-esp32s3-espidf/release/bootloader.bin \
 0x8000 target/xtensa-esp32s3-espidf/release/partition-table.bin \
 0x10000 target/xtensa-esp32s3-espidf/release/try-esplash.bin
esptool.py v4.7.0
Serial port /dev/cu.usbmodem58750032371
Connecting....
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_3v3)
Crystal is 40MHz
MAC: f0:f5:bd:4b:9f:24
Uploading stub...

A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)

@SergioGasquez
Copy link
Member

I'm still checking my work, maybe my offsets are wrong?

Try using the following offsets https://docs.espressif.com/projects/esptool/en/latest/esp32s3/esptool/flashing-firmware.html?highlight=0x8000#id1 (bootloader at 0x0, partition table a 0x8000 and app at 0x10000)

@robert-chiniquy
Copy link
Author

esptool.py --no-stub --chip esp32s3 --port /dev/cu.usbmodem58750032371 --baud 57600 write_flash \
 0x0000 target/xtensa-esp32s3-espidf/release/bootloader.bin \
 0x8000 target/xtensa-esp32s3-espidf/release/partition-table.bin \
 0x10000 target/xtensa-esp32s3-espidf/release/try-esplash.bin
esptool.py v4.7.0
Serial port /dev/cu.usbmodem58750032371
Connecting....
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_3v3)
Crystal is 40MHz
MAC: f0:f5:bd:4b:9f:24
Enabling default SPI flash mode...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x00072fff...
Erasing flash...
Took 0.09s to erase flash block
Writing at 0x00000000... (4 %)
A fatal error occurred: Failed to write to target Flash after seq 0 (result was 01050000: Requested resource not found)

@SergioGasquez
Copy link
Member

Do you have any other devkit to try? The fact that both esptool and espflash fail makes me think it might be a hw thing.

@robert-chiniquy
Copy link
Author

robert-chiniquy commented Sep 10, 2024

I have many dev kits ;) but not of this exact one.

I had kind of thought that because it came flashed with the demo firmware, that that proved that with the correct parameters / method, this specific board could be flashed.

@JihoonJustin
Copy link

Hi I have a same problem

@robert-chiniquy
Copy link
Author

I think this is a pretty cool board, so I could get another one to try to verify if it is a hw issue with the original. LMK if that would help.

@JihoonJustin
Copy link

@robert-chiniquy But I used to use this board with other system (Ubuntu), Now I am trying to develop on MacOS.

@JihoonJustin
Copy link

I resolved this problem on mac. I have installed usb driver.
https://github.com/WCHSoftGroup/ch34xser_macos

@robert-chiniquy
Copy link
Author

Thank you. I was able to install those drivers and it did fix my issue. A new serial device was visible.

Definitely wish the installers weren't at an http:// link.

But thank you everybody for the help! I'm sorry I didn't figure this one out on my own!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants