Hello grayli.wang@cdskysoft.com,
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.
Regards,
Daniel
hello,Daniel
please review source code, no use PE component.
Regards,
grayli
Hi,
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);
Best regards,
Rares