go-pico icon indicating copy to clipboard operation
go-pico copied to clipboard

Flash storage support

Open franslundberg opened this issue 2 years ago • 6 comments

FEATURE REQUEST: Support for storage to the Winbond W25Q16JV flash on the Pico board.

franslundberg avatar Nov 19 '22 08:11 franslundberg

Hi Frans, do you mean, you want the following functions implemented from https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_flash/include/hardware/flash.h

void flash_range_erase(uint32_t flash_offs, size_t count);
void flash_range_program(uint32_t flash_offs, const uint8_t *data, size_t count);
void flash_get_unique_id(uint8_t *id_out);
void flash_do_cmd(const uint8_t *txbuf, uint8_t *rxbuf, size_t count);

Thanks for any comments you can provide.

djthorpe avatar Nov 19 '22 14:11 djthorpe

Yes, exactly! They are implemented in flash.c. But the code there is beyond my comprehension.

franslundberg avatar Nov 20 '22 13:11 franslundberg

That code is pretty low-level. Which of those functions do you need and I will take a look?

djthorpe avatar Nov 20 '22 14:11 djthorpe

Prio 1: The flash_range_erase() and flash_range_program() are required to have useful storage on the flash. The others are nice-to-have.

franslundberg avatar Nov 20 '22 17:11 franslundberg

Ok Thanks Frans. I have quite a few other basic features to do first (SPI, I2C, PIO) but I'll let you know when I have researched this one to see if it's possible.

djthorpe avatar Nov 21 '22 08:11 djthorpe

Thanks for considering this!

franslundberg avatar Nov 21 '22 09:11 franslundberg