stm32-rs / stm32l4xx-hal

A Hardware abstraction layer for the stm32l432xx series chips written in rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enable_cycle_counter not found in DWT (STM32L432KC)

nebelgrau77 opened this issue · comments

Hello all,

I have some experience with other STM32 crates, but it's the first time with my new STM32L432KC Nucleo-32 board, and I'm sure it's something simple I'm missing here.
I'm trying to do the simple LED blinking, using the blinky.rs example simplified a bit (no semihosting):

https://github.com/nebelgrau77/stm32l4_blink

It won't compile, the error is:

   Compiling stm32l4xx-hal v0.6.0
error[E0599]: no method named `enable_cycle_counter` found for struct `DWT` in the current scope
  --> /home/nebelgrau/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4xx-hal-0.6.0/src/time.rs:99:13
   |
99 |         dwt.enable_cycle_counter();
   |             ^^^^^^^^^^^^^^^^^^^^ method not found in `DWT`

What am I missing here? Is there something to be explicitly imported, or defined better in Cargo.toml?

Just as I thought, I was missing something: wrong target in cargo.config 🤦