Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion framework_lib/src/capsule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub fn dump_winux_image(data: &[u8], header: &DisplayCapsule, filename: &str) {
{
let ret = crate::uefi::fs::shell_write_file(filename, image);
if let Err(err) = ret {
println!("Failed to dump winux image: {:?}", err);
eprintln!("Failed to dump winux image: {:?}", err);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions framework_lib/src/ccgx/hid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ pub fn flash_firmware(fw_binary: &[u8]) {
let versions = if let Some(versions) = ccgx::binary::read_versions(fw_binary, SiliconId::Ccg3) {
versions
} else {
println!("Incompatible firmware. Need CCG3 firmware.");
eprintln!("Incompatible firmware. Need CCG3 firmware.");
return;
};

Expand All @@ -302,7 +302,7 @@ pub fn flash_firmware(fw_binary: &[u8]) {
} else if util::find_sequence(fw_binary, dp_string).is_some() {
[DP_CARD_PID]
} else {
println!("Incompatible firmware. Need DP/HDMI Expansion Card Firmware.");
eprintln!("Incompatible firmware. Need DP/HDMI Expansion Card Firmware.");
return;
};

Expand All @@ -319,7 +319,7 @@ pub fn flash_firmware(fw_binary: &[u8]) {
let mut api = HidApi::new().unwrap();
let devices = find_devices(&api, &filter_devs, None);
if devices.is_empty() {
println!("No compatible Expansion Card connected");
eprintln!("No compatible Expansion Card connected");
return;
};
for dev_info in devices {
Expand Down
2 changes: 1 addition & 1 deletion framework_lib/src/ccgx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ fn parse_metadata_cyacd2(buffer: &[u8]) -> Option<(u32, u32)> {
if metadata.metadata_version == 1 {
Some((metadata.fw_start, metadata.fw_size))
} else {
println!("Unknown CCG8 metadata version");
eprintln!("Unknown CCG8 metadata version");
None
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion framework_lib/src/chromium_ec/cros_ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn init() {
return;
}
match std::fs::File::open(DEV_PATH) {
Err(why) => println!("Failed to open {}. Because: {:?}", DEV_PATH, why),
Err(why) => eprintln!("Failed to open {}. Because: {:?}", DEV_PATH, why),
Ok(file) => *device = Some(file),
};
// 2. Read max 80 bytes and check if equal to "1.0.0"
Expand Down
16 changes: 8 additions & 8 deletions framework_lib/src/chromium_ec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ impl CrosEc {
if !dry_run {
let res = self.write_ec_flash_chunk(addr + offset as u32, chunk);
if let Err(err) = res {
println!(" Failed to write chunk: {:?}", err);
eprintln!(" Failed to write chunk: {:?}", err);
return Err(err);
}
}
Expand Down Expand Up @@ -942,7 +942,7 @@ impl CrosEc {
// TODO: We don't want to crash here. But returning no data doesn't seem optimal
// either
// return Err(EcError::DeviceError("Execution interrupted".to_string()));
println!("Execution interrupted");
eprintln!("Execution interrupted");
return Ok(vec![]);
}

Expand Down Expand Up @@ -1022,15 +1022,15 @@ impl CrosEc {
// TODO: Does zephyr always start like this?
let zephyr_start = [0x5E, 0x4D, 0x3B, 0x2A];
if data[0..4] != legacy_start && data[0..4] != zephyr_start {
println!(" INVALID start");
eprintln!(" INVALID start");
res = Err(EcError::DeviceError("INVALID start".to_string()));
}
// Legacy EC is all 0xFF until the end of the row
// Zephyr EC I'm not quite sure but it has a section of 0x00
let legacy_comp = !data[4..].iter().all(|x| *x == 0xFF);
let zephyr_comp = !data[0x20..0x40].iter().all(|x| *x == 0x00);
if legacy_comp && zephyr_comp {
println!(" INVALID end");
eprintln!(" INVALID end");
res = Err(EcError::DeviceError("INVALID end".to_string()));
}

Expand All @@ -1055,13 +1055,13 @@ impl CrosEc {
// let legacy_start = []; // TODO
// let zephyr_start = [0x80, 0x7D, 0x0C, 0x20];
// if data[0..4] != legacy_start && data[0..4] != zephyr_start {
// println!(" INVALID start");
// eprintln!(" INVALID start");
// res = Err(EcError::DeviceError("INVALID start".to_string()));
// }
// let legacy_comp = !data[4..].iter().all(|x| *x == 0xFF);
// let zephyr_comp = !data[0x20..0x2C].iter().all(|x| *x == 0x00);
// if legacy_comp && zephyr_comp {
// println!(" INVALID end");
// eprintln!(" INVALID end");
// res = Err(EcError::DeviceError("INVALID end".to_string()));
// }

Expand Down Expand Up @@ -1104,7 +1104,7 @@ impl CrosEc {
println!(" Erased flash flags");
res = Err(EcError::DeviceError("Erased flash flags".to_string()));
} else {
println!(" INVALID flash flags: {:02X?}", &data[0..12]);
eprintln!(" INVALID flash flags: {:02X?}", &data[0..12]);
// TODO: Disable error until I confirm flash flags on MEC
// res = Err(EcError::DeviceError("INVALID flash flags".to_string()));
}
Expand Down Expand Up @@ -1248,7 +1248,7 @@ impl CrosEc {
// Don't read too fast, wait 100ms before writing more to allow for page erase/write cycle.
os_specific::sleep(100_000);
if let Err(err) = res {
println!(" Failed to write chunk: {:?}", err);
eprintln!(" Failed to write chunk: {:?}", err);
return Err(err);
}
}
Expand Down
6 changes: 3 additions & 3 deletions framework_lib/src/chromium_ec/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ fn init() -> bool {
| Some(platform @ Platform::IntelGen13)
| Some(platform @ Platform::Framework13Amd7080)
| Some(platform @ Platform::Framework16Amd7080) => {
println!("The windows driver is not enabled on {:?}.", platform);
println!("Please stay tuned for future BIOS and driver updates.");
println!();
eprintln!("The windows driver is not enabled on {:?}.", platform);
eprintln!("Please stay tuned for future BIOS and driver updates.");
eprintln!();
}
_ => (),
}
Expand Down
Loading