jamesmunns / pretty-hal-machine

Apache License 2.0
59 stars 7 forks source link

PHM Workers can get stuck in an endless loop on protocol errors #26

Open jamesmunns opened 2 years ago

jamesmunns commented 2 years ago

Not all e-h impls are super robust in error cases, and can sometimes end up waiting "forever" in error states. I've observed this with the nrf52840 acting as an I2C controller, with a mis-configured peripheral. The CLI times out, as the worker never responds (it's still waiting for the end of the I2C receive).

We should do (at least) one of the following to improve robustness:

Ideally, all HALs would be more robust, but this is probably a reasonable workaround for now. This may also cause odd errors, as the serialport will probably detach in the case of soft resets.