2024-10-03 10:11 AM
I am currently working on I2C communication with the STM32G030F6P6 microcontroller and developing a library for slave mode. I encountered an issue where, after the master transmits a command, the slave receives and processes the data, responding accordingly. However, when the command doesn't match the expected input and the master sends a receive request, clock stretching occurs. If anyone has insights on how to handle or resolve this, I would appreciate your suggestions
2024-10-03 02:00 PM
Hello @dhirrajsharma,
Did you check the Errata sheet related to your device?
Try enable the I2C listen mode to handle address match events.
2024-10-06 09:39 AM
What will happen if the master requests data from the slave, but the slave does not have a function for transmission? In the transfer direction for transmission, I have enabled the listen mode, which results in a NACK and pulls up both the SDA and SCL lines. If the master attempts to transmit or request data again, the status shows HAL_BUSY, or the master gets stuck in the transmitting state.
2024-10-06 09:41 AM - edited 2024-10-06 09:42 AM
2024-10-07 05:36 AM
What you can try to to implement a reply as "no info available" equivalent reply, so that i2c bus is happy and the master knows that particular slave do not have that functionality implemented.