cancel
Showing results for 
Search instead for 
Did you mean: 

Header file to include to access the CYCCNT register on STM32U575xx?

Claude
Associate III

I noticed the CYCCNT register is accessible from multiple header files.

That register is defined as part of the DWT_Type structure.

That structure definition is repeated in many header files:

core_armv8mbl.h, core_armv8mml.h, core_armv81mml.h, core_cm3.h, core_cm4.h, core_cm7.h, core_cm23.h, core_cm33.h, , core_cm35.h, , core_sc300.h

My actual MCU is the STM32U575xx and I would like to know which one of those header file to include.

 

Also, I am new on this community and I am unsure that I applied the proper label for this question. Please let me know if there is a more appropriate label.

 

Note: I would like to use this register in order to measure time in 100`s of microsecond. I know it could be done using timers. Does it make sense to measure time that way?

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
5 REPLIES 5

Should pull in via the DWT definition in  STM32Cube_FW_U5_V1.3.0\Drivers\CMSIS\Core\Include\core_cm33.h

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you

Actually @Tesla DeLorean , when I include that header file, I get the following compilation error :

 

../App/../Drivers/CMSIS/Include/core_cm33.h:127:8: error: #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"

127 | #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"

| ^~~~~

 

Claude_0-1710949007376.png

Note that the path I actually used is as follow:

#include "../Drivers/CMSIS/Include/core_cm33.h"
 

 

Note that the datasheet says I have a single precision FPU.

Maybe that file is meant to be included from another one?

Claude
Associate III

I ended up with this header file

#include "../Drivers/CMSIS/Device/ST/STM32U5xx/include/stm32u5xx.h"