Repository navigation
fix(uf2): leave DFU on eject on every board and time out an idle mounted drive - #108
Conversation
…ted drive A host eject only left UF2 mode on boards that define `UF2_EXIT_ON_EJECT`, so on every other board the drive re-mounted and the board stayed in DFU. The 6 minute idle exit was also restarted by every UF2 drive read, so a host that keeps reading a mounted volume held the board in DFU indefinitely. An eject now leaves the DFU loop on every board, with the factory-erase path unchanged, and only an accepted UF2 block or a USB mount restarts the idle timer. A board with no valid application still returns to the drive after an eject.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…e idle timer The README still described eject and the idle timer as 2.6.1 behaves. It now states both rules and marks the 2.6.1 and earlier behavior where it differs.
|
Benched on james-pc (Linux, udisks
Not run: macOS, a board with no valid app, and the factory-erase eject path. |
A host eject only left UF2 mode on boards that define
UF2_EXIT_ON_EJECT(t1000_e,mesh_tracker_x1), so on every other board the drive re-mounted and the board stayed in DFU. The 6 minute idle exit was also restarted by every UF2 drive read, so a host that keeps reading a mounted volume (macOS indexing, a remount) could hold a board with a valid application in DFU forever.The flag was added with the single-button boards because they have no reset button to leave by; the history gives no reason to keep it per board, so an eject now leaves the DFU loop everywhere. The factory-erase path is unchanged, and with no valid application
main()still brings the drive back. Only an accepted UF2 block, USB enumeration and BLE or serial traffic restart the idle timer; a copy in progress has already invalidatedbank_0, so it is never cut off.see #106
Testing: built
sensecap_solar_p1,wiscore_rak4631_board,t1000_e,mesh_tracker_x1,heltec_t114andxiao_nrf52840_blewith the repo shell (arm-none-eabi-gcc 13.3, not the CI-pinned 12.3); every image is within 8 B of master and fits its 38 KB region. Benched on a RAK4631 and a T1000-E from Linux (results in the comments); macOS is untested.The README states the new rules and marks what 2.6.1 and earlier do. It overlaps #107 on one line, so whichever merges second needs a rebase.
Summary by CodeRabbit