Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rp2_common/hardware_flash/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ void __no_inline_not_in_flash_func(flash_do_cmd_cs)(const uint8_t *txbuf, uint8_
static_assert(FLASH_UNIQUE_ID_SIZE_BYTES == FLASH_RUID_DATA_BYTES, "");

void flash_get_unique_id(uint8_t *id_out) {
#if PICO_NO_FLASH
#if PICO_NO_FLASH && !PICO_ALWAYS_INCLUDE_FLASH_ID_FUNCTIONS
__unused uint8_t *ignore = id_out;
panic_unsupported();
#else
Expand Down
5 changes: 5 additions & 0 deletions src/rp2_common/hardware_flash/include/hardware/flash.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@

// PICO_CONFIG: PICO_FLASH_SIZE_BYTES, size of primary flash in bytes, type=int, default=Usually provided via board header, group=hardware_flash

// PICO_CONFIG: PICO_ALWAYS_INCLUDE_FLASH_ID_FUNCTIONS, Force inclusion of flash unique id functionality in PICO_NO_FLASH binaries, type=bool, default=0, group=hardware_flash
#ifndef PICO_ALWAYS_INCLUDE_FLASH_ID_FUNCTIONS
#define PICO_ALWAYS_INCLUDE_FLASH_ID_FUNCTIONS 0
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_unique_id/unique_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static pico_unique_board_id_t retrieved_id;

static void __attribute__((PICO_UNIQUE_BOARD_ID_INIT_ATTRIBUTES)) _retrieve_unique_id_on_boot(void) {
#if PICO_RP2040
#if PICO_NO_FLASH
#if PICO_NO_FLASH && !PICO_ALWAYS_INCLUDE_FLASH_ID_FUNCTIONS
// The hardware_flash call will panic() if called directly on a NO_FLASH
// build. Since this constructor is pre-main it would be annoying to
// debug, so just produce something well-defined and obviously wrong.
Expand Down
Loading