2023-05-09 11:22 AM
2023-05-11 01:39 AM
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 internal peripheral - stm32mpu
I2C device tree configuration - stm32mpu
Hope it help
Olivier
2023-05-11 11:12 AM
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 */
};
};
2023-05-11 01:27 PM
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 ?
2023-05-15 01:07 AM
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 :
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