AnsweredAssumed Answered

STM32f746 - I2C Busy flag stuck after a few reads

Question asked by sleziak.marcin on Jan 20, 2018

Hey, I am currently using HAL_I2C_Mem_Read_IT() to read out data of a capacitive touchscreen sensor.

The call works perfectly for the first 10-100 interactions, the interrupt fires HAL_I2C_MemRxCpltCallback() is triggered and my buffer contains valid data.


The problem is that after a couple reads the I2C4 busy gets set to busy, and is never cleared.


My code looks similar to this:

void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c) {
void GT811_Scan(void) {
    dev_state =  HAL_I2C_Mem_Read_IT(&hi2c4, GT811_CMD_RD, GT811_READ_XY_REG, I2C_MEMADD_SIZE_16BIT, touchDatasizeof(touchData));

I have 10k pull-up and used CubeMX to generate my initialization code (Which i assume is correct as I can receive data for a bit).


Here is a screenshot of my output:

You can see that the last time shows I2C State :1, followed by no future events.