Skip to main content
ZKURT.1
Senior
Dec 15, 2021 1:58 PM UTC
Question

defined things called "undeclared"

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

This topic has been closed for replies.

9 replies

ZKURT.1
ZKURT.1Author
Senior
Dec 15, 2021 1:58 PM UTC

..

waclawek.jan
Super User
Dec 15, 2021 3:14 PM UTC

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
Dec 15, 2021 3:20 PM UTC

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

In M0/M0+ core there is no DWT

ZKURT.1
ZKURT.1Author
Senior
Dec 16, 2021 6:12 AM UTC

Hello, thank you very much for your information.

Is there any other way to use this library?

ZKURT.1
ZKURT.1Author
Senior
Dec 16, 2021 6:12 AM UTC
TDK
Dec 15, 2021 5:58 PM UTC

@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""."
ZKURT.1
ZKURT.1Author
Senior
Dec 16, 2021 6:13 AM UTC

Hello, thank you very much for your information.

Is there any other way to use this library?

ZKURT.1
ZKURT.1Author
Senior
Dec 16, 2021 6:13 AM UTC

this is the header file

Nikita91
Lead II
Dec 16, 2021 12:33 PM UTC

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

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