You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that the SVDs for the F3 family (didn't check others) are quite broken with regard to GPIO reset values.
Looking at the RMs, all MCUs in that family have the same debug pins (PA13, PA14, PA15, PB3, and PB4) which are enabled by default. It follows that for all these devices GPIOA and GPIOB are special, while the other ports are all the same. So the PACs should have three modules, gpioa, gpiob, and gpioc for every subfamily. While this is the case for some, others, like stm32f303, only have gpioa and gpiob.
Let's take a deeper look at the correct reset values vs. what the PACs/SVDs think is correct.
Correct GPIO Reset Values
From the RMs, these should be the correct reset values:
There is some uncertainty here because the RMs are not the most reliable source of this information:
Some RMs (F302, F373, F334) list the reset values for the GPIO{C,D,E,...} PUPDRs as 0x0C00000. That means that PUPDR13 is set to 0b11 which is a reserved value, so I'm not sure that is correct.
The F334 RM lists the reset value for the GPIOA OSPEEDR as 0x64000000, but also as 0x7c00000 in another table. The SVD knows another value entirely (see below).
I unfortunately don't own any of these boards, otherwise it would be easy to gather the right values. I checked on an F303 and the reset values there match the once I listed above.
Reset Values Reported by the PACs
Here are the reset values currently known to the PACs, by sub-family feature. Again I left out zero-values. Wrong values are marked.
This looks good, apart from the GPIO{C,D,F} PUPDR. But as mentioned above, this would be correct according to some RMs, so we can give it the benefit of the doubt.
The register reset values are completely off here. The SVD thinks that GPIOB resets to all-zero, which explains why for these sub-families we only have two gpio* modules in the PAC.
So from what I gather, we need to at least fix the following sub-families:
stm32f302
stm32f303
stm32f373
stm32f3x8
This issue currently blocks a refactor of the GPIO module in the stm32f3xx-hal (stm32-rs/stm32f3xx-hal#129), so I'm very interested in getting this fixed. I'm new to svd2rust, so if anyone could give me any guidance to what needs to be done, that would be great!
The text was updated successfully, but these errors were encountered:
It appears that the SVDs for the F3 family (didn't check others) are quite broken with regard to GPIO reset values.
Looking at the RMs, all MCUs in that family have the same debug pins (
PA13
,PA14
,PA15
,PB3
, andPB4
) which are enabled by default. It follows that for all these devices GPIOA and GPIOB are special, while the other ports are all the same. So the PACs should have three modules,gpioa
,gpiob
, andgpioc
for every subfamily. While this is the case for some, others, likestm32f303
, only havegpioa
andgpiob
.Let's take a deeper look at the correct reset values vs. what the PACs/SVDs think is correct.
Correct GPIO Reset Values
From the RMs, these should be the correct reset values:
GPIOA:
GPIOB:
All values left out are
0x0000_0000
.There is some uncertainty here because the RMs are not the most reliable source of this information:
0x0C00000
. That means that PUPDR13 is set to0b11
which is a reserved value, so I'm not sure that is correct.0x64000000
, but also as0x7c00000
in another table. The SVD knows another value entirely (see below).I unfortunately don't own any of these boards, otherwise it would be easy to gather the right values. I checked on an F303 and the reset values there match the once I listed above.
Reset Values Reported by the PACs
Here are the reset values currently known to the PACs, by sub-family feature. Again I left out zero-values. Wrong values are marked.
stm32f301
GPIOA:
GPIOB:
GPIO{C,D,F}:
This looks good, apart from the GPIO{C,D,F} PUPDR. But as mentioned above, this would be correct according to some RMs, so we can give it the benefit of the doubt.
stm32f302 / stm32f303 / stm32f373
GPIOA:
GPIOB:
The register reset values are completely off here. The SVD thinks that GPIOB resets to all-zero, which explains why for these sub-families we only have two
gpio*
modules in the PAC.stm32f3x4
GPIOA:
GPIOB:
GPIO{C,D,F}:
Both values that deviate here are values that the RM also is uncertain about, so for all we know this might actually be correct.
stm32f3x8
GPIOA:
GPIOB:
GPIOH:
Again, this is completely wrong.
So from what I gather, we need to at least fix the following sub-families:
This issue currently blocks a refactor of the GPIO module in the stm32f3xx-hal (stm32-rs/stm32f3xx-hal#129), so I'm very interested in getting this fixed. I'm new to svd2rust, so if anyone could give me any guidance to what needs to be done, that would be great!
The text was updated successfully, but these errors were encountered: