Skip to content
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

boards: stm32: Fix Arduino I2C on Nucleo-WL55JC #76948

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kartben
Copy link
Collaborator

@kartben kartben commented Aug 12, 2024

Fixed wrong I2C bus being enabled (i2c2 instead of i2c3) and corresponding arduino nexus mappings so that I2C works correctly on Arduino shields attached to Nucleo-WL55JC.

image

mniestroj
mniestroj previously approved these changes Aug 12, 2024
Copy link
Collaborator

@marwaiehm-st marwaiehm-st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

boards/st/nucleo_wl55jc/doc/nucleo_wl55jc.rst Outdated Show resolved Hide resolved
&i2c2 {
pinctrl-0 = <&i2c2_scl_pa12 &i2c2_sda_pa11>;
&i2c3 {
pinctrl-0 = <&i2c3_scl_pb13 &i2c3_sda_pb14>;
pinctrl-names = "default";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right on CN8 A4 (PB14) & A5 (PB13) are i2c3 pins
but that's also right that on Arduino connector CN5 D15 (PA12) and D14 (PA11) are i2c2 pins.
Is it needed to remove i2c2 node ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I can keep its configuration in the devicetree but leave it as disabled by default. wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the shield PoV, most of the time, I2C is connected on the Arduino connector CN5 pin10 & 9 = D15/D14
and the arduino header pin 5 ( = A5) is used for another function.
Example of x_nucleo_iks4a1,
&arduino_i2c {
...
irq-gpios = <&arduino_header 5 GPIO_ACTIVE_HIGH>; /* A5 */
...};

Is there any side-effect changing the i2c node for the arduino connector ?

Screenshot from 2024-08-13 14-09-28

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can keep its configuration in the devicetree but leave i

yes, please

@erwango
Copy link
Member

erwango commented Aug 29, 2024

@kartben A Rebase would be needed.

Fixed wrong I2C bus being enabled (i2c2 instead of i2c3) and
corresponding arduino nexus mappings so that I2C works correctly on
Arduino shields attached to Nucleo-WL55JC.

Signed-off-by: Benjamin Cabé <[email protected]>
Copy link
Collaborator

@str4t0m str4t0m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really an fix/improvement tough? The pins of the existing configuration are labeled SCL/SDA on the board.
In a quick search at the arduino store the few boards listed also seem to assume the I2C pins to be available on D14/15.
Also the newer Mikroe shields seem to use the D14/D15 pins.
As well as the X-Nucleo boards I know, all use the D14/15 pins.
Arduino Uno up to the latest Rev4 seem to have wired both these options together, so I'm wondering if there still that many old shields with A4/A5 pins used for I2C.

What do you think about using the arduino_i2c label only for D14/D15 on boards with an uno header and introduce a separate node label as fallback option that shields using I2C only on A4/A5 define and boards may define if they provide I2C on that pins?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants