We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b135fa commit 0d26c5eCopy full SHA for 0d26c5e
cores/rp2040/flash_wrapper.cpp
@@ -26,11 +26,11 @@
26
27
#if defined(PICO_RP2350) && defined(RP2350_PSRAM_CS)
28
static void __no_inline_not_in_flash_func(flushcache)() {
29
- for (volatile uint8_t* cache = (volatile uint8_t*)0x18000001; cache < (volatile uint8_t*)(0x18000001 + 2048 * 8); cache += 8) {
30
- *cache = 0;
31
- __compiler_memory_barrier();
32
- *(cache - 1) = 0;
33
+ // From https://forums.raspberrypi.com/viewtopic.php?t=378249#p2263677
+ // Perform clean-by-set/way on all lines
+ for (uint32_t i = 0; i < 2048; ++i) {
+ // Use the upper 16k of the maintenance space (0x1bffc000 through 0x1bffffff):
+ *(volatile uint8_t*)(XIP_SRAM_BASE + (XIP_MAINTENANCE_BASE - XIP_BASE) + i * 8u + 0x1u) = 0;
34
}
35
36
#elif defined(PICO_RP2350)
0 commit comments