Flash functions in PICO_NO_FLASH binaries #2759

Merged
peterharperuk merged 2 commits from flash_functions_with_pico_no_flash into develop 2026-06-23 08:24:39 -05:00
peterharperuk commented 2025-12-12 07:13:42 -06:00 (Migrated from github.com)

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.

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.
liamfraser (Migrated from github.com) reviewed 2025-12-12 07:13:42 -06:00
peterharperuk commented 2025-12-12 07:15:47 -06:00 (Migrated from github.com)
Needed for this https://github.com/raspberrypi/pico-examples/pull/653
will-v-pi commented 2025-12-12 07:18:58 -06:00 (Migrated from github.com)

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

Probably would be nicer if `PICO_INCLUDE_FLASH_UTILS ` defaulted to `!PICO_NO_FLASH`, rather than needing to check both in all the `#if`s? ``` #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 commented 2025-12-12 07:51:09 -06:00 (Migrated from github.com)

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?

> 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?
will-v-pi commented 2026-05-11 06:19:50 -05:00 (Migrated from github.com)

I've ended up adding the first bit to allow flash_do_cmd in no_flash binaries in my PSRAM PR #2919 - maybe the other half of this would be better expressed as PICO_INCLUDE_FLASH_ID_FUNCTIONS instead?

I've ended up adding the first bit to allow `flash_do_cmd` in no_flash binaries in my PSRAM PR #2919 - maybe the other half of this would be better expressed as `PICO_INCLUDE_FLASH_ID_FUNCTIONS` instead?
kilograham commented 2026-05-16 12:38:05 -05:00 (Migrated from github.com)

can we revisit this now with @will-v-pi referenced changes

can we revisit this now with @will-v-pi referenced changes
peterharperuk commented 2026-06-09 08:44:28 -05:00 (Migrated from github.com)

I've updated this.

I've updated this.
will-v-pi (Migrated from github.com) reviewed 2026-06-09 09:16:30 -05:00
kilograham (Migrated from github.com) requested changes 2026-06-10 10:00:25 -05:00
kilograham (Migrated from github.com) left a comment

i will come back to this - need to think of a better name i think

i will come back to this - need to think of a better name i think
kilograham (Migrated from github.com) requested changes 2026-06-22 08:46:23 -05:00
@ -52,6 +52,11 @@
kilograham (Migrated from github.com) commented 2026-06-22 08:46:17 -05:00
// PICO_CONFIG: PICO_ALWAYS_INCLUDE_FLASH_ID_FUNCTIONS, Force inclusion of flash unique id functionality even in PICO_NO_FLASH binaries, type=bool, default=0, group=hardware_flash
```suggestion // PICO_CONFIG: PICO_ALWAYS_INCLUDE_FLASH_ID_FUNCTIONS, Force inclusion of flash unique id functionality even in PICO_NO_FLASH binaries, type=bool, default=0, group=hardware_flash ```
peterharperuk (Migrated from github.com) reviewed 2026-06-22 11:04:15 -05:00
@ -52,6 +52,11 @@
peterharperuk (Migrated from github.com) commented 2026-06-22 11:04:15 -05:00

done

done
will-v-pi (Migrated from github.com) approved these changes 2026-06-22 11:05:17 -05:00
kilograham (Migrated from github.com) approved these changes 2026-06-23 08:24:31 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!2759
No description provided.