-
Notifications
You must be signed in to change notification settings - Fork 49
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
[STM32G0B1] Can't compile quickstart #44
Comments
It looks like there's a PAC error on several G0 models including that one, wherein many registers are missing: (stm32-rs/stm32-rs#548). It was fixed in November: (stm32-rs/stm32-rs#666). but hasn't made it into an |
Fixed with PAC update |
Nvm still having a struggle with these variants even after the update. Could probably eliminate certain features or fight through it. |
Is there any way I could provide some help here? I tried compiling the stm32g0-crate with the new SVDs from STM released in march, which compiled fine as far as I could tell when I swapped out the SVD for the G0B1. I then tried to link it to the HAL here, but this resulted in the attached buildlog when running
Forgot to mention: When i checked the STM-RS project, they were still using the 1.3 SVDs in their current 0.15.1 release, I tried to swap them out for version 1.5 but this yielded the result above. |
That's an easy fix on the HAL side. Before proceeding with that fix, we'd need to get your new SVD build in a stm32-rs PAC release. Any luck convincing those guys to merge/release? If you'd like to use a fork of this HAL with your custom built PAC and a path or git dep on it, you'd just need to modify the related feature gate code to excempt the relevant G0 variants from the line that uses DMA as DMA1. |
784: Updated SVD for g0b1 and g0c1 to 1.5 r=newAM a=adamt55 As mentioned [here](David-OConnor/stm32-hal#44), I am trying to get HAL support for the G0B1 nucleo board working. I saw that the current SVD is tagged as version 1.3 in the XML. This PR just swaps out this SVD to version 1.5 provided by STM. The crate compiles fine on my machine, if there are any obvious issues with the different SVD let me know. New to embedded, any pointers are appreciated. Co-authored-by: adamt55 <>
Thanks for the input. I got the SVD patch in the stm32-rs repo and they build their nightly-repo accordingly (no new release yet though). What do you mean by excempting my variant from the DMA as DMA1 line? I wrote a feature gate that disabled those |
I just reread your error log. I didn't realize there were multiple types of error:
That looks like a critical ommission of the PAC that will need to be patched
This is a small change to an import line, but it's no longer relevant due to changes I've been making to the DMA API over the past few days.
This section of the cfg_if! {
if #[cfg(all(feature = "g0", not(any(feature = "g0b1", feature = "g0c1"))))] {
use crate::pac::dma as dma_p;
use crate::pac::DMA as DMA1;
} else if #[cfg(feature = "f4")] {} else {
use crate::pac::dma1 as dma_p;
use crate::pac::DMA1;
}
} These errors were from after your the updated SVD? Then the SVD needs to be patched - specifically to add the RCC register block at minimum. Also, I'm surprised about the other errors, as they show a PAC layout different from the other G0s. Using the YAML patch styles you see in PRs on the |
Thanks for the pointers, I will get into trying to fix this issue this weekend. Yes, the log is from after running it with the current SVDs from ST. I will try and see if I can figure out how to port the mapping of the RCC registers in the STM32-RS PAC for the G0B1 from the G071, since the block diagram from the documentation looks very similar.
Is this a function only of the applied patches or also of the ST provided SVDs? I just noticed that the G0B1.yaml doesn't contain a couple of different "common_patches", which are applied to the G071 for example:
|
I think it's likely the common patches may fix some or all of the problems. What probably happened is the SVD for all G0s had errors; patches were applied to the |
Alright, I tried fixing some stuff on the PAC as well as some stuff on the HAL. I am down to these errors, which I cannot really wrap my head around. It seems something with the DMA is screwed, or maybe I named the fields wrong somehow? Do you have some insights on that maybe? I've opened a PR on the PAC here. I'll open a PR on the changes I've made and maybe you could point me to something there. |
Nice work! Re the DMA stuff: It's likely that the PAC is set up differently for these variants, for one reason or another. For example, this error: error[E0615]: attempted to take value of method `ch1` on type `D`
--> src/dma.rs:692:46
|
692 | let ccr = &self.regs.ch1.cr;
| ^^^ method, not a field Current code: cfg_if! {
if #[cfg(any(feature = "f3", feature = "g0"))] {
let ccr = &self.regs.ch1.cr;
} else {
let ccr = &self.regs.ccr1;
}
} Future code: cfg_if! {
if #[cfg(any(feature = "f3", feature = "g071, g081 (etc)"))] {
let ccr = &self.regs.ch1.cr;
} else if #[cfg(feature = "g0b1")] {
let ccr = &self.regs.ccr1();
else {
let ccr = &self.regs.ccr1;
}
} Of note, the DMA module for variants other than H7 is a bit of a mess due to the way the channels are meched in the PAC. The H7 PAC has nice array fields though. |
Attempting to clean build the quickstart repository for STM32G0B1 using the thumbv6m-none-eabi toolchain fails with many errors: g0_build_errors.txt.
All I have done is clone the repository, change the toolchain, and alter the feature gates in Cargo.toml to "g0b1" and "g0rt". Cargo seems to be building the library against stm32g0 v0.14.0 and cortex-m v0.7.5.
The text was updated successfully, but these errors were encountered: