djthorpe / go-pico

Raspberry Pi RP2040 Pico SDK for golang
https://pkg.go.dev/github.com/djthorpe/go-pico
Apache License 2.0
55 stars 0 forks source link

Flash storage support #1

Open franslundberg opened 1 year ago

franslundberg commented 1 year ago

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

djthorpe commented 1 year ago

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.

franslundberg commented 1 year ago

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

djthorpe commented 1 year ago

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

franslundberg commented 1 year ago

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.

djthorpe commented 1 year ago

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.

franslundberg commented 1 year ago

Thanks for considering this!