diff options
| author | guozhanxin <[email protected]> | 2018-06-04 14:54:07 +0800 |
|---|---|---|
| committer | guozhanxin <[email protected]> | 2018-06-04 14:54:07 +0800 |
| commit | e2c89ec0f54758c8271e4967fc53bab3b7be9360 (patch) | |
| tree | 9fe2b5fd830ae24e55d855f7cb2cc95f7960f82b /components | |
| parent | 7d6b7dc3f068b2dac0d262a26967ab4a843e1d83 (diff) | |
[components][cputime]to be able trace before use DWT.|使用 DWT 之前必须先使能跟踪系统.
Diffstat (limited to 'components')
| -rw-r--r-- | components/drivers/cputime/cputime_cortexm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/components/drivers/cputime/cputime_cortexm.c b/components/drivers/cputime/cputime_cortexm.c index f576df785f..99dc8b013e 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) { |
