-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for stm32l4r5 #292
base: master
Are you sure you want to change the base?
Conversation
Test repository: https://github.com/gauteh/swan-stm32l4r5-quickstart Flashes and runs fine with probe-run. |
Blinking is working, but I couldn't get the clock to work with 8Mhz: https://github.com/gauteh/swan-stm32l4r5-quickstart/blob/main/src/main.rs#L26, blinking and printing happily with the other clock though. Maybe @jspngh has an idea about whether this is supposed to work on r5 or r9? |
Think I understand. Default configuration the sysclk is 4MHz, so 4 / 8 becomes 0. I think this assert: https://github.com/stm32-rs/stm32l4xx-hal/blob/master/src/rcc.rs#L635 should be raised to 120Mhz. Would be interesting to see if we could make the 0 verified at compile time and not a runtime error. |
I can't immediately explain what's going wrong. If you have the option to step through the let clocks = rcc
.cfgr
.hse(
24.MHz(),
CrystalBypass::Disable,
ClockSecuritySystem::Disable,
)
.pll_source(hal::rcc::PllSource::HSE)
.sysclk_with_pll(80.MHz(), PllConfig::new(3, 20, PllDivider::Div2))
.pclk1(40.MHz())
.pclk2(40.MHz())
.freeze(&mut flash.acr, &mut pwr); |
Thanks, I am unfamiliar with the way of configuring the clocks. Seems like there are several roads to the same goal. |
I'm excited for this! I got the example working on a NUCLEO-L4R5ZI that I have. I'm hoping to get USB serial working. |
add stm32l4r5 to otg_fs feature list
Add support for stm32l4r5, requires: stm32-rs/stm32-rs#703
Based on #270 , also adds support for ADC1 which might be useful for r9. Not much tested yet.