Problem with ESP32 active partition after upload

I have a Factory and two OTA partitions.

When I upload from PIO via VSCode, it always uploads to the Factory partition.

It doesn’t however set the active partition to Factory. So if the bootloader is already pointing at an OTA partition (after prevously updating the firmware via OTA) then on reboot it just boots back to the OTA partition and not the new Factory partition…

Is there a way to either tell PIO to upload the current active partition, or to have it upload to Factory but to reset the active partition to Factory from OTA?

I’d like to do this without doing a full erase as I’ve got data in other partitions which I want to keep between flashings.

Thanks

Good catch, you should totally report this to https://github.com/platformio/platform-espressif32/ so that there is maybe an option for it. Maybe some people want to upload to the OTA partition but keep running factory, or vice versa too.

Will do,

Where can I see what flash command/options PIO is executing/using in order to better provide repro steps to them?

Thanks

Project tasks → Advanced → Verbose Upload.

Thanks @maxgerhardt

Reported here: How to set boot partition when writing to flash? · Issue #1266 · platformio/platform-espressif32 · GitHub

@maxgerhardt what are your thoughts on this? How to set boot partition when writing to flash? · Issue #1266 · platformio/platform-espressif32 · GitHub

For me, I want this to happen automatically. Whats the best way to do this?