New option: skip to next image via GPIO#19
New option: skip to next image via GPIO#19DutchFox2 wants to merge 3 commits intoraburton:masterfrom
Conversation
The GPIO should be configured as input as early as possible, to minimize current drawn when the pin is driven both by externally and by the ESP.
|
Could you please take a look at the 'test' branch. I've implemented your request (slightly differently), please check it meets your needs before I merge with master. |
|
On 03-09-16 14:05, Richard Antony Burton wrote:
Thanks Richard, I'm glad that you liked the 'skip to next image' idea. I have looked through the diff on Github, your implementation looks fine I'm afraid that I will not have the opportunity to do a real test in my One thing which comes to mind right now is: would other users be helped Kind regards, Matthijs |
Hi Richard,
I have added a new feature to rBoot, because the existing GPIO feature didn't suit my needs. It might be useful to others as well.
Background: I am using rBoot with 2 slots. Firmware updates (downloading and flashing) are performed by the user program, where the active program in slot 0 will flash into slot 1 or vice versa.
In the situation where flashing was succesful (ROM checksum is ok), but the program itself contains a bug, rBoot will keep booting into that new ROM image. If the networking or firmware upgrade code is broken, I'm stuck.
The 'normal' GPIO functionality is no solution here, because it can only boot into a predefined slot. If this slot happens to contain the 'broken' firmware, it doesn't help.
The new option uses GPIO to simply mark the current slot as 'invalid', and lets the existing code search for an other ROM to boot from. In my case, it will find the previous firmware in the other slot, which can be used to re-flash a new (hopefully fixed) image.
Commit f04392b contains the new option mentioned above.
In commit 3c68cc9 I have separated the reading of the GPIO pin from configuring it as an input. In my opinion, the pin should be set as input as early in the boot process as possible, to prevent large currents when the pin is also driven externally. Furthermore, once the pin is configured as an input, there is a lot more time for the voltage at the pin to stabilize at the required level before the pin state is read back.
I couldn't convince Github to exclude bb7421d from the pull request, please ignore it.
Cheers,
Matthijs