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

Flash functions in PICO_NO_FLASH binaries

Open peterharperuk opened this issue 1 month ago • 3 comments

We assume that PICO_NO_FLASH binaries means the device does not have a flash chip. But it's possible that you want a ram binary AND want to mess about with flash, e.g. for flash nuke or something that uses the unique flash id.

Add PICO_INCLUDE_FLASH_UTILS which forces some flash functions to be included.

peterharperuk avatar Dec 12 '25 13:12 peterharperuk

Needed for this https://github.com/raspberrypi/pico-examples/pull/653

peterharperuk avatar Dec 12 '25 13:12 peterharperuk

Probably would be nicer if PICO_INCLUDE_FLASH_UTILS defaulted to !PICO_NO_FLASH, rather than needing to check both in all the #ifs?

#ifndef PICO_INCLUDE_FLASH_UTILS 
#define PICO_INCLUDE_FLASH_UTILS  !PICO_NO_FLASH
#endif

It would also need a PICO_CONFIG comment, so it appears in the docs

will-v-pi avatar Dec 12 '25 13:12 will-v-pi

defaulted to !PICO_NO_FLASH

Then you would be able to remove these functions by setting PICO_INCLUDE_FLASH_UTILS=0 in flash builds. Which will cause odd behaviour?

peterharperuk avatar Dec 12 '25 13:12 peterharperuk