Closed dbrgn closed 4 years ago
I have verified this PR against an STM32L071KBTx MCU and at least I2C1 seems to work properly.
@dbrgn Looks like #68 has a few merge conflicts with this PR
@dbrgn Looks like #68 has a few merge conflicts with this PR
Yup, I just rebased the branch. Let's hope I resolved the conflicts correctly & the tests pass again :slightly_smiling_face:
Looks good! Thanks!
The GPIO internal peripheral (IP) does not match the stm32l0x/stm32l0x2/stm32l0x3 grouping used in the PACs. Instead, there are 4 different GPIO IPs in the STM32L0 family that define how the pin functions are mapped to the actual pins. This means that the current I2C mappings are broken for a lot of MCUs. For reference, these issues have already been opened because the mappings were broken:
We can use the
io-*
Cargo features to differentiate between these mappings. This requires that the properio-*
feature is set when compiling (and is thus a breaking change). The easiest way to apply the feature without looking at the STM32CubeMX database XML files is to simply use the propermcu-*
feature, for examplemcu-STM32L071KBTx
.The pin mappings used in this changeset were taken out of the cube-parse output for the STM32L0 family. The output can be found here. To re-generate:
The source files in the STM32CubeMx database used to generate the mappings:
More information on the database format can be found in the cube-parse README.
The long-term solution should probably be a universal pin mapping file generated by cube-parse, but with the current APIs this would be a major refactoring. Therefore a manual fix must suffice for now.
Fixes #76, fixes #77, fixes #85.
CC @rnestler @DanSGiesbrecht @ijager