Skip to content

Conversation

@peterharperuk
Copy link
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
Contributor Author

@will-v-pi
Copy link
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants