HAL CubeMX I2C slave NACK problem (STM32F446)
Technical environment :
- Master : CM3 (Raspberry)
- Slave : STM32F446
- CubeMX : V4.23 (even tested with V4.26.1)
- Normal transaction is : MASTER do a 4 bytes WRITE, then a 1 byte WRITE and at last, a 4 bytes READ.
The slave ACKed the WRITEs, but the READ command is NACKed by the slave (logic analyser view).
I have this problem when I have a delay (more than 1 ms) between the end of the second WRITE (STOP bit) and the HAL_I2C_Slave_Transmit_IT() call.
Without this delay, everything seems OK.
EDIT :
I’ve tested this same scheme on a :
- new CubeMx I2C slave project on a STM32F302 board : the slave does a clock stretching with the same code. So, even with the delay, on the F302, the transaction will be OK.
- new CubeMx I2C slave project on a NUCLEO F446RE board : same problem than our customer board...
- new CubeMx I2C slave project on a STM32F0308 - DISCO board : clock stretching is present, everything seems to be OK
- new CubeMx I2C slave project on a STM32F767 NUCLEO board : clock stretching is present, everything seems to be OK
The only differences seem to be the internal I2C peripheral and the CubeMX HAL driver.
