@@ -704,6 +704,7 @@ impl CrosEc {
704
704
/// | 40000 | 3C000 | 39000 | RO Region |
705
705
/// | 79000 | 79FFF | 01000 | Flash Flags |
706
706
pub fn reflash ( & self , data : & [ u8 ] , ft : EcFlashType ) -> EcResult < ( ) > {
707
+ let mut res = Ok ( ( ) ) ;
707
708
if ft == EcFlashType :: Full || ft == EcFlashType :: Ro {
708
709
if let Some ( version) = ec_binary:: read_ec_version ( data, true ) {
709
710
println ! ( "EC RO Version in File: {:?}" , version. version) ;
@@ -753,7 +754,8 @@ impl CrosEc {
753
754
if rw_data == flash_rw_data {
754
755
println ! ( " RW verify success" ) ;
755
756
} else {
756
- println ! ( "RW verify fail" ) ;
757
+ error ! ( "RW verify fail!" ) ;
758
+ res = Err ( EcError :: DeviceError ( "RW verify fail!" . to_string ( ) ) ) ;
757
759
}
758
760
}
759
761
@@ -773,7 +775,8 @@ impl CrosEc {
773
775
if ro_data == flash_ro_data {
774
776
println ! ( " RO verify success" ) ;
775
777
} else {
776
- println ! ( "RO verify fail" ) ;
778
+ error ! ( "RO verify fail!" ) ;
779
+ res = Err ( EcError :: DeviceError ( "RW verify fail!" . to_string ( ) ) ) ;
777
780
}
778
781
}
779
782
@@ -784,7 +787,7 @@ impl CrosEc {
784
787
println ! ( "Flashing EC done. You can reboot the EC now" ) ;
785
788
// TODO: Should we force a reboot if currently running one was reflashed?
786
789
787
- Ok ( ( ) )
790
+ res
788
791
}
789
792
790
793
/// Write a big section of EC flash. Must be unlocked already
0 commit comments