K82 : I2C freertos driver , infinite timeout ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

K82 : I2C freertos driver , infinite timeout ?

1,572件の閲覧回数
EugeneHiihtaja
Senior Contributor I

Hello !

I can see I2C master freertos driver fsl_i2c_freertos.c has infinite time to wait end of transaction :

/* Wait for transfer to finish */
xSemaphoreTake(handle->semaphore, portMAX_DELAY); // forever ?

From other side HW timeout(s) for I2C peripheral is not set anywhere in driver.

Could it possible to guide how-to set properly all HW timeouts for master I2C interface and

modify  (if need) i2c freertos driver for work properly with I2C peripheral when HW timeouts are configured.

Does exist any Application Note for configure I2C HW timeouts ?

Thank you !

Regards,

Eugene

0 件の賞賛
返信
3 返答(返信)

1,459件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi Eugene:

From hardware perspective, we need to configure below registers

I2Cx_SMB[TCKSEL] is used to select the clock source of the time out counter.

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

For example, if timeout is 30ms, TCKSEL=0, bus clock is 25M

  I2C0_SLTL = I2C_SLTL_SSLT(0xC7);       /* I2C0_SLTL: SSLT=0xC7 */

  I2C0_SLTH: SSLT=0x2D                           /* Set SCL low timeout register low */

  I2C0_SLTH = I2C_SLTH_SSLT(0x2D);     /* Set SCL low timeout register high */

For FreeRTOS driver perspective, I would suggest you try to configure the timeout value from portMAX_DELAY to a specified value.

xSemaphoreTake(handle->semaphore, portMAX_DELAY); // forever

Regards

Daniel

0 件の賞賛
返信

1,459件の閲覧回数
EugeneHiihtaja
Senior Contributor I

Hi Daniel !

Do I undestand right and those timeouts e.g SCL low and High are applicable to I2C master and slave interfaces ?

Can it be so that other changes are need to fsl_i2c driver ?

It is not visible any where if timeout enabled interrupts are enabled or if they occurs and analysed somewhere ?

Even I set relevant timeout values, I should enable detection of it and able to process relevant interrupts and clean those.

May be you have somewhere new advanced fsl i2c  driver  ?

Regards,

Eugene

0 件の賞賛
返信

1,459件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Yes, you are right.   those timeouts e.g SCL low and High are applicable to I2C master and slave interfaces.  

Sorry currently no advanced fsl i2c driver for this.

Regards

Daniel

0 件の賞賛
返信