AnsweredAssumed Answered

S32K I2C

Question asked by Koorosh Hajiani on Jan 23, 2018
Latest reply on Feb 13, 2018 by Alina Banica

Seems to me based on my own working (past 10 days )with the SDK I2C drivers and searching the forum , there are issues with using the non blocking I2C send and receive drivers:

 

 

/*!

* @brief Perform a non-blocking receive transaction on the I2C bus

*

* This function starts the reception of a block of data from the currently

* configured slave address and returns immediately.

* The rest of the reception is handled by the interrupt service routine.

* Use LPI2C_DRV_MasterGetReceiveStatus() to check the progress of the reception.

*

* @param instance  LPI2C peripheral instance number

* @param rxBuff    pointer to the buffer where to store received data

* @param rxSize    length in bytes of the data to be transferred

* @param sendStop    specifies whether or not to generate stop condition after the reception

* @return    Error or success status returned by API

*/

status_t LPI2C_DRV_MasterReceiveData(uint32_t  instance,

                                               uint8_t * rxBuff,

                                               uint32_t rxSize,

                                               bool sendStop);

 

and

 

 

/*!

* @brief Perform a non-blocking send transaction on the I2C bus

*

* This function starts the transmission of a block of data to the currently

* configured slave address and returns immediately.

* The rest of the transmission is handled by the interrupt service routine.

* Use LPI2C_DRV_MasterGetSendStatus() to check the progress of the transmission.

*

* @param instance  LPI2C peripheral instance number

* @param txBuff    pointer to the data to be transferred

* @param txSize    length in bytes of the data to be transferred

* @param sendStop    specifies whether or not to generate stop condition after the transmission

* @return    Error or success status returned by API

*/

status_t LPI2C_DRV_MasterSendData(uint32_t instance,

                                            const uint8_t * txBuff,

                                            uint32_t txSize,

                                            bool sendStop);

 

 

 

I can’t say for certain but I sense from the discussion in the forum and my own dealing with this,

The blocking versions of the above functions are to be used. For me the blocking is stable while the none blocking version triggers exceptions.

 

Can someone confirm this please?

 

Thanks

Outcomes