From ebde485b9efa736792b0c436e7a8a31c47eeb4b6 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 1 Sep 2015 08:58:14 +0000 Subject: Fixed DWT unlock on CM7 ports. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8264 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/nil/ports/ARMCMx/nilcore_v7m.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'os/nil') diff --git a/os/nil/ports/ARMCMx/nilcore_v7m.h b/os/nil/ports/ARMCMx/nilcore_v7m.h index 4ae692d7d..41c038fcc 100644 --- a/os/nil/ports/ARMCMx/nilcore_v7m.h +++ b/os/nil/ports/ARMCMx/nilcore_v7m.h @@ -389,6 +389,9 @@ static inline void port_init(void) { /* DWT cycle counter enable.*/ CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; +#if CORTEX_MODEL == 7 + DWT->LAR = 0xC5ACCE55; +#endif DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; /* Initialization of the system vectors used by the port.*/ -- cgit v1.2.3