Repository navigation
stm: correct alternate functions in six pin tables - #11902
Merged
Merged
Conversation
Checking every I2C, SPI, UART and timer entry in the STM pin tables against ST's pin data (STM32_open_pin_data) found 33 entries in six tables whose alternate function doesn't connect the signal to the pin: - F401, F411, F412Zx, F446: TIM10_CH1 on PB8 and TIM11_CH1 on PB9 are AF3, not AF2, which selects TIM4. - F401: SPI4_NSS isn't available on PB12 (it is on the F411); removed. - L433: USART2_RX on PA15 is AF3, not AF7. - L433, L4R5: TIM15 and TIM16 are AF14, not AF15 (EVENTOUT). - L4R5: UART4 and UART5 are AF8, not AF9. PWMOut on a pin that got one of these timers had no output, and UART4 and UART5 on the L4R5 didn't work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
@bablokb would you be interested in testing? |
vegardw
added a commit
to vegardw/circuitpython
that referenced
this pull request
Nov 19, 2026
Brings in the FSMC parallel display bus (adafruit#11908) and the pin-table fixes (adafruit#11902), now merged upstream. The display-bus code was already the same here, so the merge had no conflicts. The tree is now main plus the board commit, the board README and Stage at the commit that adds this board. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrects 33 entries in six STM32 pin tables whose alternate function (AF) doesn't connect the signal to the pin, according to ST's pin data.
Problem
PWMOutandbusiouse the first usable table entry for a pin and switch the pin to that entry's AF. These entries have the wrong AF:Fix
Use ST's AF for each entry, and remove SPI4_NSS on PB12 from the F401 table. The values come from the GPIO files (
mcu/IP/GPIO-*_Modes.xml) in ST's STM32_open_pin_data, the data CubeMX uses. The other tables agree: F405, F407 and F412Cx already have AF3 for TIM10/TIM11, and the L4R5 table has AF3 for USART2_RX on PA15.Testing
ru), Espruino Pico, F411 BlackPill, F412ZG Discovery, Nucleo F446RE, Blues Cygnet, Swan R5The table check compared each entry's AF with the one ST lists for that signal on that pin; I can share the script. The hardware check used the ELECFREAKS Retro Arcade (STM32F412RE; MCU support in #11896, the board isn't upstream yet), whose display backlight is on PB9, with the same AF2 → AF3 change in its tables; the script ran over USB and I watched the backlight. Not tested on hardware: the L4 changes, and boards with the F401, F411, F412Zx and F446 tables; I don't have them. Could someone with a Swan R5 or a Blues Cygnet run the test below?
How to run the test
Set the pins at the top of the script for your board (the comments list them), connect the jumper, copy the script as
code.pyand watch the serial console. Expect PASS with about 20 edges, and on the Swan R5 PASS for the UART. Without this PR: FAIL with 0 edges, and no data on UART4/UART5.pin_table_test.pyTrade-offs and Alternatives
None: the change only corrects table data.
Generative AI
I used generative AI (Claude Code) to find and test this change. I have reviewed it, and I am responsible for the code and this description.
🤖 Generated with Claude Code