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.
Solved! Go to Solution.
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
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
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.
The rest was working well in my case, no problems reading writing smaller pieces of data.
Hi Please let us know your chip PN thus we can assign right engineer for it.
Thanks,
Jun Zhang
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.