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

Flashing ESP32 S3 doesn't work #6

Closed
glowingkitty opened this issue Apr 25, 2023 · 4 comments
Closed

Flashing ESP32 S3 doesn't work #6

glowingkitty opened this issue Apr 25, 2023 · 4 comments

Comments

@glowingkitty
Copy link

With my ESP32 S3 based board I keep getting the error that the boot button needs to be pressed. But flashing the firmware via VScode + Platform.io works without problems (without pressing any buttons). Any idea how to adapt the web installer config to make this work? also asking for my own open source fork of the web installer.

@blazoncek
Copy link
Collaborator

Is this still valid?

@glowingkitty
Copy link
Author

glowingkitty commented Oct 19, 2023

So... it's complicated. Haven't been working on this issue again for a while. But I was definitely able at some point to create my own web installer + compile the ESP32 S3 firmware successfully + merge the firmware with the boot loader and other files + install the merged firmware via the web installer (based on the WLED web installer/ ESP web installer) without issues. And the result firmware is still available (0.16.0) on my web installer: https://install.glowingkitty.com/)

But not I am unable to reproduce it and compile/merge new firmwares. The problem isn't the web installer code, but the way I merge the firmware file with the other files.

I also noticed that I had two different commands stored in my projects for merging firmware files - and I tested both and both result in the same problem: once I flash the firmware via the web installer, the filesystem will be broken and one cannot write files to it (result in WLED showing an error warning, and one cannot write presets, configs and so on.

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x420e4ec2
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fce3808,len:0x39c
load:0x403c9700,len:0x9bc
load:0x403cc700,len:0x28dc
SHA-256 comparison failed:
Calculated: c5363a2135d3e51105f4bf97223e4fc1f023847bd7c619a56255b443828ddd3f
Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Attempting to boot anyway...
entry 0x403c98c0
./components/esp_littlefs/src/littlefs/lfs.c:1071:error: Corrupted dir pair at {0x0, 0x1}
E (11) esp_littlefs: mount failed,  (-84)
E (11) esp_littlefs: Failed to initialize LittleFS
./components/esp_littlefs/src/littlefs/lfs.c:1790:debug: Bad block at 0x0
./components/esp_littlefs/src/littlefs/lfs.c:1796:warn: Superblock 0x0 has become unwritable
E (1444) esp_littlefs: Failed to format filesystem
./components/esp_littlefs/src/littlefs/lfs.c:1071:error: Corrupted dir pair at {0x0, 0x1}
./components/esp_littlefs/src/littlefs/lfs.c:1071:error: Corrupted dir pair at {0x0, 0x1}

Here are the two base commands I used (executed via python):

cmd = f"python3 -m esptool --chip ESP32-S3 merge_bin -o {temp_folder}/{env}/{env}__glowos_{version}_merged.bin --flash_mode dio --flash_size 8MB 0x0000 {bootloader_folder}/esp32s3/bin/bootloader_dio_80m.bin 0x8000 {temp_folder}/{env}/partitions.bin 0xe000 {boot_app_folder}/partitions/boot_app0.bin 0x10000 {temp_folder}/{env}/firmware.bin"
        subprocess.run(cmd.split())

and including spiffs.bin:

cmd = f"python3 -m esptool --chip ESP32-S3 merge_bin -o {temp_folder}/{env}/{env}__glowos_{version}_merged.bin --flash_mode dio --flash_size 8MB 0x0000 {bootloader_folder}/esp32s3/bin/bootloader_dio_80m.bin 0x8000 {temp_folder}/{env}/partitions.bin 0xe000 {boot_app_folder}/partitions/boot_app0.bin 0x10000 {temp_folder}/{env}/firmware.bin 0x410000 {temp_folder}/{env}/spiffs.bin"
        subprocess.run(cmd.split())

Any ideas how to bugfix this?

@blazoncek
Copy link
Collaborator

The question is if there is any issue with WLED web installer (http://install.wled.me) or not.
Not if your fork has issues after you changed the code.

I have tried the web installer and so far no issues in entering upload mode were observed.

@softhack007
Copy link
Collaborator

softhack007 commented Apr 13, 2024

This issue is now handled in #22 - we are trying to update the web installer to handle the most common configurations of s3/s2/c3. Unfortunately -S3 is a special beast, due to the high number of possible configurations that require their own firmware and bootloader.

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

No branches or pull requests

3 participants