Skip to content

Commit 299930a

Browse files
committed
alif: Fix jump to bootloader.
Clear TRCENA (if it was enabled for DWT CYCCNT) before calling NVIC_SystemReset(), otherwise it spins forever. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent d6d6fbf commit 299930a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • ports/alif/boards/OPENMV_AE3

ports/alif/boards/OPENMV_AE3/board.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ void board_startup(void) {
9696

9797
void board_enter_bootloader(void) {
9898
*((uint32_t *)OMV_BOOT_MAGIC_ADDR) = OMV_BOOT_MAGIC_VALUE;
99+
100+
// Clear TRCENA (if it was enabled for DWT CYCCNT) before
101+
// calling NVIC_SystemReset(), otherwise it spins forever.
102+
CoreDebug->DEMCR &= ~(CoreDebug_DEMCR_TRCENA_Msk);
103+
99104
NVIC_SystemReset();
100105
}
101106

0 commit comments

Comments
 (0)