8000 FlashController HIL offset argument usage · Issue #3319 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
FlashController HIL offset argument usage #3319
Closed
@teonaseverin

Description

@teonaseverin

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      BB5
      0