2023-07-06 09:20 AM - edited 2023-07-06 09:23 AM
Hi all,
I am using a Nucleo F334R8 STM32Cube FW_F3 V1.11.4
I am trying to configure it as a slave device using interrupts , I am using HAL_I2C_AddrCallback()then it checks if dirrection == I2C_DIRECTION_TRANSMIT and HAL_I2C_Slave_Seq_Receive_IT() works fine.
Problem comes when other direction is triggered , for some reason the first byte when using HAL_I2C_Slave_Seq_Transmit_IT() is always 0xFF ,which does not happen when using the drivers in polling mode. I tried passing different values to XferOptions parameter with same result. thanks in advance for your help.
I am attaching code and logic analyzer captures.
Solved! Go to Solution.
2023-07-11 08:00 AM
Hello @edgar3 ,
You have enabled "No Clock Stretch" mode, you can't expect the thing to react to it's address and send the first byte correctly, because it does not stretch the clock to make the master wait until the slave code has loaded the first byte into its I2C engine.
If you want to do it without clock stretching, write your own I2C routines.
Foued
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.
2023-07-11 08:00 AM
Hello @edgar3 ,
You have enabled "No Clock Stretch" mode, you can't expect the thing to react to it's address and send the first byte correctly, because it does not stretch the clock to make the master wait until the slave code has loaded the first byte into its I2C engine.
If you want to do it without clock stretching, write your own I2C routines.
Foued
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.