Skip to main content
Associate II
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.

 

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

PatrickF
PatrickFBest answer
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.

In order to give better visibility on the answered topics, please click on 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent