jannic / rp2040-flash

Some helper functions to allow writing to flash from an rp2040 firmware.
18 stars 8 forks source link

Add a function to get the flash UID #7

Closed KizzyCode closed 1 year ago

KizzyCode commented 1 year ago

Would it be possible to add some functionality to get the flash chip's unique ID? Since the RP2040 has no serial number or similar, this is the only possibility to get a unique device identifier for the pico.

The according logic is implemented in https://github.com/raspberrypi/pico-sdk/blob/f396d05f8252d4670d4ea05c8b7ac938ef0cd381/src/rp2_common/hardware_flash/flash.c#L164 As far as I understand, the SDK setups the flash and writes some raw commands via SSI (I'm not sure if this can even be implemented with the ROM functions and the currently available toolset tbh).

jannic commented 1 year ago

This has been implemented in #8, thanks to @pdh11

KizzyCode commented 1 year ago

Awesome, thank you very much! 😁