-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for extra power cycle between firmware flashes on Linux platforms #6
base: main
Are you sure you want to change the base?
Conversation
Also, for context on why it failed to load the firmware before - The bootloader would never actually enter the flashing stage as the loader would give up early due to falsely assuming the bootloader update step failed. (verify_resp(ser, BootloaderResponseCode.StartUpdate) fails) The null char being sent in the first place is likely due to some driver-specific weirdness between linux and window/mac's serial drivers. When you replug the board, the bootloader will respond with the sequence '0x0 0x1 0x2 0x3' to indicate it's ready for the next flash step. However, when you just reset the board after it's already plugged in, you can receive the stream '0x0 0x1 0x0 0x2 0x3'. The loader mistakenly reads that '0x0' char after the '0x1' as an error code (in verify_resp), however this isn't actually an error and is the result of linux serial driver weirdness. |
Updated based on feedback to continue waiting while serial timeouts are received. "Kyle Scaplen: |
@dtwalter approved |
The fix in this PR allows firmware loading to complete, but won't fix further communications over the serial device, which can be witnessed with |
The actual issue seems to be pyserial reconfiguring the serial device in ways that cause reads to the device to immediately exit if no data is in the buffer. |
A bit of testing shows that when opening the serial device, setting |
Resolves the issue where on Linux, the firmware can't be loaded onto the board unless a load is attempted, the board is power cycled (and replugged), and then loaded again (first reported by WPI).