Replies: 1 comment
-
This HAL is a lot more bare-bones than the ST provided C-HAL at the moment. For setting up clocks there may be equivalent functions in the RCC module: https://docs.rs/stm32wlxx-hal/latest/stm32wlxx_hal/rcc/index.html Otherwise it's a matter of tracking down the registers the C-HAL uses and sequencing the same in the rust HAL via the peripheral access crate. This is rather tedious because of the layers of abstraction in the C-HAl, generally I read the reference manual and write the register sequences from that instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
So far, my firmware codebase has been written in C and CPP combined with HAL drivers provided by STM32, but since there are a lot of ongoing issues, I had this idea to give Rust a try and see if it could be a better alternative.
Now, here's the issue; I'm not exactly a Rust expert (especially when it comes to Rust embedded). And as soon as I started, I hit a bunch of roadblocks. The main one right now is configuring the clocks. In the C HAL, there's a handy function that lets me set up all the necessary parameters, but I was unable to find the Rust alternative to it.
Would anyone be able to help me? I'm attaching a snippet of the current clock config written in C.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions