dektronics / printalyzer-densitometer

Reflection and Transmission Densitometer for Photographic Darkroom Use
19 stars 4 forks source link

Device goes into low power mode when restarting after a firmware update #38

Closed dkonigsberg closed 2 years ago

dkonigsberg commented 2 years ago

This issue has been observed on Linux. It has not yet been tested on macOS or Windows, but should be.

When installing a firmware update via the UF2 bootloader, and then restarting into the new firmware image, the device immediately goes into low power mode. This can easily be recovered from by unplugging/replugging the device, and the manual will recommend this just in case. However, this step should not be necessary.

A guess is that something happening on the USB interface is misinterpreted as a trigger for low power mode, however further investigation is needed. Its possible that a fix could involve a special case for a post-update startup.

dkonigsberg commented 2 years ago

So far this was not reproducible on macOS, but the log messages when it happens with a Linux host are a bit concerning:

I/task_main [       376 main] Starting controller loop
I/state_controller [       382 main] State transition: 15 -> 0
I/state_controller [       389 main] State transition: 0 -> 1
D/task_main [       898 usbd] tud_suspend_cb
I/state_controller [       930 main] Notify switch to state: 14
I/state_controller [       937 main] State transition: 1 -> 14
D/task_main [       944 usbd] tud_resume_cb
I/state_suspend [       949 main] Entering suspend state
D/task_sensor [       956 sensor] sensor_control_stop

This pretty much suggests that its a race condition when suspend and resume events happen too close together, so the relationship to firmware updates could only be coincidental. This means its a higher priority issue to resolve.