Firstly, the hardware is guaranteed to be normal, because IIC can be used to read the device when there is no RTos to get the device ID.
but，add freeRTos ，read IIC return BUSY.
Please analyse the following project
Hello WANG LI,
Can you please monitor the I2C bus with a logic analyzer/oscilloscope?
Have you tested the attached project.
I see that the LPI2C pins are not routed in the project.
please review source code， no use PE component.
I see that the lpi2c state structure is declared in main and is allocated on the stack. When the scheduler is started, the FreeRTOS kernel will reuse the stack allocated to main because it assumes that the application will not return to main.
Hence, the previously allocated state structure will be overwritten.
Declare the state structure static and it will work.
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);static lpi2c_master_state_t lpi2c1MasterState;sta=LPI2C_DRV_MasterInit(INST_LPI2C1, &lpi2c1_MasterConfig0, &lpi2c1MasterState);
Retrieving data ...