cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to set up a I2C slave using a STM32F103C8Tx

JGaby.1
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
JGaby.1
Associate II

I believe I found the problem. The i2c interrupt events were not enabled.

View solution in original post

1 REPLY 1
JGaby.1
Associate II

I believe I found the problem. The i2c interrupt events were not enabled.