Visitor II
November 6, 2019
Question
Trouble establishing I2C communication between 2 STMs
- November 6, 2019
- 1 reply
- 898 views
I am trying to establish I2C communication between 2 STMs. The master is NUCLEO-L432KC and the slave is NUCLEO-L412KB. I changed the address of slave in cubeMX to 0x01 which is in the 7-bit address format. But I am not able to send or receive data. The function HAL_I2C_IsDeviceReady(&hi2c1,0x02,2,10) returns HAL_BUSY all the time.
I powered the master using a usb connector to laptop and the other STM i.e; slave uses 5v pin from master STM.
I attached the master and slave codes below.
Thank you in advance