Skip to main content
Explorer
October 28, 2024
Solved

I2C is not working for receiving data - RXNE flag is not getting set

  • October 28, 2024
  • 1 reply
  • 930 views

Hi,

I am working on STM32MP133FAFx (I2C Master) for I2C communication with STPMIC1 IC (I2C slave) fast mode(400KHz) and HSI clock(64MHz). I2C->TIMINGR = 0x00C0216C

For writing data TXIS flag is getting send and I am writing the register but when trying to read data back from PMIC RXNE flag is not getting set and RXDR register is not showing data.

Configuration for reading & writing data is done as per the example code provided by ST

i.e. used  HAL_I2C_Mem_Read() & HAL_I2C_Mem_Write() functions for 1 byte data transfer.

 

Please help me how to resolve this issue and provide me the solution.

 

    This topic has been closed for replies.
    Best answer by PatrickF

    Hi @sandeepBJadhav 

    low level I2C could be quickly checked using a simple oscilloscope probing SCL and SDA.

    Then you could check:

    - possible issue with bus level/timing (e.g. missing 1.5k pull-ups)

    - correct I2C sequence including address/RW/ACK

    - presence of STPMIC1 answer

    PatrickF_0-1730135134603.png

     

    Regards.

    1 reply

    PatrickFAnswer
    Technical Moderator
    October 28, 2024

    Hi @sandeepBJadhav 

    low level I2C could be quickly checked using a simple oscilloscope probing SCL and SDA.

    Then you could check:

    - possible issue with bus level/timing (e.g. missing 1.5k pull-ups)

    - correct I2C sequence including address/RW/ACK

    - presence of STPMIC1 answer

    PatrickF_0-1730135134603.png

     

    Regards.