Skip to content

Commit 9bda80b

Browse files
committed
Explicitly invalidate cache lines on RP2350
Clean alone can lead to crashes. Fixes #9746
1 parent c606994 commit 9bda80b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ports/raspberrypi/supervisor/internal_flash.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ static void save_psram_settings(void) {
5151
// We're about to invalidate the XIP cache, clean it first to commit any dirty writes to PSRAM
5252
uint8_t *maintenance_ptr = (uint8_t *)XIP_MAINTENANCE_BASE;
5353
for (int i = 1; i < 16 * 1024; i += 8) {
54-
maintenance_ptr[i] = 0;
54+
// Background info: https://forums.raspberrypi.com/viewtopic.php?t=378249
55+
maintenance_ptr[i] = 0; // Clean
56+
maintenance_ptr[i - 1] = 0; // Explicitly invalidate
5557
}
5658

5759
m1_timing = qmi_hw->m[1].timing;

0 commit comments

Comments
 (0)