Skip to content

Commit 7fc354a

Browse files
authored
Merge pull request #470 from APIUM/fix-rt1170-app-jump
Fix app jump failure at high clock speeds on RT1170
2 parents b047f4e + 912998e commit 7fc354a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ports/mimxrt10xx/boards.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,19 @@ void board_app_jump(void) {
226226

227227
// TODO protect bootloader region
228228

229+
// Clean and disable caches before jumping to app
230+
// This is needed when running at full speed (996MHz) - without it
231+
// stale cache data can cause a crash on startup
232+
#if defined(__DCACHE_PRESENT) && __DCACHE_PRESENT
233+
SCB_CleanDCache();
234+
SCB_DisableDCache();
235+
#endif
236+
#if defined(__ICACHE_PRESENT) && __ICACHE_PRESENT
237+
SCB_DisableICache();
238+
#endif
239+
__DSB();
240+
__ISB();
241+
229242
/* switch exception handlers to the application */
230243
SCB->VTOR = (uint32_t)BOARD_FLASH_APP_START;
231244

0 commit comments

Comments
 (0)