keatis / dwt_delay

Microseconds delay lib for STM32 (or whatever ARM) based on DWT
MIT License
80 stars 28 forks source link

Not working with stm32f030XX? #5

Closed Broman3100 closed 9 months ago

Broman3100 commented 4 years ago

I replaced the include stmf1xx.h for 0xx and it instantly errored every line, does the library not work with those chips (cortex m0) or am I doing something wrong here?

Nable80 commented 4 years ago

I came across the same problem several days ago. Unfortunately, STM32F0xx doesn't have full DWT support, you can clearly see this fact in the reference manual (RM0360 document). It's still possible to use SysTick or one of those general purpose timers.

Upd: I've checked the manual at infocenter.arm.com and it doesn't mention CYCCNT register for Cortex-M0 (and Cortex-M0+) at all, this isn't STM32-specific problem. Probably it makes sense to mention the requirement for Cortex-M3 (or higher) MCU core in this repo's description.

keatis commented 9 months ago

4 years passed, i didnt expect this repo to be quite popular. Anyway, i updated description with M0/1 mention. Thnx for noting.

It is true, M0/0+/1 are not supported since they dont have access to DWT and CoreDebug registers.