LPCXpresso55S36, I3C cannot read more than 16 bytes

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

LPCXpresso55S36, I3C cannot read more than 16 bytes

6,761件の閲覧回数
bell_huang
Contributor III

I'm running I3C on LPC55S36-EVK and find out that it cannot be read more than 16 bytes.

 

This issue can be reproduced in Building an I3C Sensor Network Using LPC553x/LPC55S3x example. After initialization of the icm42688p is complete, reading 17 bytes from the icm42688p sensor causes I3C_ReadSensor to hang. And we can see that SDA will be pulled down forever.

 

if (demo_icm42688pDev != NULL ) {    
  // ...
  result = ICM42688P_Init(&icmp42688p_handle, &icm42688p_sensorConfig);
  if (result != kStatus_Success)
  {
    PRINTF("\r\nSensor reset failed.\r\n");
    return -1;
  }
  // ...

  uint8_t bankSel = 0;
  /* Select bank 0 to read sensor data.*/
  result = ICM42688P_WriteReg(&icmp42688p_handle, BANK_SEL, &bankSel, 1);
  if (result != kStatus_Success)
  {
    PRINTF("\r\nSelect sensor bank 0 failure.\r\n");
    return -1;
  }

  // test
  SDK_DelayAtLeastUs(1000 * 1000, SystemCoreClock);
  static uint8_t buffer[256];
  I3C_ReadSensor(demo_icm42688pDev, 0x00, buffer, 17);
}

 

bell_huang_0-1728269126809.png

 

Note

1. If the length of reading is less or equal to 16 bytes, there is no problem.

2. I am assuming that this is not a problem with the icm42688p as I get the same problem with an another sensor.

 

Environment

Platform: LPC55S36-EVK

SDK: Build SDK for LPCXpresso55S36 2.16.000 (released 2024-07-12)

Sample: Building an I3C Sensor Network Using LPC553x/LPC55S3x

 

 

 

6 返答(返信)

6,718件の閲覧回数
Harry_Zhang
NXP Employee
NXP Employee

Hi @bell_huang 

I tested the lpcxpresso55s36_i3c_master_read_sensor_icm42688p example.

And i reproduce the issue that you mentioned.

HangZhang_0-1728458914217.png

I have tracked this function.

HangZhang_1-1728459059008.png

The parameter handle ->remaining bytes is finally passed into the read function.

Therefore, it is believed that the sensor can only return a maximum of 16 bytes of data.

BR

Hang

0 件の賞賛
返信

6,660件の閲覧回数
bell_huang
Contributor III

Hi @Harry_Zhang ,

Thanks for responses.

 

I think this is a problem caused by the LPC55S366 for the following three reasons:

1. There are similar conditions for other sensors besides icm42688p, and they don't necessarily occur at the case of more than 16 bytes.

2. In addition to the SDA possibly being pulled out, the SCL may also be pulled out. There is no reason that any sensor should be designed to control SCL.

3. I moved the same sensor to another MCU platform that supports I3C and this problem does not occur.

 

This problem can also be reproduced using the NXP p3t1175 temperature sensor. After initialization of the p3t1175 is complete, reading 23 bytes from the p3t1175 sensor causes I3C_ReadSensor to hang. And we can see that SCL will be pulled down forever.

if (demo_p3t1175Dev != NULL ) {		
  //...
  result = P3T1175_Init(&p3t1175_handle, &p3t1175_sensorConfig);
  if (result != kStatus_Success)
  {
    PRINTF("\r\nTemp Sensor reset failed.\r\n");
    return -1;
  }

  //
  // readLength = 22, no problem
  // readLength = 23, SCL or SDA be pulled low
  //
  size_t readLength = 23;
  SDK_DelayAtLeastUs(1000 * 1000, SystemCoreClock);
  static uint8_t buffer[256];
  I3C_ReadSensor(demo_p3t1175Dev, 0x00, buffer, readLength);
}

PRINTF("Finished\r\n");
while (true);

bell_huang_0-1728960444783.pngbell_huang_0-1728960205997.png

 

However, I tested the p3t1175 on an another I3C supported platform and had no problem reading 100 bytes.

bell_huang_1-1728960730435.png

 

 

6,649件の閲覧回数
Harry_Zhang
NXP Employee
NXP Employee

Hi @bell_huang 

This may be because our SDK currently does not support directly changing the read FIFO to exceed 16 Byte.

May I ask what your requirements are? Why do we need to change the size of the read FIFO? We can modify the code according to your needs.

BR

Hang

0 件の賞賛
返信

6,628件の閲覧回数
bell_huang
Contributor III

Hi @Harry_Zhang ,

My requirements are:

1. Sensors can run on 12.5M I3C bus.

2. Sensors can read as many bytes on the I3C bus as they can on the I2C bus.

 

Sensors can run on 12.5M I3C bus

In Building an I3C Sensor Network Using LPC553x/LPC55S3x example it was 10M. As far as the results are concerned, both 10M and 12.5M have the same problem.

 

Sensors can read as many bytes on the I3C bus as they can on the I2C bus

16 bytes is a very small number for a sensor with FIFO support, for example, my sensor has a FIFO of 4000 bytes. however, I don't require the platform to have no upper limit, it would be sufficient if it could support 250 bytes. If the SDK can adjust the upper limit of read bytes, please let me know how to do it.

 

icm42688p cannot read more than 16 bytes

Ignore my earlier reference to the InvenSense icm42688p. I tested the icm42688p in many cases and it does read 16 bytes at most.

 

p3t1175 cannot read more than 22 bytes

I tried the NXP p3t1175 on another platform and it can read 1000 bytes on I3C 12.5M bus.

On the LPC55S36 platform, if the I3C bus speed is slowed down to 6.25M, the p3t1175 can read up to 255 bytes.

If you can adjust the SDK, so that p3t1175 can read at least 250 bytes on I3C 12.5M bus.

 

6,575件の閲覧回数
Harry_Zhang
NXP Employee
NXP Employee

Hi @bell_huang 

1. " Sensors can run on 12.5M I3C bus."

If your sensor supports 12.5M, I think it's possible

2. "Sensors can read as many bytes on the I3C bus as they can on the I2C bus."

I think this is also possible.

BR

Hang

Harry

 

0 件の賞賛
返信

6,556件の閲覧回数
bell_huang
Contributor III

Hi @Harry_Zhang ,

I confirmed that both my sensor and NXP p3t1175 can run on 12.5M I3C bus, and they can be read as many bytes on the I3C bus as they can on the I2C bus.

But both my sensor and NXP p3t1175 cannot be read 250 bytes on NXP LPC55S36 I3c bus. Could you request to check this issue with internal department?