Reading single bytes from Flash

jumjum123
Posts: 199
Joined: Mon Oct 17, 2016 3:11 pm

Reading single bytes from Flash

Postby jumjum123 » Tue Nov 22, 2016 10:58 am

In my application I've to read single bytes from Flash.
spi_flash_read returns an error if len is set to 1
Is there a better way than reading 4 bytes and masking one of them ?

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Reading single bytes from Flash

Postby ESP_igrr » Tue Nov 22, 2016 2:53 pm

We will fix this limitation of spi_flash_* APIs at some point after 1.0. But internally this will be implemented as a four-byte read which discards unneeded bytes. I don't know of any way to do this without reading at least 4 bytes from flash.

jumjum123
Posts: 199
Joined: Mon Oct 17, 2016 3:11 pm

Re: Reading single bytes from Flash

Postby jumjum123 » Tue Nov 22, 2016 3:33 pm

Thanks a lot for this information.
At least this answer makes me feel better, since the fault is not between my ears :geek:

Who is online

Users browsing this forum: markkuk and 275 guests