Skip to content

No TIM2 on STM32L052 #2431

Open
Open
@shufps

Description

@shufps

Hi,

I tried to setup PWM for TIM2, Channel 1 and the compiler complains that it doesn't know TIM2.

Error:

error[E0609]: no field `TIM2` on type `Peripherals`
   --> src/bin/blinky.rs:155:36
    |
155 |     let mut pwm = SimplePwm::new(p.TIM2, Some(ch1), None, None, None, khz(10), Default::default());
    |                                    ^^^^ help: a field with a similar name exists: `TIM21`

and it doesn't seem to exist?

image

But TIM2 appears several times in the _generated.rs.

Has someone an idea what I'm doing wrong? 🥺

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions