sim: Show address for overwrite error
When trying to write to the flash to a non-FF location, put the
location of the failure in the error message to help diagnose the
problem.
diff --git a/sim/src/flash.rs b/sim/src/flash.rs
index 83ef771..797a044 100644
--- a/sim/src/flash.rs
+++ b/sim/src/flash.rs
@@ -95,7 +95,7 @@
let mut sub = &mut self.data[offset .. offset + payload.len()];
if sub.iter().any(|x| *x != 0xFF) {
- bail!(ewrite("Write to non-FF location"));
+ bail!(ewrite(format!("Write to non-FF location: offset: {:x}", offset)));
}
sub.copy_from_slice(payload);