Skip to main content
ZKURT.1
Senior
December 15, 2021
Question

defined things called "undeclared"

  • December 15, 2021
  • 9 replies
  • 4321 views

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
December 15, 2021

..

waclawek.jan
Super User
December 15, 2021

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
December 15, 2021

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
December 16, 2021

Hello, thank you very much for your information.

Is there any other way to use this library?

ZKURT.1
ZKURT.1Author
Senior
December 16, 2021
TDK
December 15, 2021

@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
December 16, 2021

Hello, thank you very much for your information.

Is there any other way to use this library?

ZKURT.1
ZKURT.1Author
Senior
December 16, 2021

this is the header file

Nikita91
Lead II
December 16, 2021

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

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