Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/rp2_common/hardware_flash/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void __no_inline_not_in_flash_func(flash_range_program)(uint32_t flash_offs, con
//-----------------------------------------------------------------------------
// Lower-level flash access functions

#if !PICO_NO_FLASH
#if !PICO_NO_FLASH || PICO_INCLUDE_FLASH_UTILS
// Bitbanging the chip select using IO overrides, in case RAM-resident IRQs
// are still running, and the FIFO bottoms out. (the bootrom does the same)
static void __no_inline_not_in_flash_func(flash_cs_force)(bool high) {
Expand Down Expand Up @@ -334,7 +334,7 @@ void __no_inline_not_in_flash_func(flash_do_cmd)(const uint8_t *txbuf, uint8_t *
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_INCLUDE_FLASH_UTILS
__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_INCLUDE_FLASH_UTILS, Force inclusion of flash functions in PICO_NO_FLASH binaries. Has no effect in flash binaries, type=bool, default=0, group=hardware_flash
#ifndef PICO_INCLUDE_FLASH_UTILS
#define PICO_INCLUDE_FLASH_UTILS 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_INCLUDE_FLASH_UTILS
// 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