Get previous running partition
Posted: Mon Apr 17, 2023 2:21 pm
Hi, we have an aplication where we need to boot from a FACTORY/OTA partition into a TEST partition by reading a GPIO input.
So when, for example, we are on FACTORY, OTA0 or OTA1 and detect the GPIO trigger we set esp_set_boot_partition() to the TEST partition and restart to apply changes.
The problem comes when we are in TEST partition. Again, if the GPIO is triggered the boot partition should be set to the one that was running before. Is there an already implemented way of doing this? How should I do it anyhow?
I'm aware of this: https://docs.espressif.com/projects/esp ... t-firmware
but due to a HW design error that GPIO pin is active high and not active low as this API expects. I supose this cannot be changed(?).
But using this function as an example. From the link I posted I need to implement this functionality myself:
So when, for example, we are on FACTORY, OTA0 or OTA1 and detect the GPIO trigger we set esp_set_boot_partition() to the TEST partition and restart to apply changes.
The problem comes when we are in TEST partition. Again, if the GPIO is triggered the boot partition should be set to the one that was running before. Is there an already implemented way of doing this? How should I do it anyhow?
I'm aware of this: https://docs.espressif.com/projects/esp ... t-firmware
but due to a HW design error that GPIO pin is active high and not active low as this API expects. I supose this cannot be changed(?).
But using this function as an example. From the link I posted I need to implement this functionality myself:
Once the GPIO input is released (allowing it to be pulled up) and the device has been reboot, the normally configured application will boot (factory or any OTA app partition slot).