Is there a hidden option (aka "something I overlooked) to use use `app-flash` when using ota partitions?
Background: I'm using `idf.py app-flash` / `Ctl-T Ctl-A` in the serial monitor during development to speed up firmware flashing. Unfortunately, when I'm testing OTA, `app-flash` flashes to the `factory` partition, but the reboot will take place into an OTA partition. I'm aware I _could_ call `erase_otadata` to perform the next reboot from the factory partition, but I'd prefer avoiding the additional step: either a command that resets ota_data automatically, or just flashes the app into the next ota partition and updates ota_data to boot from there.
Any pointers? If this doesn't exist, would the IDF team be open for a patch?
Sorry if this is redundant: I'm having a bit of difficulty searching for this, I think both the forum and github issues don't handle '-' dashes well or, more likely, I'm an idiot.
app-flash and ota
-
- Posts: 190
- Joined: Wed Jan 24, 2018 6:51 am
Re: app-flash and ota
Hello,
Your understanding is correct and if you erase otadata partition then device shall bootup from factory partition again. Underlying `idf.py app-flash` is esptool based command itself and hence you can directly use esptool "write_flash" based command with appropriate flash offset to write firmware to desired partition. Please refer to https://docs.espressif.com/projects/esp ... rite-flash for underlying command related help.
Alternate approach to follow policy similar to OTA updates (appropriate slot based write, update of otadata partition) shall add additional complexity at tooling level (IMO).
Hope this helps, please feel free to raise any additional questions!
Thanks.
Your understanding is correct and if you erase otadata partition then device shall bootup from factory partition again. Underlying `idf.py app-flash` is esptool based command itself and hence you can directly use esptool "write_flash" based command with appropriate flash offset to write firmware to desired partition. Please refer to https://docs.espressif.com/projects/esp ... rite-flash for underlying command related help.
One option is to combine both commands as:either a command that resets ota_data automatically, or just flashes the app into the next ota partition and updates ota_data to boot from there
Code: Select all
idf.py erase-otadata app-flash
Hope this helps, please feel free to raise any additional questions!
Thanks.
Mahavir
https://github.com/mahavirj/
https://github.com/mahavirj/
Re: app-flash and ota
Thanks, Mahavirm, excellent answer!
Have to admit that I am lazy and was looking for a single command or, better yet, keyboard shortcut in `monitor`. Maybe I'll try my luck at putting that together.
I think I'll experiment with leaving out the factory partition enitrely. From the docs it sounds like app-flash would flash to ota if no factory partition exists. I never really saw the point in having three potential app partitions anyway ... (Not a question, just thinking out loud)
Have to admit that I am lazy and was looking for a single command or, better yet, keyboard shortcut in `monitor`. Maybe I'll try my luck at putting that together.
I think I'll experiment with leaving out the factory partition enitrely. From the docs it sounds like app-flash would flash to ota if no factory partition exists. I never really saw the point in having three potential app partitions anyway ... (Not a question, just thinking out loud)
Who is online
Users browsing this forum: Majestic-12 [Bot], ok-home and 78 guests