Skip to content

Commit 1004894

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

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
@@ -142,6 +142,10 @@ static uint32_t begin_critical_flash_section(void) {
142142
uint8_t *maintenance_ptr = (uint8_t *)XIP_MAINTENANCE_BASE;
143143
for (int i = 1; i < 16 * 1024; i += 8) {
144144
maintenance_ptr[i] = 0;
145+
146+
// Must also invalidate the cache lines to prevent rare hangs
147+
// See: https://forums.raspberrypi.com/viewtopic.php?t=378249)
148+
maintenance_ptr[i - 1] = 0;
145149
}
146150
#endif
147151

0 commit comments

Comments
 (0)