Closed
Description
We are trying to implement the FlashController HIL for a flash driver on a stm32f429
device and we were wondering what the role of the offset
argument in the FlashController::read_region
function is. Is it possible to read data from anywhere in the memory and not just the start of a region/sector?
@alistair, I saw that you implemented most of the tests. I was curious if, for example the implementation at line 434 in the file libraries/tickv/src/tests.rs
doesn’t overflow, if the offset
argument is different than 0.
fn read_region(
&self,
region_number: usize,
offset: usize,
buf: &mut [u8; 256],
) -> Result<(), ErrorCode> {
println!("Read from region: {}", region_number);
for (i, b) in buf.iter_mut().enumerate() {
*b = self.buf.borrow()[region_number][offset + i]
}
Ok(())
}
Maybe it’s something we misunderstood.
Metadata
Metadata
Assignees
Labels
No labels