Skip to content

Commit 45b462e

Browse files
committed
ports/rp2: PSRAM: Fix RP2040/Pico build.
Signed-off-by: Phil Howard <[email protected]>
1 parent 2375b6a commit 45b462e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ports/rp2/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ set(MICROPY_SOURCE_PORT
165165
pendsv.c
166166
rp2_flash.c
167167
rp2_pio.c
168-
rp2_psram.c
169168
rp2_dma.c
170169
uart.c
171170
usbd.c
@@ -174,6 +173,12 @@ set(MICROPY_SOURCE_PORT
174173
${CMAKE_BINARY_DIR}/pins_${MICROPY_BOARD}.c
175174
)
176175

176+
if(PICO_RP2350)
177+
list(APPEND MICROPY_SOURCE_PORT
178+
rp2_psram.c
179+
)
180+
endif()
181+
177182
set(MICROPY_SOURCE_QSTR
178183
${MICROPY_SOURCE_PY}
179184
${MICROPY_DIR}/shared/readline/readline.c

ports/rp2/rp2_flash.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ static uint32_t begin_critical_flash_section(void) {
8989
}
9090
uint32_t state = save_and_disable_interrupts();
9191

92+
#if defined(MICROPY_HW_PSRAM_CS_PIN) && MICROPY_HW_ENABLE_PSRAM
9293
// We're about to invalidate the XIP cache, clean it first to commit any dirty writes to PSRAM
9394
uint8_t *maintenance_ptr = (uint8_t *)XIP_MAINTENANCE_BASE;
9495
for (int i = 1; i < 16 * 1024; i += 8) {
9596
maintenance_ptr[i] = 0;
9697
}
98+
#endif
9799

98100
return state;
99101
}

0 commit comments

Comments
 (0)