Conversation
DocMoebiuz
left a comment
There was a problem hiding this comment.
Really cool change. Thanks!
There was a problem hiding this comment.
I think it would make sense to include the nano board json for which this is all done and then we could also call #579 done.
I also would propose to set all other boards' retry value to 1 because we don't expect that a retry is required. So if it fails, it can fail fast
|
Json added, updated retries on the other boards. |
|
Once this merges we'll still need to update the firmware builds to build the nano firmware, update the vs project to include it in desktop builds, and I think that's it? |
Yeah, why not do that and then we can include the .hex file right away with this PR? and then this is really the complete nano support. |
|
i really would like to merge it but without the nano hex file it feels incomplete. |
|
Nano firmware PR: MobiFlight/MobiFlight-FirmwareSource#223 |
…enns/MobiFlight-Connector into multiple-baud-rate-flashing
Fixes #579
This adds support for trying different baud rates when flashing a given board. It is primarily intended to resolve the "which baud rate should we use for a Nano" problem, but is done in a general fashion that could apply to any device that uses avrdude to flash.
Changes include:
-x attemptscommand line parameter. (I pulled the x86 version of avrdude). We need this for nano flashing so we can reduce the attempts from10to1. Otherwise Nano flash failure takes way, way, way too long.TimeoutForFirmwareUpdateproperty in the.board.jsonfile to remove a hard-coded timeout value I missed in the original .board.json implementationAttemptsproperty in the.board.jsonfile to control how many times avrdude should attempt connections to a boardBaudRateproperty toBaudRates(an array) in the.board.jsonfilesMigrate()method on theBoardobject to ensure any random old.board.jsonfiles that might exist will still workRunAvrDude()to use theAttemptsproperty and to loop over theBaudRatesuntil one works. This really is the meat of the change to make this all work and is pretty small.The baud rates are attempted in the order they are listed in the
.board.jsonfile which makes it easy for us to prioritize a given baud rate. For the Nano we'll likely want to list115200first and57600second assuming the new, fast, bootloader is more common.Changes tested by @elral (both old and new Nanos) and Jamie (new Nano) and me (new Nano).