File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -668,7 +668,7 @@ typedef struct
668
668
#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/ ) /*!< ICTR: INTLINESNUM Mask */
669
669
670
670
/* Auxiliary Control Register Definitions */
671
-
671
+ #if defined ( __CM3_REV ) && ( __CM3_REV >= 0x200U )
672
672
#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */
673
673
#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */
674
674
@@ -677,6 +677,7 @@ typedef struct
677
677
678
678
#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */
679
679
#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/ ) /*!< ACTLR: DISMCYCINT Mask */
680
+ #endif
680
681
681
682
/*@} end of group CMSIS_SCnotSCB */
682
683
Original file line number Diff line number Diff line change @@ -71,6 +71,17 @@ void mbed_start_application(uintptr_t address)
71
71
powerdown_scb (address );
72
72
mbed_mpu_free ();
73
73
74
+ #ifdef MBED_DEBUG
75
+ // Configs to make debugging easier
76
+ #ifdef SCnSCB_ACTLR_DISDEFWBUF_Msk
77
+ // Disable write buffer to make BusFaults (eg write to ROM via NULL pointer) precise.
78
+ // Possible on Cortex-M3 and M4, not on M0, M7 or M33.
79
+ // Would be less necessary if ROM was write-protected in MPU to give a
80
+ // precise MemManage exception.
81
+ SCnSCB -> ACTLR |= SCnSCB_ACTLR_DISDEFWBUF_Msk ;
82
+ #endif
83
+ #endif
84
+
74
85
sp = * ((void * * )address + 0 );
75
86
pc = * ((void * * )address + 1 );
76
87
start_new_application (sp , pc );
You can’t perform that action at this time.
0 commit comments