Closed erazor-de closed 1 year ago
please post the entire error output instead of a truncated one.
error[E0599]: `Peripherals` is not an iterator
--> tests/test.rs:3:29
|
3 | stm32f103::Peripherals::take().unwrap();
| ^^^^ `Peripherals` is not an iterator
|
::: /Users/emil/workspace/dev_space/svdtests/stm32f103/src/lib.rs:1797:1
|
1797 | pub struct Peripherals {
| ---------------------- doesn't satisfy `Peripherals: Iterator`
`Peripherals: Iterator`
which is required by `&mut Peripherals: Iterator`
For more information about this error, try `rustc --explain E0599`.
error: could not compile `stm32f103` due to previous error
make sure you enable the feature critical-section
in the binary crate for stm32f103
pretty sure this is the issue, unfortunate that we get this error and not
--> tests/test.rs:3:29
|
3 | stm32f103::Peripherals::take().unwrap();
| ^^^^^ function or associated item not found in `Peripherals`
The using crate now has two new feature uses regarding critical-section:
cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
stm32f103 = { version = "0.0.1", path = "./stm32f103", features = ["rt", "critical-section"] }
This seems to work now.
I'm using rustc 1.65.0 (897e37553 2022-11-02) svd2rust 0.27.2 ( )
I made a crate from the manufacturers STM32F103.svd using your documentation. When I try to use the crate in another project like:
I get the error message:
Taking the Peripherals of the cortex_m crate produces no error. I tried with edition 2021 and 2018 in Cargo.toml.