Comments (25)
Sorry guys, I really didn't think it would take this long to get a new release of stm32-rs.
Created a branch that uses a custom stm32l4 from stm32-rs master (with the fixes in).
Could you try the following in your Cargo.toml's
stm32l4xx-hal = { version = "0.3.6", git = "https://github.com/stm32-rs/stm32l4xx-hal", rev = "ffb160931d30d01d2d86371b75c2bd2ad4d0763a"}
from stm32l4xx-hal.
See stm32-rs/stm32-rs#192 for upcoming release including this
from stm32l4xx-hal.
This is a bug in master introduced #30, I plan on fixing this and pushing a new release this weekend.
from stm32l4xx-hal.
You need stm32-rs/stm32-rs#141 to be merged in other to make it work.
from stm32l4xx-hal.
Glad to hear it. Hopefully we will get a proper release soon.
from stm32l4xx-hal.
0.4.0
has been release which includes the changes to fix this issue.
from stm32l4xx-hal.
Any update on this?
from stm32l4xx-hal.
It has been merged, but AFAICT no new version hasn't been pushed. @MabezDev what's the status?
from stm32l4xx-hal.
I can push the revamped svd conversions for stm32l4** family, when I have time. Made it work by cloning hal crate(this one) and mcu crate.
from stm32l4xx-hal.
Although the patch has been merged, we are still waiting for @adamgreig to cut a new release of stm32-rs.
from stm32l4xx-hal.
I am also seeing this issue. What is the status on getting it resolved? Any workarounds until then?
from stm32l4xx-hal.
@smilykoch you could specify this git repository as dependency instead or use the patch section in cargo https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section
from stm32l4xx-hal.
ping @adamgreig !
from stm32l4xx-hal.
@hellow554 Thanks for the reply. I tried specifying this git repo as
[dependencies.stm32l4xx-hal]
# version = "0.3.6"
git = "https://github.com/stm32-rs/stm32l4xx-hal.git"
features = ["stm32l4x5", "rt"]
But i am still getting the same issues..
Compiling stm32l4xx-hal v0.3.6 (https://github.com/stm32-rs/stm32l4xx-hal.git#82fd75b4)
error[E0412]: cannot find type `CRRCR` in module `rcc`
--> /home/mathias/.cargo/git/checkouts/stm32l4xx-hal-8d56012c7770dc85/82fd75b/src/rcc.rs:118:45
|
118 | pub(crate) fn crrcr(&mut self) -> &rcc::CRRCR {
| ^^^^^ not found in `rcc`
help: possible candidate is found in another module, you can import it into scope
|
3 | use crate::rcc::CRRCR;
|
error[E0609]: no field `crrcr` on type `stm32l4::stm32l4x5::rcc::RegisterBlock`
--> /home/mathias/.cargo/git/checkouts/stm32l4xx-hal-8d56012c7770dc85/82fd75b/src/rcc.rs:120:33
|
120 | unsafe { &(*RCC::ptr()).crrcr }
| ^^^^^ unknown field
|
= note: available fields are: `cr`, `icscr`, `cfgr`, `pllcfgr`, `pllsai1cfgr` ... and 25 others
error[E0609]: no field `crrcr` on type `&stm32l4::stm32l4x5::rcc::RegisterBlock`
--> /home/mathias/.cargo/git/checkouts/stm32l4xx-hal-8d56012c7770dc85/82fd75b/src/rcc.rs:507:21
|
507 | rcc.crrcr.modify(|_, w| w.hsi48on().set_bit());
| ^^^^^
error[E0609]: no field `crrcr` on type `&stm32l4::stm32l4x5::rcc::RegisterBlock`
--> /home/mathias/.cargo/git/checkouts/stm32l4xx-hal-8d56012c7770dc85/82fd75b/src/rcc.rs:509:27
|
509 | while rcc.crrcr.read().hsi48rdy().bit_is_clear() {}
| ^^^^^
error: aborting due to 4 previous errors
from stm32l4xx-hal.
@smilykoch you need to invoke svd2rust with make. Previously generated ones will reside in the project dir.
from stm32l4xx-hal.
How do i do that? I am still fairly new in the embedded rust world ;)
from stm32l4xx-hal.
@vertexclique Could you maybe teach me what you mean when you say "invoke svd2rust with make"?
from stm32l4xx-hal.
Anyone who will be kind enough to share with me, how to resolve this issue until a new release of stm32-rs is published? I have been able to get a hold of the STM32L4x5.svd file, and ran it through svd2rust, to obtain the three files it generates. But i cannot figure out how they fit together with this repo, and how to replace the dependency with my generated ones?
from stm32l4xx-hal.
Hi.
Great! It seems to work! Thank you very much!
from stm32l4xx-hal.
Looks like stm32-rs v0.7.0
has been released containing this fix 🎉
@MabezDev, any idea when you were next planning on cutting a release of this crate?
from stm32l4xx-hal.
Hmm, I'm still seeing the issue after upgrading to 0.4.0
. The previously mentioned 0.3.6 fix also resulted in the exact same compilation issues for me.
Error:
$ cargo build
Compiling stm32l4xx-hal v0.4.0
error[E0412]: cannot find type `CRRCR` in module `rcc`
--> /Users/twilcock/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4xx-hal-0.4.0/src/rcc.rs:118:45
|
118 | pub(crate) fn crrcr(&mut self) -> &rcc::CRRCR {
| ^^^^^ not found in `rcc`
help: possible candidate is found in another module, you can import it into scope
|
3 | use crate::rcc::CRRCR;
|
error[E0609]: no field `crrcr` on type `stm32l4::stm32l4x3::rcc::RegisterBlock`
--> /Users/twilcock/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4xx-hal-0.4.0/src/rcc.rs:120:33
|
120 | unsafe { &(*RCC::ptr()).crrcr }
| ^^^^^ unknown field
|
= note: available fields are: `cr`, `icscr`, `cfgr`, `pllcfgr`, `pllsai1cfgr` ... and 24 others
error[E0609]: no field `crrcr` on type `&stm32l4::stm32l4x3::rcc::RegisterBlock`
--> /Users/twilcock/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4xx-hal-0.4.0/src/rcc.rs:507:21
|
507 | rcc.crrcr.modify(|_, w| w.hsi48on().set_bit());
| ^^^^^
error[E0609]: no field `crrcr` on type `&stm32l4::stm32l4x3::rcc::RegisterBlock`
--> /Users/twilcock/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4xx-hal-0.4.0/src/rcc.rs:509:27
|
509 | while rcc.crrcr.read().hsi48rdy().bit_is_clear() {}
| ^^^^^
error[E0599]: no method named `spi3en` found for type `&mut stm32l4::stm32l4x3::rcc::apb1enr1::W` in the current scope
--> /Users/twilcock/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4xx-hal-0.4.0/src/spi.rs:184:26
|
184 | SPI3: (spi3, APB1R1, spi3en, spi3rst, pclk1),
| ^^^^^^ help: did you mean: `sp3en`
error: aborting due to 5 previous errors
Some errors occurred: E0412, E0599, E0609.
For more information about an error, try `rustc --explain E0412`.
error: Could not compile `stm32l4xx-hal`.
Cargo.toml
:
[dependencies]
cortex-m = "0.6"
panic-halt = "0.2"
cortex-m-rt = "0.6"
[dependencies.stm32l4xx-hal]
features = ["rt", "stm32l4x3"]
version = "0.4"
lib.rs
:
#![no_std]
#[allow(unused_extern_crates)] // NOTE(allow) bug rust-lang/rust#53964
extern crate panic_halt; // panic handler
extern crate stm32l4xx_hal as hal;
use hal::prelude::*;
pub use cortex_m_rt::entry;
pub use hal::{
delay::Delay, prelude
};
pub fn init() -> Delay {
let cp = cortex_m::Peripherals::take().unwrap();
let dp = hal::stm32::Peripherals::take().unwrap();
let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let clocks = rcc.cfgr.freeze(&mut flash.acr);
Delay::new(cp.SYST, clocks)
}
from stm32l4xx-hal.
@mathk It looks like stm32-rs/stm32-rs#141 did not include the crrcr patch for the x3 chips, was this intentional (i.e it's not actually on the x3 chips) or is this something we need to patch?
from stm32l4xx-hal.
I guess we need to patch it. Looks like there is x43 and x33 chip and both reference RM0394 which document HSI48. I think at time of writing the patch I was only looking and the ST website documentation.
from stm32l4xx-hal.
Ah okay. I've opened a PR on stm32-rs that should add support for the l4x3 chips.
from stm32l4xx-hal.
Merged, can this be closed again?
from stm32l4xx-hal.
Related Issues (20)
- Expand ADC feature set HOT 1
- simplification(?) of 'stm32l4xx' feature detection HOT 1
- .cargo/config in root makes writing utilities more frustrating HOT 1
- Logging improvements (tests / examples / impls) HOT 2
- Question: SPI scrambled messages.
- Time for a release? HOT 4
- [Question] Documentation of `constrain` in example HOT 1
- Is it possible to configure half-duplex SPI?
- Are there any plans to release a new version recently? HOT 1
- STM32L4R5 PAC file is released HOT 4
- Start work on adapting embedded_hal 1.0 HOT 2
- PA1 for SPI1 HOT 1
- Usb device not presented for otg-fs example on STM32L476ZGTx HOT 1
- HAL for Comparators
- Compilation error while using interrupts HOT 1
- Register read/write not writing on stm32l433 HOT 2
- ADC example doesn't work because of imports HOT 2
- PWM timing off by 1
- Does project need new maintainer ? HOT 2
- Error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell`
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 stm32l4xx-hal.