Using older 'efm32gg-hal' crate - controlling versions of depending crates

I'm having a tough time getting the "efm32gg-hal v0.3.0" to compile.
It stops with e.g. this one:

error[E0046]: not all trait items implemented, missing: `disable`
   --> /home/troels/.cargo/registry/src/github.com-1ecc6299db9ec823/efm32gg-hal-0.3.0/src/timer.rs:53:1
    |
53  | impl embedded_hal::Pwm for $TimerN {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `disable` in implementation
...
329 | timer!(TIMER1, TIMER1Clk, Timer1, timer1);
    | ------------------------------------------ in this macro invocation

The crate is one year old, so it probably because some dependency has changed.
So I double-checked the dependencies from:
https://crates.io/crates/efm32gg-hal
And specify the versions specifically:

    [dependencies]
    panic-halt = "0.2.0"
    cortex-m-rt = "0.6.11"
     # specific versions for efm32gg-hal:
    cortex-m = "0.5.2"
    embedded-hal = "0.2.0"
    efm32gg990 = "0.1.2"
    efm32gg-hal = "0.3.0"

After learning a forced downgrade of some downloaded crates via e.g.
cargo +nightly update -p cortex-m:0.5.10 --precise 0.5.2
I finally managed to get apparantly correct versions of the crates:

$ cargo clean && cargo +nightly build
   Compiling app v0.1.0 (/home/troels/code/rust1/app_efm)
<cut>
   Compiling embedded-hal v0.2.0
   Compiling cortex-m v0.5.2
   Compiling efm32gg990 v0.1.2
   Compiling efm32gg-hal v0.3.0
<cut>

But still get the error message above.

Where do I go from here?
Is there another dependency (not listed) that I should satisfy - how do I deduce that?

Thx for any pointers

Well - double-checked the embedded-hal definition of the PWM trait:

pub trait Pwm {
/// Enumeration of channels that can be used with this `Pwm` interface
<cut>
/// Disables a PWM `channel`
fn disable(&mut self, channel: Self::Channel);
...

It really HAS the 'disable' function.

But the source of the efm32gg-hal clearly does not define that - as per the compiler error.

Also double-checked that the efm32gg-hal does specify version 0.2.0 of the embedded-hal:

[dependencies.embedded-hal]
version = "0.2.0"
features = ["unproven"]

There is something fishy here...

(This is my day 3 of Rust ... tough learning curve, I must say - but at least I'm getting to know Cargo and crates and traits and ... :slight_smile: )

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.