Repository navigation
Conversation
4e15553 to
05e43a4
Compare
Proper power sequencing with VBATT and VBUS supplies that can be switched on and off can be tricky, especially for production devices that use a battery rather than a 12v supply. Add the ability to define a custom button sequence to reset a device, this is necessary rather than hard-coding because the exact behaviour can vary wildly on different devices. Document this in the README and provide an example. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Some especially fun devices take an inconsistent amount of time to enter fastboot mode. To avoid the reset sequence being longer than necessary, add a callback from the udev monitor to release the fastboot key when the board has been detected in fastboot. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
For devices that must be reset with button presses, the dev-loop can be sped up significantly by having these devices remain in fastboot when not under test. Implement support for this by forking cdba-server on exit and performing the reset sequence. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
| } else if (!strcmp(key, "reset_sequence")) { | ||
| parse_reset_sequence(dev, value); | ||
| } else if (!strcmp(key, "release_key_on_fastboot_detect")) { | ||
| dev->release_key_on_fastboot_detect = true; |
There was a problem hiding this comment.
Main question: shouldn't this be a default behaviour? IOW, is there a reason to hold fastboot key longer than necessary?
There was a problem hiding this comment.
I don't think so no, currently it just holds the fastboot key for 1 second which is enough for dev boards but on some production devices they haven't actually reached the fastboot detection point yet.
I'll make it the default.
|
pressing RESIN+PWR for n seconds (n = no more than like 10 or 15, i think it maaaaaay be configurable?) guarantees a hard reset |
|
Generic question: for me this looks like a perfect usecase for external scripts, which would specify particular behaviour for the board. |
@konradybcio the issue is if you hold for too long then you end up getting to fastboot and triggering the first fastboot option which gets everything confused XD |
|
I hooked up my pico to control the enable pin of the buck converter I have as a battery replacement, this makes all the button wrangling unecessary as I can just erase the boot partition and the devices always boot straight to fastboot mode. There is maybe some value in this PR for someone else, but given the amount of finesse necessary to get this to work reliably, I'm not gonna stick with it... See #33 |
Where hard power-sequencing is not available, do the next best thing and soft-reset the board via a button combination. As this behaviour isn't consistent between platforms, allow defining a custom reset sequence, as well as holding down the fastboot key until the device is actually detected in fastboot mode.
Deprecates #10