2018-09-03 12:09 AM
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 :
The only differences seem to be the internal I2C peripheral and the CubeMX HAL driver.
2018-09-04 03:31 AM
Hi @YBOUR ,
Try to check the I2C1 registers content on debug mode:
I assume that stretch is supported by the master as it is working with STM32F3.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-09-06 05:41 AM
Amel,
Regards,
Yvan
2018-09-07 12:21 AM
@Amel NASRI
Another new additionnal tests :
Yvan
2018-09-14 12:58 AM
Hi,
The ACK bit is only set after having called the HAL_I2C_Transmit_IT() or HAL_I2C_Receive_IT(). The ACK bit can not bit set before calling these functions, because they start by checking that the I2C bus is free (by testing the BUSY bit).
The FMPI2C1, present on the STM32F446 doesn't have the issue because the ACK has been replaced by a NACK bit in CR1 and the reset value allows to aknowlege in case of address match.
Best regards
Laurent
2018-09-14 01:52 AM
Hi @Laurent BEYLY ,
Thanks for your answer and explanations. But at this point, we can not change the hardware link by using other pins.
It's a big problem for us...
Regards,
Yvan
2019-12-10 03:01 AM
Hello,
Please note that the fix is available in the patch 1.24.2 of STM32CubeF4 package (already available on the web).
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.