2025-07-24 7:07 AM
I need to send a single address byte with write bit and read bit.
For the write, I'm using
HAL_I2C_Master_Transmit_IT(&hi2c4, I2C_ADDRESS, (uint8_t*)i2c_buff, 0)
It works perfect, it sends a start, single address with write bit cleared, slave device ACK's and stop works fine.
I need the exact same thing, but with the read bit set.
I tried:
HAL_I2C_Master_Receive_IT(&hi2c4, I2C_ADDRESS, (uint8_t*)i2c_buff, 0)
It just sends the start, address, read bit set, slave device ACK's ok, but then MCU doesn't do the stop bit, gets stuck infinitely waiting. I've tried using the LL drivers too, and also played around with disabling AUTOEND and using SOFTEND to try to manually generate start, send addr and then stop, no go, just waits for the I2C_ISR_STOPF flag to be set, which never happens. On the scope, SCL goes high, but SDA stays low.
Any ideas? Using STM32U535, I2C4