Skip to content

Commit 7ee2fe5

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

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
@@ -152,6 +152,10 @@ static uint32_t begin_critical_flash_section(void) {
152152
uint8_t *maintenance_ptr = (uint8_t *)XIP_MAINTENANCE_BASE;
153153
for (int i = 1; i < 16 * 1024; i += 8) {
154154
maintenance_ptr[i] = 0;
155+
156+
// Must also invalidate the cache lines to prevent rare hangs
157+
// See: https://forums.raspberrypi.com/viewtopic.php?t=378249)
158+
maintenance_ptr[i - 1] = 0;
155159
}
156160
#endif
157161

0 commit comments

Comments
 (0)