-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
create safebuild app to fit into factory partition to give ESP32 more flash memory #608
Comments
See https://tasmota.github.io/docs/Safeboot/ and https://github.com/arendst/Tasmota/blob/development/partitions/esp32_partition_app2880k_fs320k.csv for examples. The idea is to create a smaller firmware image that is half the size and fits into 830Kb (it's now 1.9Mb). This could be without the web so only boot up with the telnet console for emergency OTA uploading. |
OTA and uploading emsesp-firmware works only if executed in the small partition and write to the large. |
that's friggin' awesome! you managed to create a bare-bone EMS-ESP with the WebUI. Other than MQTT and the project stuff what else did you have to exclude to fit this into the safe-boot partition? Also what happens when you switch the partition? I've been following and supporting platformio/platform-espressif32#785 (comment) |
I've removed as much as possible, compiled, checked the size and set factory partition to this size (0x14000, it fits also in 0x130000).
If target the partition is flashed, it reboots to to this software, if target partition is blank, esp crashes. |
Crashes only with two ota partitions and one blank, with factory partition and blank ota the reboot fallback to factory, but i've also added some code in loader to avoid rebooting to erased ota-partition. I'd like to add a reboot to EMS-ESP-Loader button(factory partition) to dev now. The button is only shown if a factory partition exists, not in standard ota_0/ota_1 scheme. It helps me testing with official dev and other user do not see it. Also in future we can say v3.5.0b9 and up are able to reboot to factory. Is this ok? |
yes this is good. It's a nice addition. We would need to give bbqkees instructions on how to load the two images |
For the 16MB it is not needed. For C3 with 4MB in very near future. There are two ways:
|
@MichaelDvP I forgot about this. Shall we make this the standard for v3.5.0? So a smaller OTA partition with the stripped EMS-ESP. |
I think as long as it fit's use the sysmetric OTA1/2. For v3.6 you have to decide how to manage. |
v3.5.0 just about fits. For v3.6.0 we'll need a version for the 4MB flashes (when Turkish and Czech languages are added). I've set the milestone to 3.6.0 |
@MichaelDvP could we make this the defacto standard for our next version? It would mean
anything else I missed? |
About the minimal image: About partitions:
First approach was to put loader in factory and add code to v3.5. to reboot to factory partition (if exist). The loader check if the OTA-partiton starts with a reset-vector or is erased to allow reboot to ota-partition (without new writing). Uploading a file writes the partition and reboots to this partition if write was successful. If something goes wrong (wrong chiptype, to large image, etc) the ota is erased and no reset vector is written, so it's not possible to boot to the empty partition. In ems-esp v3.5. reboot to other partition is only possible if this is factory subtype. In this approach we can not update the loader via OTA, only with new USB-flashing. I've tested with with two ota partitions. Then we can write the ems-esp-image from loader and a new loader from ems-esp. This also allows to flash older(<= 3.4.4) images (no button to boot to other partition), because we can upload the loader image and esp32 changes to this partition after upload. But we have to add code to deny a reboot if the small ota-partiton is empty (after trying to upload a full image). This is already implemented since v3.5.1 restartservice.cpp. I think it's all save now.
If you create the repo, i can push or PR the code
You can see it clearly because dashoard/settings/help are missing, maybe change the color of the ems-esp logo to red should be enough.
Do you want to modify the existing ems-esp-flasher to only flash the loader on 4MB esp?. Then we need to add a warning, that flashing v3.5 direct on 4MB is not possible anymore and has to use the loader. (16MB is still symmetric without loader).
to allow the compiler/linker to check size. |
https://github.com/emsesp/EMS-ESP-Loader done. Thanks @MichaelDvP |
Tried to push: Please fetch the code from https://github.com/MichaelDvP/EMS-ESP-Loader then i'll make PRs for future changes. |
Ok, strange though since we should both the same permissions. |
Now it works. Actually there is no build action. Question if we should build esp32, esp32s2 and esp32c3, because these are the chips with 4MB flash. But if users are able to compile the c3 code, they also can compile the loader, so a esp32 bnary should be enough? |
For the loader it's best to keep it as simple as possible.
99.9% will need the ESP32 one. The loader concept may already be hard to
grasp for the non-technical people.
So only the ESP32 bin would suffice here.
For the very few who use S2 or C3 they have to build the firmware
themselves anyway, so they can also build the loader.
Op vr 24 mrt 2023 om 08:50 schreef MichaelDvP ***@***.***>:
… Now it works. Actually there is no build action. Question if we should
build esp32, esp32s2 and esp32c3, because these are the chips with 4MB
flash. But if users are able to compile the c3 code, they also can compile
the loader, so a esp32 bnary should be enough?
—
Reply to this email directly, view it on GitHub
<#608 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACSGZAUQTUDAW4R67KEGI6DW5VG6BANCNFSM57VRCPUA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Originally posted by @MichaelDvP in #22 (comment)
The text was updated successfully, but these errors were encountered: