-
Hi Rust experts and AVR fans, First of all: Thank you for providing this Rust abstraction layer for the AVR controllers. The examples are very helpful to get started. For some years I have been using these 8-bit controllers in several applications. I wrote code in Assembler, C, C++ and with the Arduino framework.
The main function should initialize these modules. I did not manage it to to use different peripherals in different modules.
So, for the serial peripheral I did it similarly as described in #115 where Rahix proposed a solution on 2022-01-28. In the main code I pass the serial peripheral to my console module:
But I get the following messages
Main questions:
Further questions: Thanks for any hints. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
😄 plus https://duckduckgo.com/?t=ftsa&q=rust++error%3A+failed+to+load+bitcode+of+module&ia=web Another approach could be providing a "git clone URL" to make reproducing the error possible. |
Beta Was this translation helpful? Give feedback.
-
Thank you, @stappersg, for your prompt suggestions. - Sorry, for my delayed response. I wrote a simple application which demonstrates my problem. It also appears if the macro for serial console output is implemented in the file where it is used. Please have a look at https://github.com/keymusic/advent_wreath/blob/linker_error/src/main.rs. When I call
|
Beta Was this translation helpful? Give feedback.
-
Regarding your other questions:
The common pattern is to initialize peripherals in
After initializing the
Not really, I am afraid. But it shouldn't be too difficult to figure out: Just create structs for each "module" and move the required peripherals into those structs. |
Beta Was this translation helpful? Give feedback.
Hi,
I think you are running into a very nasty cargo behavior that isn't obvious at all: Looking at your dependencies here:
While you are depending on
avr-device=0.6
, the version ofarduino-hal
you are pulling in specifies this:avr-hal/arduino-hal/Cargo.toml
Lines 54 to 55 in 190f2c3
Cargo now adds both versions of
avr-device
to your dependency tree to satisfy these requirements. But becauseavr-device
is a low-…