cancel
Showing results for 
Search instead for 
Did you mean: 

defined things called "undeclared"

ZKURT.1
Senior

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"?

9 REPLIES 9
ZKURT.1
Senior
 

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

Nikita91
Lead II

The STM32L010C6TX use a M0+ core not a M4 core. So look at core_cm0plus.h

In M0/M0+ core there is no DWT

TDK
Guru

@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.

If you feel a post has answered your question, please click "Accept as Solution".

Hello, thank you very much for your information.

Is there any other way to use this library?

 
ZKURT.1
Senior

Hello, thank you very much for your information.

Is there any other way to use this library?

ZKURT.1
Senior

this is the header file

Nikita91
Lead II

You can't. The M0+ doesn't have DWT.

You have to use a timer to do the same thing.