You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/02/24 11:09:18 UTC

[mynewt-core] 05/05: hw/bsp/dialog: Stop MTB in Default_Handler

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 55e774c49cebbd07c4023759267c41497e29e618
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Tue Feb 16 15:17:00 2021 +0100

    hw/bsp/dialog: Stop MTB in Default_Handler
    
    Default handler simply loops waiting for debugger or watchdog.
    MTB is not turned off it this event to keep useful information
    in MBT buffer and not just infinite loop trace.
---
 .../src/arch/cortex_m33/gcc_startup_da1469x.S                      | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/bsp/dialog_da1469x-dk-pro/src/arch/cortex_m33/gcc_startup_da1469x.S b/hw/bsp/dialog_da1469x-dk-pro/src/arch/cortex_m33/gcc_startup_da1469x.S
index c5e1281..c535071 100644
--- a/hw/bsp/dialog_da1469x-dk-pro/src/arch/cortex_m33/gcc_startup_da1469x.S
+++ b/hw/bsp/dialog_da1469x-dk-pro/src/arch/cortex_m33/gcc_startup_da1469x.S
@@ -272,6 +272,13 @@ Reset_Handler:
 /* Default interrupt handler */
     .type   Default_Handler, %function
 Default_Handler:
+#if MYNEWT_VAL(MCU_MTB_ENABLE)
+    /* Disable MTB, otherwise it will quickly fill up buffer with infinite loop branch. */
+    ldr     r1, =MTB_POSITION_REG
+    ldr     r2, [r1, #4]
+    bic     r2, #0x80000000
+    str     r2, [r1, #4]
+#endif
     ldr     r1, =SYS_CTRL_REG
     ldrh    r2, [r1, #0]
     orrs    r2, r2, #0x80   /* DEBUGGER_ENABLE */