Skip to content

Commit 2627870

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

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
@@ -79,11 +79,13 @@ static uint32_t begin_critical_flash_section(void) {
7979
}
8080
uint32_t state = save_and_disable_interrupts();
8181

82+
#if defined(MICROPY_HW_PSRAM_CS_PIN) && MICROPY_HW_ENABLE_PSRAM
8283
// We're about to invalidate the XIP cache, clean it first to commit any dirty writes to PSRAM
8384
uint8_t *maintenance_ptr = (uint8_t *)XIP_MAINTENANCE_BASE;
8485
for (int i = 1; i < 16 * 1024; i += 8) {
8586
maintenance_ptr[i] = 0;
8687
}
88+
#endif
8789

8890
return state;
8991
}

0 commit comments

Comments
 (0)