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
How to set boot partition when writing to flash? #1266
Comments
esptool.py does not set anything regarding boot partitions. |
@Jason2866 so is there a way to set the active partition from the CLI? |
Not an existing easy way. You have to read and modify the otadata partition Edit: There is a Python tool https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/ota.html#python-api https://github.com/espressif/esp-idf/blob/master/components/app_update/otatool.py Should be possible to embed into Platformio |
This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions. |
My device has a factory app partition and two OTA partitions. My partition table looks like this:
Repeatedly flashing new firmware versions works fine:
"C:\.platformio\penv\Scripts\python.exe" "C:\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32 --port "COM10" --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 16MB 0x1000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin
When I use in-app functionality to upload a new firmware OTA and set the boot partition using
esp_ota_set_boot_partition
this works fine.Repeated successive OTA updates also work fine, switching back and forth between
ota_0
andota_1
.If however I then flash a new version via UART using the
esptool.py
, the flash appears to succeed but the active boot partition isn't updated, meaning it boots back to the latest OTA partition.What can I do about this?
My expectation would be that
esptool.py
sets the active boot partition to whereever you're flashing to. For backwards compat I suppose this can be off by default, but regarless, a switch to control this or other command would be great.Thanks
The text was updated successfully, but these errors were encountered: