-
Notifications
You must be signed in to change notification settings - Fork 128
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
Is there a guide to adding alternate pins? #560
Comments
the data comes from XMLs like this one that are provided by ST as part of STM32CubeMX, and parsed by this code. which AF is missing? I'd start by checking the XML to see if it's in some "special" format that |
I don't have anything exhaustive, I was just trying to generate an embassy-rs SPI3 instance for an STM32G474CE, and it would not accept pin PC12 as a SPI3_MOSI pin, which the data sheet lists as being available under Alternate Function 6 (see page 75/236.).
However, it does appear to be present in the XMLs https://github.com/embassy-rs/stm32-data-sources/blob/1a3751550575f8ffee5e45307713a3e08bc9ffb4/cubedb/mcu/IP/GPIO-STM32G47x_gpio_v1_0_Modes.xml#L3337-L3359, so I'm not exactly sure how it would end not working with the compiled code. |
STM32G474CE only exists in two packages STM32G474CETx (LQFP48), STM32G474CEUx (UFQFPN48), both of which don't have the PC12 pin. So it's correct that you can't use PC12 for SPI3_MOSI, because PC12 doesn't exist at all. However, due to reasons, AFs for non-existing pins are filtered out, but the pins themselves aren't, so |
Oof, that's a very interesting gotcha. In a sense, the type system did an amazing job, cause it caught a perfectly valid and fairly expensive potential error (I was using the wrong microcontroller!), albeit with a root cause that was pretty hard to understand. Thanks for the help, I really appreciate it :) |
the ghost pins were bothering me so I fixed them: 2624ca6 and embassy-rs/embassy#3738 change codegen so non-existing pins are completely gone now, so |
Absolutely amazing, thank you so much! |
I'm currently trying to write a firmware for an existing board which uses alternate function pins which are not mapped in the PAC for embassy-stm32. Is there any guidance on how those alternate functions could be added to this repo?
The text was updated successfully, but these errors were encountered: