FLEXIO I2C Read Porblem

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

FLEXIO I2C Read Porblem

ソリューションへジャンプ
3,215件の閲覧回数
Proton_Dev
Contributor II

Hello Everyone,

 

I am using FELXIO I2C to read the data from device and I am using default example of I2c_polling_b2b_transfer example_master example. But I am not able to read from the device, I have set the correct address of device,pins and clock . Is there anything else has to be set into the structures of shifters and timers for that. I am attaching the default example. Any lead will be helpfull.

0 件の賞賛
返信
1 解決策
3,178件の閲覧回数
kef2
Senior Contributor V

Hi @Proton_Dev ,

 

FlexIO is nice thing, but it has its limits. Try with shorter messages. You code tries to send 33 bytes, while Processor Expert generated code specifies this

#define FLEXIO_I2C_MAX_SIZE (((uint32_t)((0xFFU - 1U) / 18U)) - 1U)

, which evaluates to 13 bytes. I faced the same problem with some I2C chip, which just can't be used due protocol limitations with FlexIO. I had to use dedicated I2C peripheral.

Edward

 

 

 

元の投稿で解決策を見る

5 返答(返信)
3,179件の閲覧回数
kef2
Senior Contributor V

Hi @Proton_Dev ,

 

FlexIO is nice thing, but it has its limits. Try with shorter messages. You code tries to send 33 bytes, while Processor Expert generated code specifies this

#define FLEXIO_I2C_MAX_SIZE (((uint32_t)((0xFFU - 1U) / 18U)) - 1U)

, which evaluates to 13 bytes. I faced the same problem with some I2C chip, which just can't be used due protocol limitations with FlexIO. I had to use dedicated I2C peripheral.

Edward

 

 

 

3,172件の閲覧回数
Proton_Dev
Contributor II

Hi @kef2 ,

Thank you for the answer and one more issue is that when I am trying to read from my device the same data through flexio_i2c I am no able to read. The bytes are always read as 0x00 NAK and 0x04 NAK and 0xcc NAK. As I am noticing the NAK signal and may be it raising  kFLEXIO_I2C_ReceiveNakFlag = 0x4U, /*< Receive NAK flag. */. But I am not sure what I am doing wrong. Any particular thing to be considered in this case.

0 件の賞賛
返信
3,149件の閲覧回数
kef2
Senior Contributor V

The rest was working well in my case, no problems reading writing smaller pieces of data. 

0 件の賞賛
返信
3,188件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Please let us know your chip PN thus we can assign right engineer for it.

Thanks,

Jun Zhang

タグ(1)
0 件の賞賛
返信
3,120件の閲覧回数
Proton_Dev
Contributor II

I have resolved the issue about the reading with flexio_I2C protocol by changing the I2C retry times in master driver. But I dont understand why it did not worked with I2C retry times=0(default value in master driver), it always stuck in that loop  masterreadrblocking() if  I2C retry times set to zero. Is any particular explaination or process needs to be followed or any particular formula. Any lead will be helpful. 

0 件の賞賛
返信