korken89 / pico-probe

35 stars 4 forks source link

Build Failure: Mismatched PAC types #3

Closed a-gavin closed 1 year ago

a-gavin commented 1 year ago

As the title says, I'm unable to build on current master due to mismatched PAC timer types. When I run cargo build, rp2040-pac is built for v0.3.0 as well as v0.4.0.

I'm not sure what is building rp2040-monotonic v1.2.0 as the project dependency is v1.0.0, but I imagine that is the root cause of this given the Cargo.lock output below?

The build error:

   Compiling pico-probe v0.1.0 (/home/alex/dev/embedded/probe_stuff/pico-probe-rs)
error[E0308]: mismatched types
  --> src/setup.rs:79:37
   |
79 |     let mono = Rp2040Monotonic::new(pac.TIMER);
   |                -------------------- ^^^^^^^^^ expected struct `rp2040_pac::TIMER`, found struct `TIMER`
   |                |
   |                arguments to this function are incorrect
   |
   = note: perhaps two different versions of crate `rp2040_pac` are being used?
note: associated function defined here
  --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/rp2040-monotonic-1.2.0/src/lib.rs:21:12
   |
21 |     pub fn new(timer: TIMER) -> Self {
   |            ^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `pico-probe` due to previous error

From Cargo.lock:

[[package]]
name = "rp2040-hal"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0de1bc8bf092f5da649a417ad9f18c9705b6226afe3521a469f15d1d2bcb7f66"
dependencies = [
 "cortex-m",
 "cortex-m-rt",
 "critical-section 0.2.8",
 "embedded-hal",
 "embedded-time",
 "itertools",
 "nb 1.0.0",
 "paste",
 "pio",
 "rand_core",
 "rp2040-hal-macros",
 "rp2040-pac 0.3.0",
 "usb-device",
 "vcell",
 "void",
]
...
[[package]]
name = "rp2040-monotonic"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c30fa31d4952d2af0ee0b4962ef914988413f8092827fffc2fda03145aae752f"
dependencies = [
 "fugit",
 "rp2040-pac 0.4.0",
 "rtic-monotonic",
]

Rustc:

% cargo --version
rustc 1.65.0 (897e37553 2022-11-02)
a-gavin commented 1 year ago

I'd offer to chase this down, but I'm fairly inexperienced in solving cargo dependency errors and won't have time for the next couple days. If this is still around next week, though, I can take a closer look!

korken89 commented 1 year ago

Hi, this is now fixed on master with commit d9fa7f6834dac14a1e8aafc20110da6faacdcabe