@@ -290,7 +290,7 @@ struct RunnerOptions {
290
290
///
291
291
/// Each runner supports its own set of boards:
292
292
/// - Host doesn't have a notion of board.
293
- /// - Nordic supports ` devkit` (default) and `dongle` .
293
+ /// - Nordic supports devkit (default), dongle, and makerdiary .
294
294
/// - OpenTitan doesn't have a notion of board yet.
295
295
#[ clap( long) ]
296
296
board : Option < String > ,
@@ -340,6 +340,9 @@ enum RunnerCommand {
340
340
#[ derive( clap:: Args ) ]
341
341
struct Flash {
342
342
/// Resets the flash before running.
343
+ ///
344
+ /// This is not supported by the following boards:
345
+ /// - Nordic: dongle and makerdiary
343
346
#[ clap( long) ]
344
347
reset_flash : bool ,
345
348
@@ -803,14 +806,14 @@ impl RunnerOptions {
803
806
// TODO(https://github.com/rust-lang/rust/issues/122105): Remove when fixed.
804
807
cargo. env ( "RUSTFLAGS" , "--allow=unused-crate-dependencies" ) ;
805
808
cmd:: execute ( & mut cargo) . await ?;
806
- if board == "dongle" {
809
+ if matches ! ( board, "dongle" | "makerdiary" ) {
807
810
let runner = self . bundle ( & elf, side) . await ?;
808
811
let bootloader = "target/thumbv7em-none-eabi/release/bootloader" ;
809
812
let mut objcopy = wrap_command ( ) . await ?;
810
813
objcopy. args ( [ "rust-objcopy" , bootloader] ) ;
811
814
objcopy. arg ( format ! ( "--update-section=.runner={runner}" ) ) ;
812
815
cmd:: execute ( & mut objcopy) . await ?;
813
- if flash. dongle_update_support {
816
+ if board == "dongle" && flash. dongle_update_support {
814
817
let mut nrfdfu = wrap_command ( ) . await ?;
815
818
nrfdfu. args ( [ "nrfdfu" , bootloader] ) ;
816
819
cmd:: execute ( & mut nrfdfu) . await ?;
@@ -823,9 +826,18 @@ impl RunnerOptions {
823
826
objcopy. arg ( "--remove-section=.runner" ) ;
824
827
cmd:: execute ( & mut objcopy) . await ?;
825
828
}
826
- let mut nrfdfu = wrap_command ( ) . await ?;
827
- nrfdfu. args ( [ "nrfdfu" , bootloader] ) ;
828
- cmd:: replace ( nrfdfu) ;
829
+ let mut flash = wrap_command ( ) . await ?;
830
+ if board == "dongle" {
831
+ flash. args ( [ "nrfdfu" , bootloader] ) ;
832
+ } else {
833
+ assert_eq ! ( board, "makerdiary" ) ;
834
+ let hex = format ! ( "{bootloader}.hex" ) ;
835
+ let mut objcopy = wrap_command ( ) . await ?;
836
+ objcopy. args ( [ "rust-objcopy" , "--output-target=ihex" , bootloader, & hex] ) ;
837
+ cmd:: execute ( & mut objcopy) . await ?;
838
+ flash. args ( [ "uf2conv.py" , "--family=0xADA52840" , & hex] ) ;
839
+ }
840
+ cmd:: replace ( flash) ;
829
841
}
830
842
}
831
843
if self . name == RunnerName :: OpenTitan {
0 commit comments