Hi ,
i am working on S32K344 board. i am trying to run Example code given for I2C
[example code: I2c_S32K344_HLD_DS]
as soon as master is enabled , Bus Busy Flag is set to 1 by driver. due to which master is always in Idle state waiting for BBF to clear. but BBF never gets cleared. master transactions are not started.
master enable happens inside this function - LpI2c_Ip_MasterSetBaudRateInit() .
tried with both pull up and down set. but no luck.
i don't have oscilloscope, somehow i am unable to confirm if SCLK is available or not.
Please let me know if i have to take care of any extra configurations.
Thanks,
Rekha
I have the same question with you. Have you solved the problem now?
Hi @kRekha,
According to the RM, "whenever the LPI2C is enabled, it monitors the I2C bus to detect when the I2C bus is idle (MSR[BBF]). The I2C bus is no longer considered idle if either SCL or SDA are low ..."
The bus (SDA & SCL) must read HIGH.
The example does not use the internal pull-ups on the pins.
You said you enabled it, but is it really pulled up?
Do you have a volt-meter at least?
Or you can disable the internal pull-ups and use external ones.
It is really necessary to make sure the bus is pulled up.
Thanks,
BR, Daniel
@danielmartynek thank you for your response.
We have external pull ups for I2C lines. So I have disabled internal pull up later on..
I have multimeter. Should I need to check voltage at I2C pins?
Also, is it valid to consider BBF to be in busy state, if we are receiving timeout during block transfer?
Transactions never started, inside block transfer control is waiting for particular timeout and timeout happens every time.. I have set timeout to maximum for testing purpose.. even then we are receiving timeout condition..
Does this means slave is not responding?
I am providing 7 bit adress as input
Thanks,
Rekha
Hi @kRekha,
You can try with the multimeter just to see if the I2C lines are really pulled up.
I would recommend using an oscilloscope or an logic analyzer though.
Can you find which operation within the transfer returns TIMEOUT status?
Do you have NXP EVB or your own board?
Have you modified the example?
Thanks,
Daniel
Hi Daniel,
I have NXP s32k344 integrated to my board. Not the EVB.
very first issue what I observe is : I2C Bus Busy flag is set as soon as master is enabled during I2C initialization(In baudrate init function). I am not understanding why is the bus busy flag set during initialization and it never gets cleared.
This results in Timeout .
So if we resolve bus busy issue then timeout issue will get resolved.
Can you please direct me to the solution side.
Thanks,
Rekha
Hi Rekha,
The BBF operation is specified in the RM.
"Whenever the LPI2C is enabled, it monitors the I2C bus to detect when the I2C bus is idle (MSR[BBF]). The I2C bus is no longer considered idle if either SCL or SDA are low ..."
If you see both lines HIGH with the multimeter before the LPI2C module is enabled, then I guess the ports are not correctly muxed to the LPI2C module.
Can you check the Multiplexed Signal Configuration Registers (MSCR) just before the LPI2C module get enabled?
Regards,
Daniel
Hi Daniel,
Both lines are showing 0volts before I2C module is enabled. even after i2c Init these lines voltage level is 0V.
i have configured PTC8, PTC9 for I2C0. before i2C init is done we are initializing the port pins , hence MSCR{72] memory block - 0x40290360 shows value 1, MSCR[73], mem block - 0x40290364 is also 1. below are the configurations done on my target.
0000_0001 | LPI2C0_SCL | LPI2C0 | LPI2C Clock I/O | O |
0000_0001 | LPI2C0_SDA | LPI2C0 | LPI2C Data I/O | O |
Thanks,
Rekha
Hi Rekha,
The I2C lines must not read 0V before the I2C module is enabled.
You said you had external pullups on the lines.
Please double check that and make sure the lines read HIGH before the module is enabled.
Thank you,
BR, Daniel
Dear All,
I have similar problem with s32k358 custom board and lpi2c0 channel driver. I have external pullups and whenever MCR->DEBUG bit is not enable the transmisstion even not start. If the MCR->DEBUG pin is enabled the master start sending start condition (see attachment) but then afterwards it is comming back to idle state. I have debugged this inside the code and there is an error event check and sometimes bus arbitration lost error event is called, sometimes fifo tx error event or both one by one. I was trying the same pins as flexio flexio_i2c and all is working fine. Master is sending correct datas. I have also tried to toggle those pins as simple dio and also working fine. What is the problem with lpi2c driver then there?