Bootloader: Selecting app based on GPIO input
Posted: Thu Apr 11, 2024 8:00 am
Hi everyone!
I am currently trying to tackle the following problem: I have two apps installed on my ESP32, e.g., on the factory and ota_0 partitions, and I want to select the app to boot based on the state of some given GPIO pin. I have searched the documentation for options and found the following: Apparently one could install one app in a 'test' partition and then there is some mechanism by which the test partition is booted if some GPIO is set. However, documentation on that is sparse and I did not really understand it. Do I need to overwrite the second stage bootloader (at 0x001000 I think?) to achieve the desired behaviour?
Alternatively, the following would work too: Always boot the factory app and then this app decided on whether to boot the ota_0 app based on the state of a GPIO pin. I did not find anything regard booting one app out of the other, however.
It is very important that the ota_0 app is completely agnostic to this whole process, i.e., that this would work with any binary installed in the ota_0 partition.
This problem feels like a standard problem to me, but I could not find much on the internet. I am still new to the ESP-IDF and I might just be lacking some keyword to look for. Any help is greatly appreciated!
Best,
Hrox
I am currently trying to tackle the following problem: I have two apps installed on my ESP32, e.g., on the factory and ota_0 partitions, and I want to select the app to boot based on the state of some given GPIO pin. I have searched the documentation for options and found the following: Apparently one could install one app in a 'test' partition and then there is some mechanism by which the test partition is booted if some GPIO is set. However, documentation on that is sparse and I did not really understand it. Do I need to overwrite the second stage bootloader (at 0x001000 I think?) to achieve the desired behaviour?
Alternatively, the following would work too: Always boot the factory app and then this app decided on whether to boot the ota_0 app based on the state of a GPIO pin. I did not find anything regard booting one app out of the other, however.
It is very important that the ota_0 app is completely agnostic to this whole process, i.e., that this would work with any binary installed in the ota_0 partition.
This problem feels like a standard problem to me, but I could not find much on the internet. I am still new to the ESP-IDF and I might just be lacking some keyword to look for. Any help is greatly appreciated!
Best,
Hrox