|
|
|
|
|
by londons_explore
2039 days ago
|
|
If the system is well designed, this power cycle should be a rare event (ie. maybe once per year). For that rare event, it doesn't seem worth writing code to power cycle a single USB peripheral (and then write and test all the code to clear the error states at each level of the stack and bring that peripheral back up again). Instead, power cycle the entire system. Have a small hardware watchdog which, when not being tickled, will power off the whole system for 5 seconds and power everything back on. Write code to periodically tickle the hardware watchdog when everything is 100% healthy, or when 3 reboots have happened in short succession (you'd prefer the system up with 90% of the hardware working than bootlooping). |
|