handwired/onekey/blackpill_f401: Fix I2C pin config mismatch #10322
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.
Description
By default the
i2c_master
driver for ChibiOS uses the B6 pin forI2C1_SCL
and the B7 pin forI2C1_SDA
. However, the ChibiOS board file used for the F401 Blackpill board (ST_STM32F401C_DISCOVERY
) configures B6 asI2C1_SCL
and B9 asI2C1_SDA
, and if that configuration is left unchanged, enabling thei2c_master
driver results in having two pins (B7 and B9) configured asI2C1_SDA
at the same time, which does not work properly (experimental results show that the B9 pin still works asI2C1_SDA
in that case, and the B7 pin does not work).Configure the B9 pin as an input with pull-up in
board_init()
, so that the B7 pin can be configured asI2C1_SDA
by the I2C driver.Tested on a Blackpill board marked “WeAct V3.0” with STM32F401CCU6 and several OLED displays (with a keymap for OLED testing which will go in a separate PR).
Note that
handwired/onekey/blackpill_f411
does not need a similar change, because its ChibiOS setup is based on theST_NUCLEO64_F411RE
board definition, which does not configure any pins for I2C1-related alternate functions.Types of Changes
Checklist