Giter Club home page Giter Club logo

Comments (25)

MabezDev avatar MabezDev commented on June 19, 2024 2

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.

adamgreig avatar adamgreig commented on June 19, 2024 2

See stm32-rs/stm32-rs#192 for upcoming release including this

from stm32l4xx-hal.

MabezDev avatar MabezDev commented on June 19, 2024 1

This is a bug in master introduced #30, I plan on fixing this and pushing a new release this weekend.

from stm32l4xx-hal.

mathk avatar mathk commented on June 19, 2024 1

You need stm32-rs/stm32-rs#141 to be merged in other to make it work.

from stm32l4xx-hal.

MabezDev avatar MabezDev commented on June 19, 2024 1

Glad to hear it. Hopefully we will get a proper release soon.

from stm32l4xx-hal.

MabezDev avatar MabezDev commented on June 19, 2024 1

0.4.0 has been release which includes the changes to fix this issue.

from stm32l4xx-hal.

vertexclique avatar vertexclique commented on June 19, 2024

Any update on this?

from stm32l4xx-hal.

hellow554 avatar hellow554 commented on June 19, 2024

It has been merged, but AFAICT no new version hasn't been pushed. @MabezDev what's the status?

from stm32l4xx-hal.

vertexclique avatar vertexclique commented on June 19, 2024

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.

MabezDev avatar MabezDev commented on June 19, 2024

Although the patch has been merged, we are still waiting for @adamgreig to cut a new release of stm32-rs.

from stm32l4xx-hal.

MathiasKoch avatar MathiasKoch commented on June 19, 2024

I am also seeing this issue. What is the status on getting it resolved? Any workarounds until then?

from stm32l4xx-hal.

hellow554 avatar hellow554 commented on June 19, 2024

@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.

hellow554 avatar hellow554 commented on June 19, 2024

ping @adamgreig !

from stm32l4xx-hal.

MathiasKoch avatar MathiasKoch commented on June 19, 2024

@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.

vertexclique avatar vertexclique commented on June 19, 2024

@smilykoch you need to invoke svd2rust with make. Previously generated ones will reside in the project dir.

from stm32l4xx-hal.

MathiasKoch avatar MathiasKoch commented on June 19, 2024

How do i do that? I am still fairly new in the embedded rust world ;)

from stm32l4xx-hal.

MathiasKoch avatar MathiasKoch commented on June 19, 2024

@vertexclique Could you maybe teach me what you mean when you say "invoke svd2rust with make"?

from stm32l4xx-hal.

MathiasKoch avatar MathiasKoch commented on June 19, 2024

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.

MathiasKoch avatar MathiasKoch commented on June 19, 2024

Hi.

Great! It seems to work! Thank you very much!

from stm32l4xx-hal.

twilco avatar twilco commented on June 19, 2024

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.

twilco avatar twilco commented on June 19, 2024

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.

MabezDev avatar MabezDev commented on June 19, 2024

@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.

mathk avatar mathk commented on June 19, 2024

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.

MabezDev avatar MabezDev commented on June 19, 2024

Ah okay. I've opened a PR on stm32-rs that should add support for the l4x3 chips.

from stm32l4xx-hal.

hellow554 avatar hellow554 commented on June 19, 2024

Merged, can this be closed again?

from stm32l4xx-hal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.