2021-12-15 05:58 AM
Hi, my processor is STM32L010C6TX. I added function to my project to use microsecond But " DWT" "CTRL" etc. It says not defined. However, they are all in the "core_cm4.h" library. This library is in Drivers-> CMSIS->Include. why doesn't it call this function and say "undeclared"?
2021-12-15 05:58 AM
2021-12-15 07:14 AM
Maybe you don't have given header file included (directly or indirectly) in the source file where the error occurs.
Try to #include it explicitly.
[EDIT] Nikita91 below ecplained, why.[/EDIT]
JW
2021-12-15 07:20 AM
The STM32L010C6TX use a M0+ core not a M4 core. So look at core_cm0plus.h
In M0/M0+ core there is no DWT
2021-12-15 09:58 AM
@Khouloud OTHMAN ST should really do a better job here of only copying the core file(s) used by that family. There's no reason to have headers for all different Cortex types within a project. No need to have Cortex-M4 specific files in a Cortex-M0+ project.
2021-12-15 10:12 PM
2021-12-15 10:12 PM
2021-12-15 10:13 PM
2021-12-15 10:13 PM
2021-12-16 04:33 AM
You can't. The M0+ doesn't have DWT.
You have to use a timer to do the same thing.