Hi @Pavel_Hernandez ,
I3C_WriteSensor(&demo_masterDev, 0x86, &slaveAdd, 1) doesn't work in i3c_sensor_network example. The first byte it drives is 0x08 and then NACK.


I3C_WriteSensor in i3c_sensor_network example is very different from in i3c_master_read_sensor_icm42688p example. In i3c_sensor_network example:
(1) The first parameter i3c_device_t of I3C_WriteSensor determines what it drives the first byte as the slave address.
(2) In this example, the dynamic address of demo_masterDev is assigned to 0x08, and the dynamic address of demo_icm42688pDev is assigned to 0x09.
That's the reason that I3C_WriteSensor(&demo_masterDev, 0x86, &slaveAdd, 1) drives the first byte 0x08, not 0x7E.
-------------------------------------------------------------------------------------------------------------------------------------
I test I3C_WriteSensor(0x7E, 0x86, &slaveAdd, 1) in i3c_master_read_sensor_icm42688p example, and it does not work too. Please refer to the attachment i3c_master_read_sensor_icm42688p.c for this test.
If we call I3C_WriteSensor(0x7E, 0x06, NULL, 0) for Broadcast RSTDAA, then it can read WHO_AM_I value using I2C.
/* Broadcast RSTDAA */
result = I3C_WriteSensor(0x7E, 0x06, NULL, 0);
if (result != kStatus_Success)
{
PRINTF("Broadcast RSTDAA failed\r\n");
return -1;
}
/* I2C Read WHO_AM_I */
uint8_t whoAmI = 0;
i3c_master_transfer_t xfer = {};
xfer.slaveAddress = 0x69;
xfer.subaddress = WHO_AM_I;
xfer.subaddressSize = 1;
xfer.data = &whoAmI;
xfer.dataSize = 1;
xfer.direction = kI3C_Read;
xfer.busType = kI3C_TypeI2C;
xfer.flags = (uint32_t)kI3C_TransferDefaultFlag;
result = I3C_MasterTransferBlocking(EXAMPLE_MASTER, &xfer);
if (result != kStatus_Success)
{
PRINTF("I2C Read WHO_AM_I failed\r\n");
return -1;
}
PRINTF("WHO_AM_I = 0x%02X\r\n", whoAmI);

But if we call I3C_WriteSensor(0x7E, 0x86, &targetAddr, 1) for Direct RSTDAA, then it fails to read value using I2C. It means that the device does not be reset to I2C mode.
/* Direct RSTDAA */
uint8_t targetAddr = slaveAddr << 1;
result = I3C_WriteSensor(0x7E, 0x86, &targetAddr, 1);
if (result != kStatus_Success)
{
PRINTF("Direct RSTDAA failed\r\n");
return -1;
}
/* I2C Read WHO_AM_I */
uint8_t whoAmI = 0;
i3c_master_transfer_t xfer = {};
xfer.slaveAddress = 0x69;
xfer.subaddress = WHO_AM_I;
xfer.subaddressSize = 1;
xfer.data = &whoAmI;
xfer.dataSize = 1;
xfer.direction = kI3C_Read;
xfer.busType = kI3C_TypeI2C;
xfer.flags = (uint32_t)kI3C_TransferDefaultFlag;
result = I3C_MasterTransferBlocking(EXAMPLE_MASTER, &xfer);
if (result != kStatus_Success)
{
PRINTF("I2C Read WHO_AM_I failed\r\n");
return -1;
}
PRINTF("WHO_AM_I = 0x%02X\r\n", whoAmI);

