Skip to content

Flash functions in PICO_NO_FLASH binaries#2759

Open
peterharperuk wants to merge 1 commit intoraspberrypi:developfrom
peterharperuk:flash_functions_with_pico_no_flash
Open

Flash functions in PICO_NO_FLASH binaries#2759
peterharperuk wants to merge 1 commit intoraspberrypi:developfrom
peterharperuk:flash_functions_with_pico_no_flash

Conversation

@peterharperuk
Copy link
Copy Markdown
Contributor

@peterharperuk peterharperuk commented Dec 12, 2025

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. something that uses the unique flash id.

Add PICO_INCLUDE_FLASH_FUNCTIONS which forces some flash functions to be included.

@peterharperuk
Copy link
Copy Markdown
Contributor Author

Needed for this raspberrypi/pico-examples#653

@will-v-pi
Copy link
Copy Markdown
Contributor

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

@peterharperuk
Copy link
Copy Markdown
Contributor Author

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 peterharperuk force-pushed the flash_functions_with_pico_no_flash branch 2 times, most recently from e3779f5 to 59aa1e7 Compare December 12, 2025 14:02
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. something that uses the unique flash id.

Add PICO_INCLUDE_FLASH_FUNCTIONS  which forces some flash functions to be
included.

Fixes raspberrypi#2796
@peterharperuk peterharperuk force-pushed the flash_functions_with_pico_no_flash branch from 59aa1e7 to e3087dd Compare January 13, 2026 13:10
@lurch lurch linked an issue Jan 13, 2026 that may be closed by this pull request
@kilograham kilograham added this to the 2.2.1 milestone Mar 2, 2026
@kilograham kilograham self-assigned this Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flash_get_unique_id panic with not supported in no flash builds

4 participants