FLEXIO I2C Read Porblem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FLEXIO I2C Read Porblem

跳至解决方案
1,796 次查看
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 解答
1,759 次查看
kef2
Senior Contributor IV

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 回复数
1,760 次查看
kef2
Senior Contributor IV

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

 

 

 

1,753 次查看
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 项奖励
1,730 次查看
kef2
Senior Contributor IV

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

0 项奖励
1,769 次查看
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 项奖励
1,701 次查看
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 项奖励