File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -139,13 +139,12 @@ static uint32_t begin_critical_flash_section(void) {
139
139
140
140
#if defined(MICROPY_HW_PSRAM_CS_PIN ) && MICROPY_HW_ENABLE_PSRAM
141
141
// We're about to invalidate the XIP cache, clean it first to commit any dirty writes to PSRAM
142
- uint8_t * maintenance_ptr = (uint8_t * )XIP_MAINTENANCE_BASE ;
142
+ // Use the upper 16k of the maintenance space (0x1bffc000 through 0x1bffffff) to workaround
143
+ // incorrect behaviour of the XIP clean operation, where it also alters the tag of the associated
144
+ // cache line: https://forums.raspberrypi.com/viewtopic.php?t=378249#p2263677
145
+ volatile uint8_t * maintenance_ptr = (volatile uint8_t * )(XIP_SRAM_BASE + (XIP_MAINTENANCE_BASE - XIP_BASE ));
143
146
for (int i = 1 ; i < 16 * 1024 ; i += 8 ) {
144
147
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 ;
149
148
}
150
149
#endif
151
150
You can’t perform that action at this time.
0 commit comments