@@ -975,7 +975,7 @@ impl CrosEc {
975975 if !dry_run {
976976 let res = self . write_ec_flash_chunk ( addr + offset as u32 , chunk) ;
977977 if let Err ( err) = res {
978- println ! ( " Failed to write chunk: {:?}" , err) ;
978+ eprintln ! ( " Failed to write chunk: {:?}" , err) ;
979979 return Err ( err) ;
980980 }
981981 }
@@ -1062,7 +1062,7 @@ impl CrosEc {
10621062 // TODO: We don't want to crash here. But returning no data doesn't seem optimal
10631063 // either
10641064 // return Err(EcError::DeviceError("Execution interrupted".to_string()));
1065- println ! ( "Execution interrupted" ) ;
1065+ eprintln ! ( "Execution interrupted" ) ;
10661066 return Ok ( vec ! [ ] ) ;
10671067 }
10681068
@@ -1142,15 +1142,15 @@ impl CrosEc {
11421142 // TODO: Does zephyr always start like this?
11431143 let zephyr_start = [ 0x5E , 0x4D , 0x3B , 0x2A ] ;
11441144 if data[ 0 ..4 ] != legacy_start && data[ 0 ..4 ] != zephyr_start {
1145- println ! ( " INVALID start" ) ;
1145+ eprintln ! ( " INVALID start" ) ;
11461146 res = Err ( EcError :: DeviceError ( "INVALID start" . to_string ( ) ) ) ;
11471147 }
11481148 // Legacy EC is all 0xFF until the end of the row
11491149 // Zephyr EC I'm not quite sure but it has a section of 0x00
11501150 let legacy_comp = !data[ 4 ..] . iter ( ) . all ( |x| * x == 0xFF ) ;
11511151 let zephyr_comp = !data[ 0x20 ..0x40 ] . iter ( ) . all ( |x| * x == 0x00 ) ;
11521152 if legacy_comp && zephyr_comp {
1153- println ! ( " INVALID end" ) ;
1153+ eprintln ! ( " INVALID end" ) ;
11541154 res = Err ( EcError :: DeviceError ( "INVALID end" . to_string ( ) ) ) ;
11551155 }
11561156
@@ -1175,13 +1175,13 @@ impl CrosEc {
11751175 // let legacy_start = []; // TODO
11761176 // let zephyr_start = [0x80, 0x7D, 0x0C, 0x20];
11771177 // if data[0..4] != legacy_start && data[0..4] != zephyr_start {
1178- // println !(" INVALID start");
1178+ // eprintln !(" INVALID start");
11791179 // res = Err(EcError::DeviceError("INVALID start".to_string()));
11801180 // }
11811181 // let legacy_comp = !data[4..].iter().all(|x| *x == 0xFF);
11821182 // let zephyr_comp = !data[0x20..0x2C].iter().all(|x| *x == 0x00);
11831183 // if legacy_comp && zephyr_comp {
1184- // println !(" INVALID end");
1184+ // eprintln !(" INVALID end");
11851185 // res = Err(EcError::DeviceError("INVALID end".to_string()));
11861186 // }
11871187
@@ -1224,7 +1224,7 @@ impl CrosEc {
12241224 println ! ( " Erased flash flags" ) ;
12251225 res = Err ( EcError :: DeviceError ( "Erased flash flags" . to_string ( ) ) ) ;
12261226 } else {
1227- println ! ( " INVALID flash flags: {:02X?}" , & data[ 0 ..12 ] ) ;
1227+ eprintln ! ( " INVALID flash flags: {:02X?}" , & data[ 0 ..12 ] ) ;
12281228 // TODO: Disable error until I confirm flash flags on MEC
12291229 // res = Err(EcError::DeviceError("INVALID flash flags".to_string()));
12301230 }
0 commit comments