stm32f4xx-hal icon indicating copy to clipboard operation
stm32f4xx-hal copied to clipboard

No implementation for read/write multiple bytes for SDIO

Open OBRATEN opened this issue 2 years ago • 5 comments

For fat32 crate I need read/write multiple bytes functions, but there are not any, tried to implement them by myself, but lines of code are not public. Asking for implementation for those functions in HAL.

OBRATEN avatar Apr 19 '22 16:04 OBRATEN

Main SDIO related code is in https://github.com/jkristell/sdio-host . Here is only wrapper. Have you asked there?

NOTE. Time to update sdio-host dependency to 0.7

burrbull avatar Apr 19 '22 17:04 burrbull

You can read and write in multiples of "blocks" of 512 bytes with:

pub fn read_block(&mut self, blockaddr: u32, block: &mut [u8; 512]) -> Result<(), Error>;

pub fn write_block(&mut self, blockaddr: u32, block: &[u8; 512]) -> Result<(), Error>;

jkristell avatar Apr 20 '22 05:04 jkristell

You can read and write in multiples of "blocks" of 512 bytes with:

pub fn read_block(&mut self, blockaddr: u32, block: &mut [u8; 512]) -> Result<(), Error>;

pub fn write_block(&mut self, blockaddr: u32, block: &[u8; 512]) -> Result<(), Error>;

There are command for multiple bytes listed in library, but in HAL there are no implementation for it, how do i read/write multiple bytes with this commands? Call them multiple times?

mmmasteri avatar Apr 20 '22 06:04 mmmasteri

I'm not sure what you mean with no implementation? And yes you call them multiple times and with the blockaddress you want to read/write.

Example:

https://github.com/jkristell/feather-f405/blob/master/examples/sd-usb-mass-storage.rs

jkristell avatar Apr 20 '22 06:04 jkristell

I'm not sure what you mean with no implementation? And yes you call them multiple times and with the blockaddress you want to read/write.

Example:

https://github.com/jkristell/feather-f405/blob/master/examples/sd-usb-mass-storage.rs

Thanks for example, im talking about functions from SDIO, that showed in sd example

mmmasteri avatar Apr 20 '22 07:04 mmmasteri