2023-10-22 11:41 PM
I am trying to use the external i2c connector (CN4) on the STM32H753I-Eval2 board to connect with the i2c connector (CN2) on STM32F769I discovery board. STM32H753I works as master and STM32F769I works as slave.
On STM32H753I, the function "HAL_I2C_Master_Transmit(&hi2c1, 0x20, TxBuffer, TXBUFFERSIZE, 1000)" is used to write data. It always fails at "I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, tickstart)" with the error of timeout. It seems the slave ACK is never received on the master board. I use STM32CubeMX to create the code and "MX_I2C1_Init()" return without any error. I also follow steps here to set up I2C1 in STM32CubeMX (https://wiki.st.com/stm32mcu/wiki/Getting_started_with_I2C#I2C_settings).
Any insight is appreciated! Thanks!
Solved! Go to Solution.
2023-10-25 02:13 PM
Now I use I2C2 on the NUCLEO-H743ZI board as the slave device but the master board still cannot find the slave device. I2C1 on the master board is connected to the I2C2 on the slave board, so the PB6(I2C_SCL) and PB7(12C_SDA) of CN4 from the STM32H753I-EVAL2 board are connected to PF1(SCL) and PF0(SDA) of CN9 from the NUCLEO-H743ZI board. I notice that the I2C2 clock frequencies is different from I2C1's. Please see attached pictures. Could it be a problem?