File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -825,16 +825,26 @@ impl Flasher {
825825 & mut self ,
826826 addr : u32 ,
827827 data : & [ u8 ] ,
828- mut progress : Option < & mut dyn ProgressCallbacks > ,
828+ progress : Option < & mut dyn ProgressCallbacks > ,
829829 ) -> Result < ( ) , Error > {
830830 let segment = RomSegment {
831831 addr,
832832 data : Cow :: from ( data) ,
833833 } ;
834+ self . write_bins_to_flash ( & [ segment] , progress)
835+ }
834836
837+ /// Load multiple bin images to flash at specific addresses
838+ pub fn write_bins_to_flash (
839+ & mut self ,
840+ segments : & [ RomSegment ] ,
841+ mut progress : Option < & mut dyn ProgressCallbacks > ,
842+ ) -> Result < ( ) , Error > {
835843 let mut target = self . chip . flash_target ( self . spi_params , self . use_stub ) ;
836844 target. begin ( & mut self . connection ) . flashing ( ) ?;
837- target. write_segment ( & mut self . connection , segment, & mut progress) ?;
845+ for segment in segments {
846+ target. write_segment ( & mut self . connection , segment. borrow ( ) , & mut progress) ?;
847+ }
838848 target. finish ( & mut self . connection , true ) . flashing ( ) ?;
839849
840850 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments