Open jdswensen opened 1 week ago
I'd like to confirm a similar issue: I was trying to start with the ethernet_w5500_tcp_server
demo, but when I used what I thought was the correct manifest, it failed to compile.
I went into the repo and deleted all path references, then deleted things until Cargo stopped complaining (in particular on things like how embassy-net == 0.4.0
does not have features multicast
and raw
, and embassy-rp == 0.2.0
doesn't have rp2040
, but the manifest in the repo does successfully mention them.
It seems as though the repo contains some breaking changes which were not published to crates.io, but which were fixed in the examples, so the examples no longer work with the released versions.
After that was done, my manifest looked like:
[package]
edition = "2021"
name = "embassy-rp-examples"
version = "0.1.0"
license = "MIT OR Apache-2.0"
[dependencies]
embassy-embedded-hal = { version = "0.2.0", features = ["defmt"] }
embassy-sync = { version = "0.6.0", features = ["defmt"] }
embassy-executor = { version = "0.6.1", features = ["task-arena-size-98304", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
embassy-time = { version = "0.3.2", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-rp = { version = "0.2.0", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl"] }
embassy-net = { version = "0.4.0", features = ["defmt", "tcp", "udp", "dhcpv4", "dhcpv4-hostname", "medium-ethernet", "dns", "proto-ipv4", "proto-ipv6"] }
embassy-net-wiznet = { version = "0.1.0", features = ["defmt"] }
embassy-futures = { version = "0.1.0" }
defmt = "0.3"
defmt-rtt = "0.4"
fixed = "1.23.1"
fixed-macro = "1.2"
# for web request example
reqwless = { version = "0.13.0", features = ["defmt"] }
serde = { version = "1.0.203", default-features = false, features = ["derive"] }
serde-json-core = "0.5.1"
#cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
cortex-m = { version = "0.7.6", features = ["inline-asm"] }
cortex-m-rt = "0.7.0"
critical-section = "1.1"
panic-probe = { version = "0.3", features = ["print-defmt"] }
st7789 = "0.6.1"
byte-slice-cast = { version = "1.2.0", default-features = false }
smart-leds = "0.4.0"
heapless = "0.8"
usbd-hid = "0.8.1"
embedded-hal-1 = { package = "embedded-hal", version = "1.0" }
embedded-hal-async = "1.0"
embedded-hal-bus = { version = "0.1", features = ["async"] }
embedded-io-async = { version = "0.6.1", features = ["defmt-03"] }
embedded-storage = { version = "0.3" }
static_cell = "2.1"
portable-atomic = { version = "1.5", features = ["critical-section"] }
log = "0.4"
pio-proc = "0.2"
pio = "0.2.1"
rand = { version = "0.8.5", default-features = false }
[profile.release]
debug = 2
lto = true
opt-level = 'z'
[profile.dev]
debug = 2
lto = true
opt-level = "z"
And here's the errors I got:
$ cargo embed --bin ethernet_w5500_tcp_server
Compiling embassy-rp-examples v0.1.0 (/home/danya/Projects/embassy/examples/rp)
error: could not compile `embassy-rp-examples` (bin "ethernet_w5500_tcp_server") due to 6 previous errors
error[E0412]: cannot find type `Runner` in crate `embassy_net`
--> src/bin/ethernet_w5500_tcp_server.rs:40:44
|
40 | async fn net_task(mut runner: embassy_net::Runner<'static, Device<'static>>) -> ! {
| ^^^^^^
|
::: /home/danya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-net-0.4.0/src/lib.rs:246:1
|
246 | struct Inner<D: Driver> {
| ----------------------- similarly named struct `Inner` defined here
|
help: a struct with a similar name exists
|
40 | async fn net_task(mut runner: embassy_net::Inner<'static, Device<'static>>) -> ! {
| ~~~~~
help: consider importing this struct
|
9 + use embassy_net_wiznet::Runner;
|
help: if you import `Runner`, refer to it directly
|
40 - async fn net_task(mut runner: embassy_net::Runner<'static, Device<'static>>) -> ! {
40 + async fn net_task(mut runner: Runner<'static, Device<'static>>) -> ! {
|
error[E0425]: cannot find function `new` in crate `embassy_net`
--> src/bin/ethernet_w5500_tcp_server.rs:77:40
|
77 | let (stack, runner) = embassy_net::new(
| ^^^ not found in `embassy_net`
|
help: consider importing one of these functions
|
9 + use crate::new;
|
9 + use embassy_net_wiznet::new;
|
help: if you import `new`, refer to it directly
|
77 - let (stack, runner) = embassy_net::new(
77 + let (stack, runner) = new(
|
error[E0599]: no method named `unwrap` found for tuple `(Device<'_, 1514>, Runner<'_, _, ExclusiveDevice<Spi<'_, SPI0, Async>, Output<'_>, Delay>, Input<'_>, Output<'_>>)` in the current scope
--> src/bin/ethernet_w5500_tcp_server.rs:69:6
|
61 | let (device, runner) = embassy_net_wiznet::new(
| ____________________________-
62 | | mac_addr,
63 | | state,
64 | | ExclusiveDevice::new(spi, cs, Delay),
... |
68 | | .await
69 | | .unwrap();
| |_____-^^^^^^
|
= note: the full type name has been written to '/home/danya/Projects/embassy/examples/rp/target/thumbv6m-none-eabi/debug/deps/ethernet_w5500_tcp_server-a8bde0bd203a2227.long-type-18356303867768005353.txt'
= note: consider using `--verbose` to print the full type name to the console
help: there is a method `unwrapped_as` with a similar name
|
69 | .unwrapped_as();
| ~~~~~~~~~~~~
error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> src/bin/ethernet_w5500_tcp_server.rs:130:33
|
130 | async fn wait_for_config(stack: Stack<'static>) -> embassy_net::StaticConfigV4 {
| ^^^^^--------- help: remove the unnecessary generics
| |
| expected 0 lifetime arguments
|
note: struct defined here, with 0 lifetime parameters
--> /home/danya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-net-0.4.0/src/lib.rs:241:12
|
241 | pub struct Stack<D: Driver> {
| ^^^^^
error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> src/bin/ethernet_w5500_tcp_server.rs:130:33
|
130 | async fn wait_for_config(stack: Stack<'static>) -> embassy_net::StaticConfigV4 {
| ^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `D`
--> /home/danya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-net-0.4.0/src/lib.rs:241:12
|
241 | pub struct Stack<D: Driver> {
| ^^^^^ -
help: add missing generic argument
|
130 | async fn wait_for_config(stack: Stack<'static, D>) -> embassy_net::StaticConfigV4 {
| +++
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0107, E0412, E0425, E0599.
For more information about an error, try `rustc --explain E0107`.
Error Failed to run cargo build: exit code = Some(101).
If you copy/paste the code from the RP2040 USB logger example into a new project, it will not compile.
Here is the cargo manifest I used:
and the compile error:
I suspect that this is due to some build error in the tagged version. I tried pointing just the
embassy-usb-logger
crate to the upstream but got a compile error about two different versions of a trait (understandable).So I updated all of the embassy crates to point at the upstream and that seemed to work. It's a good enough work around for me to continue but figured you would like to know!