FMPI2C (STM32F446) working as I2C slave is not releasing the SDA line after ACK
- November 25, 2019
- 6 replies
- 3101 views
Hi
The STM is configured as NOSTRETCH=1 and connected to a RL78 which acts as master. The whole configuration is used to test the SW on the RL78. The STM is emulating a number of I2C devices. The RL78 can not handle clockstreching on the used ports.
Sending from RL78 to STM works fine.
But when receiving data from the STM the correctness of the transfer depends on the transmitted data (bit7).
I have to load a new databyte into TXDR on each TXIS interrupt, as I don't know how many bytes the RL78 is requesting.
If bit7 of the databyte is 1 and the RL78 is sending a stop condition everything works fine (I2Cslave_8a.png).
If bit7 of the databyte is 0, then the RL78 can not send a stop. It seams that the STM is already putting the bit7 on the SDA which is then corrupting the stop from RL78 (I2Cslave_4a.png).
Does anybody have an idea where I did something wrong?
I attach my interrupt service routine. There is a number of lines added to debug.
Best regards, Tom
