cancel
Showing results for 
Search instead for 
Did you mean: 

pins_a and pins_b and pins_c for i2c2 so what is the effect of configuring multiple sets of pins for i2c2? Are they sharing i2c2 bus ? Are they sharing the driver ? Is it always better to configure another bus eg. i2c5 instead of i2c2_pins_b ?

DYenEmbedded
Associate III
 
4 REPLIES 4
Olivier GALLIEN
ST Employee

Hi @DYenEmbedded​ ,

Sorry I don't understand your question. Could you please elaborate further?

For generic introduction to I2C, did you already browse our wiki resources :

I2C overview - stm32mpu

I2C internal peripheral - stm32mpu

I2C device tree configuration - stm32mpu

Hope it help

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
DYenEmbedded
Associate III

Olivier and others, I need 3 i2c buses to prototype on STM32MP157F-DK2. i2c5,i2c6 collide on PA12,PA11 for using UART4 for STLink. i2c4 collides for using USB-C power. I am using i2c2_pins_a on PD7,PG15. If I configure i2c2_pins_b on PF1,PF0 will it work if the addresses are unique? Sadly PH4,PH5 are not brought out on board to configure i2c2_pins_c. Then are these all sharing i2c2 400kHz? For our custom board, really want to have i2c5 on PD1,PD0 and i2c6 and i2c3 on PA8,PC9.

Yes, I have read the stm I2C resources. It has been hard to find out about the suffixes: _a, _b, _c.

So here are stm32mp15-pinctrl.dtsi entries for i2c2:

i2c2_pins_a: i2c2-0 {

pins {

pinmux = <STM32_PINMUX('D', 7, AF4)>, /* I2C2_SCL */

<STM32_PINMUX('G', 15, AF4)>; /* I2C2_SDA */

bias-disable;

drive-open-drain;

slew-rate = <0>;

};

};

i2c2_sleep_pins_a: i2c2-sleep-0 {

pins {

pinmux = <STM32_PINMUX('D', 7, ANALOG)>, /* I2C2_SCL */

<STM32_PINMUX('G', 15, ANALOG)>; /* I2C2_SDA */

};

};

i2c2_pins_b1: i2c2-1 {

pins {

pinmux = <STM32_PINMUX('F', 1, AF4)>, /* I2C2_SCL */   

  <STM32_PINMUX('F', 0, AF4)>; /* I2C2_SDA */

bias-disable;

drive-open-drain;

slew-rate = <0>;

};

};

i2c2_sleep_pins_b1: i2c2-sleep-1 {

pins {

pinmux = <STM32_PINMUX('F', 1, ANALOG)>, /* I2C2_SCL */   

  <STM32_PINMUX('F', 0, ANALOG)>; /* I2C2_SDA */

};

};

i2c2_pins_c: i2c2-2 {

pins {

pinmux = <STM32_PINMUX('H', 4, AF4)>, /* I2C2_SCL */

<STM32_PINMUX('H', 5, AF4)>; /* I2C2_SDA */

bias-disable;

drive-open-drain;

slew-rate = <0>;

};

};

i2c2_pins_sleep_c: i2c2-sleep-2 {

pins {

pinmux = <STM32_PINMUX('H', 4, ANALOG)>, /* I2C2_SCL */

<STM32_PINMUX('H', 5, ANALOG)>; /* I2C2_SDA */

};

};

DYenEmbedded
Associate III

stm32mp15-pinctrl.dtsi above did not work for PF1,PF0 as i2c2_pins_b while it still worked for i2c2_pins_a at PD7,PG15 for I2C_SCL,I2C_SDA. Would really have liked STM32MP157F-DK2 to have brought out I2C3_SDA and i2c5, i2c6 onto CN2 at any of CN2 pins: 11,12,19,21,22,26,36,38. Is there an STM32MP157G-DK2 coming that will do this ?

Olivier GALLIEN
ST Employee

Hi @DYenEmbedded​ ,

For sure no alternate version of DK2 board is foreseen.

I'm not 100% sure it could be possible but I recommend to use CubeMX with a project for DK2 board in order to ease your pinout experiment.

So far I didn't see any issue to use I2C5 or I2C6 on PA12,PA11 which are free. ( available on Arduino CN13)

Enabling I2C2 allocate PF1, PG15 by default with are available on CN2

Indeed looks more complex to map a third free instance. ( I2c3 or i2c6 conflict) but it may be possible to use I2C1 taking into account the warning :

  1.  Warning: the I2C1 is used to communicate with several on-board peripherals, but is also available on the GPIO expansion connector. So, it is important to ensure that new components added on the I2C1 connection will not disturb the bus behavior.

For a,b,c meaning please refer to :

Pinctrl device tree configuration - stm32mpu

This is to handle some board diversity. In you case please consider to use only one set.

Hope it help,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.