-
-
Notifications
You must be signed in to change notification settings - Fork 422
Easier recovery from soft bricked native USB boards #2173
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
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@ ## master #2173 +/- ## ========================================== + Coverage 62.61% 62.64% +0.03% ========================================== Files 223 223 Lines 19489 19498 +9 ========================================== + Hits 12203 12215 +12 + Misses 6200 6198 -2 + Partials 1086 1085 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
CLI 0.32.2:
❰umberto❙~/Downloads/arduino-cli_test-2173-c626c5af87608b229e9993ddc68e60f59ee8d65d-git-snapshot_Linux_64bit❱✔≻ arduino-cli compile -b arduino:avr:micro -u soft_brick/ -p /dev/ttyACM0
Sketch uses 3464 bytes (12%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.
Programmer supports the following devices:
Device code: 0x44
Used platform Version Path
arduino:avr 1.8.6 /home/umberto/.arduino15/packages/arduino/hardware/avr/1.8.6
❰umberto❙~/Downloads/arduino-cli_test-2173-c626c5af87608b229e9993ddc68e60f59ee8d65d-git-snapshot_Linux_64bit❱✔≻ ./arduino-cli board list
Port Protocol Type Board Name FQBN Core
/dev/ttyUSB0 serial Serial Port (USB) Unknown
❰umberto❙~/Downloads/arduino-cli_test-2173-c626c5af87608b229e9993ddc68e60f59ee8d65d-git-snapshot_Linux_64bit❱✔≻ arduino-cli compile -b arduino:avr:micro /opt/arduino-1.8.13/examples/01.Basics/Blink/Blink.ino -u
Sketch uses 3958 bytes (13%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Error during Upload: Failed uploading: no upload port provided
CLI from this PR:
./arduino-cli compile -b arduino:avr:micro -u soft_brick/ -p /dev/ttyACM0
Sketch uses 3464 bytes (12%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.
Programmer supports the following devices:
Device code: 0x44
Used platform Version Path
arduino:avr 1.8.6 /home/umberto/.arduino15/packages/arduino/hardware/avr/1.8.6
❰umberto❙~/Downloads/arduino-cli_test-2173-c626c5af87608b229e9993ddc68e60f59ee8d65d-git-snapshot_Linux_64bit❱✔≻ ./arduino-cli board list
Port Protocol Type Board Name FQBN Core
/dev/ttyUSB0 serial Serial Port (USB) Unknown
❰umberto❙~/Downloads/arduino-cli_test-2173-c626c5af87608b229e9993ddc68e60f59ee8d65d-git-snapshot_Linux_64bit❱✔≻ ./arduino-cli compile -b arduino:avr:micro /opt/arduino-1.8.13/examples/01.Basics/Blink/Blink.ino -u
Sketch uses 3958 bytes (13%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Skipping 1200-bps touch reset: no serial port selected!
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.
Programmer supports the following devices:
Device code: 0x44
Used platform Version Path
arduino:avr 1.8.6 /home/umberto/.arduino15/packages/arduino/hardware/avr/1.8.6
7e8cc09
to
cbdb3b0
Compare
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
This PR should make it easier to recover from soft-bricked boards with native USB (in cases where the serial port is unavailable because the bootloader has a too-short timeout).
What is the current behavior?
Trying the upload without a port selected would cause the upload to immediately fail, without leaving any room for the user to synchronize with the upload by tapping the reset button. See #1943 for more details.
What is the new behavior?
The upload should wait a reasonable amount of time for the user to tap the reset button and make the bootloader avaiable.
Does this PR introduce a breaking change, and is titled accordingly?
No, in theory...
Other information
Fix #1943