diff --git a/components/drivers/cputime/cputime_cortexm.c b/components/drivers/cputime/cputime_cortexm.c index f576df785ff5231a5d9ba475c66ba4e73ee89de8..99dc8b013e2fda258890cb9279d8cdf3d85ed6ce 100644 --- a/components/drivers/cputime/cputime_cortexm.c +++ b/components/drivers/cputime/cputime_cortexm.c @@ -54,6 +54,9 @@ int cortexm_cputime_init(void) /* check support bit */ if ((DWT->CTRL & (1UL << DWT_CTRL_NOCYCCNT_Pos)) == 0) { + /* enable trace*/ + CoreDebug->DEMCR |= (1UL << CoreDebug_DEMCR_TRCENA_Pos); + /* whether cycle counter not enabled */ if ((DWT->CTRL & (1UL << DWT_CTRL_CYCCNTENA_Pos)) == 0) {