fopen on I2C hangs after an fclose

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

fopen on I2C hangs after an fclose

797件の閲覧回数
mrupp_viatechno
Contributor III

I am using MQX3.8 and am trying to close (fclose) an I2C interface then reopen it (fopen)

The following code is used to first open the connection

file_iic0 = fopen("ii2c1fb:", NULL);

The following code is used to close the connection

fclose(file_iic0) ;

The fopen succeeds and my program can communicate with an I2C device

The fclose succeeds

Then I try to "reopen" the device using

file_iic0 = fopen("ii2c1fb:", NULL);

The fopen never returns. 

Is there some problem closing an I2C connection then reopening it?

Thanks,

Mike

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

633件の閲覧回数
mrupp_viatechno
Contributor III

Found solution.

In the routine _info_struct_init(), file i2c_int_k_fb.c, three light weight events are created.  They have to be destroyed in _ki2c_int_fb_deinit().

0 件の賞賛
返信

633件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi Mike:

Thank you for sharing your experience.

I have tested  this demo in the lastest MQX version 4.2. not found this issue.

Have a nice day!

Regards

Daniel

0 件の賞賛
返信