Skip to content

Commit 7d3b7d6

Browse files
MichaelBellGadgetoid
authored andcommitted
ports/rp2: Invalidate cache after clean to prevent hangs.
Signed-off-by: Mike Bell <[email protected]>
1 parent 1585553 commit 7d3b7d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ports/rp2/rp2_flash.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ static uint32_t begin_critical_flash_section(void) {
132132
uint8_t *maintenance_ptr = (uint8_t *)XIP_MAINTENANCE_BASE;
133133
for (int i = 1; i < 16 * 1024; i += 8) {
134134
maintenance_ptr[i] = 0;
135+
136+
// Must also invalidate the cache lines to prevent rare hangs
137+
// See: https://forums.raspberrypi.com/viewtopic.php?t=378249)
138+
maintenance_ptr[i - 1] = 0;
135139
}
136140
#endif
137141

0 commit comments

Comments
 (0)