Comments (7)
Hmm, thanks. What ufmt
version and what version of avr-hal
are you using? Maybe post the full output of cargo tree
if that's possible to seee if this may be an issue caused by incompatible versions...
from avr-hal.
I'm so dumb, now that you made me look at my dependencies I realized I was using an outdated version of ufmt
so now I added it as a dependency to my cargo.toml
and now the error is gone. Although I do get other weird behavior. I get this when I run the program
thread '<unnamed>' panicked at C:\Users\Alexandre\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ravedude-0.1.7\src\console.rs:35:32:
called `Result::unwrap()` on an `Err` value: Error { kind: InvalidData, message: "Windows stdio in console mode does not support writing non-UTF-8 byte sequences" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
from avr-hal.
from avr-hal.
Same behavior on nightly-2023-12-28
?
from avr-hal.
Same behavior with 2023-12-28
error[E0599]: the method `do_as_formatter` exists for mutable reference `&mut Usart<Atmega, USART0, Pin<Input, PD0>, Pin<Output, PD1>, MHz16>`, but its trait bounds were not satisfied
--> src\main.rs:22:5
|
22 | ufmt::uwriteln!(&mut serial, "Hello, World!");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called due to unsatisfied trait bounds
|
::: C:\Users\Alexandre\.cargo\git\checkouts\avr-hal-f3855d5807fdfd57\190f2c3\avr-hal-generic\src\usart.rs:230:1
|
230 | pub struct Usart<H, USART: UsartOps<H, RX, TX>, RX, TX, CLOCK> {
| --------------------------------------------------------------
| |
| doesn't satisfy `_: UnstableDoAsFormatter`
| doesn't satisfy `_: uWrite`
|
= note: the following trait bounds were not satisfied:
`avr_hal_generic::usart::Usart<Atmega, USART0, avr_hal_generic::port::Pin<Input, PD0>, avr_hal_generic::port::Pin<Output, PD1>, MHz16>: uWrite`
which is required by `avr_hal_generic::usart::Usart<Atmega, USART0, avr_hal_generic::port::Pin<Input, PD0>, avr_hal_generic::port::Pin<Output, PD1>, MHz16>: UnstableDoAsFormatter`
`&mut avr_hal_generic::usart::Usart<Atmega, USART0, avr_hal_generic::port::Pin<Input, PD0>, avr_hal_generic::port::Pin<Output, PD1>, MHz16>: uWrite`
which is required by `&mut avr_hal_generic::usart::Usart<Atmega, USART0, avr_hal_generic::port::Pin<Input, PD0>, avr_hal_generic::port::Pin<Output, PD1>, MHz16>: UnstableDoAsFormatter`
= help: items from traits can only be used if the trait is in scope
= note: this error originates in the macro `ufmt::uwriteln` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
5 + use ufmt::UnstableDoAsFormatter;
|
>rustup show
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\Alexandre\.rustup
installed toolchains
--------------------
stable-x86_64-pc-windows-msvc (default)
nightly-2023-12-28-x86_64-pc-windows-msvc
active toolchain
----------------
nightly-2023-12-28-x86_64-pc-windows-msvc (directory override for 'C:\Users\Alexandre\Documents\Projects\arduino\blink-rs-arduino')
rustc 1.77.0-nightly (89e2160c4 2023-12-27)
from avr-hal.
Here's the cargo tree
output
blink-rs-arduino v0.1.0 (C:\Users\Alexandre\Documents\Projects\arduino\blink-rs-arduino)
└── arduino-hal v0.1.0 (https://github.com/rahix/avr-hal?rev=190f2c3cb8d29e10f71119352b912369dc5a1fb7#190f2c3c)
├── atmega-hal v0.1.0 (https://github.com/rahix/avr-hal?rev=190f2c3cb8d29e10f71119352b912369dc5a1fb7#190f2c3c)
│ ├── avr-device v0.5.4
│ │ ├── avr-device-macros v0.5.4 (proc-macro)
│ │ │ ├── proc-macro2 v1.0.78
│ │ │ │ └── unicode-ident v1.0.12
│ │ │ ├── quote v1.0.35
│ │ │ │ └── proc-macro2 v1.0.78 (*)
│ │ │ └── syn v1.0.109
│ │ │ ├── proc-macro2 v1.0.78 (*)
│ │ │ ├── quote v1.0.35 (*)
│ │ │ └── unicode-ident v1.0.12
│ │ ├── bare-metal v1.0.0
│ │ ├── cfg-if v1.0.0
│ │ └── vcell v0.1.3
│ └── avr-hal-generic v0.1.0 (https://github.com/rahix/avr-hal?rev=190f2c3cb8d29e10f71119352b912369dc5a1fb7#190f2c3c)
│ ├── avr-device v0.5.4 (*)
│ ├── cfg-if v0.1.10
│ ├── embedded-hal v0.2.7
│ │ ├── nb v0.1.3
│ │ │ └── nb v1.1.0
│ │ └── void v1.0.2
│ ├── embedded-storage v0.2.0
│ ├── nb v0.1.3 (*)
│ ├── paste v1.0.14 (proc-macro)
│ ├── ufmt v0.1.2
│ │ ├── proc-macro-hack v0.5.20+deprecated (proc-macro)
│ │ ├── ufmt-macros v0.2.0 (proc-macro)
│ │ │ ├── proc-macro-hack v0.5.20+deprecated (proc-macro)
│ │ │ ├── proc-macro2 v1.0.78 (*)
│ │ │ ├── quote v1.0.35 (*)
│ │ │ └── syn v1.0.109 (*)
│ │ └── ufmt-write v0.1.0
│ └── void v1.0.2
│ [build-dependencies]
│ └── rustversion v1.0.14 (proc-macro)
├── avr-device v0.5.4 (*)
├── avr-hal-generic v0.1.0 (https://github.com/rahix/avr-hal?rev=190f2c3cb8d29e10f71119352b912369dc5a1fb7#190f2c3c) (*)
├── cfg-if v1.0.0
├── embedded-hal v0.2.7 (*)
├── ufmt v0.1.2 (*)
└── void v1.0.2
from avr-hal.
I realized I was using an outdated version of ufmt so now I added it as a dependency to my cargo.toml and now the error is gone
Yeah, I suspected as much... Glad you found it!
Unfortunately Rust is really bad at notifying you of such situations where multiple incompatible versions of the same crate are used in the dependency tree... And this has been an issue for years :(
from avr-hal.
Related Issues (20)
- Panic while trying to write to serial using `ufmt::uwriteln` HOT 4
- Add configurable board options to ravedude HOT 3
- Get pin number HOT 6
- Program freezes if compiled in debug mode.
- ravedude should check rust target against selected MCU HOT 3
- Document clock type design in more detail HOT 1
- cargo build - error[E0658] - proc_macro::Literal::byte_character(byte) HOT 9
- can't find crate for `core` HOT 12
- cargo build - error[E0658] - proc_macro::Literal::byte_character(byte) HOT 4
- Very weird error when compiling a very basic program: __addsf3 multiple defenitions HOT 8
- Ravedude freezes on programmer uploading HOT 5
- Arduino Nano: avrdude error: programmer is not responding HOT 11
- Watchdog intterupt mode HOT 1
- [Solved] Cannot find `pwm` in `embedded_hal` HOT 2
- peripherals type alias HOT 2
- Enhance `avr_hal_generic::renamed_pins! {}` to also generate type aliases for each pin
- tier 3 target and broken
- Utilising the `atmega2560`'s "USART in SPI Mode" HOT 10
- Issue with math calculations with floats to serial port output HOT 4
- Incorrect ADC readings after toolchain bump HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avr-hal.