2022-03-21 09:39 AM
I used STM32CubeIDE to create the project. The configuration that I used for the i2c is attached. I generated the code and added the following code in the "USER CODE BEGIN 2" section right after the call to MX_I2C_Init(). I made no other changes.
uint8_t buf[16];
HAL_StatusTypeDef ret = HAL_I2C_Slave_Receive_IT(&hi2c1, buf, sizeof(buf));
When I try and transmit some data to the device, the address is received and acknowledged after which the slave drives the SDA line low and holds it there forever (see the attached timing image).
What am I doing wrong?
Thanks.
Solved! Go to Solution.
2022-03-21 12:48 PM
I believe I found the problem. The i2c interrupt events were not enabled.
2022-03-21 12:48 PM
I believe I found the problem. The i2c interrupt events were not enabled.