Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8035

SDK • Using flash so that core1 is unaffected

$
0
0
I have a setup where I run hardware emulation in Pico 2 W on core 1 and use core 0 to handle other operation such as Wi-Fi and using the flash memory.

I noticed a while ago that using flash in core 0 with

Code:

    uint32_t ints = save_and_disable_interrupts();    flash_range_erase(flash_offset + media_offset, CHUNK_SIZE);    flash_range_program(flash_offset + media_offset, data, CHUNK_SIZE);    restore_interrupts(ints);
temporarily also pauses/interrupts processing in core 1.

For this, there's another thread in the forum suggesting using target compile definition PICO_FLASH_ASSUME_CORE1_SAFE=1 which should tell the flash_range_* not to interrupt core 1. I've added this to CMakeLists.txt the following way:

Code:

target_compile_definitions(my-target PRIVATE    PICO_FLASH_ASSUME_CORE1_SAFE=1)
However, this doesn't seem to work. Am I missing something here?

I'm launching core 1 with the function multicore_launch_core1(core1_entry); and the all of the functions are prefixed with __no_inline_not_in_flash_func that the core 1 runs.

Statistics: Posted by mrautopu — Tue Jul 08, 2025 12:15 pm



Viewing all articles
Browse latest Browse all 8035

Trending Articles