Hi,
Now I'm checking I2C on Freertos but it do not work as I expected.
My test project is as below.
1. Make new freertos project from freertos example.
2. Add I2c pin assign and peripheral setting to FAST.
3. Add I2C Clock setting and master drive init routine
4. Add I2C Prioirty level same as SYSCALL.
/* Initialize Interrupt priority for LP I2C driver as bus master */
INT_SYS_SetPriority(LPI2C0_Master_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
5. Add I2C data send routine in prvQueueSendTask as below.
static void prvQueueSendTask( void *pvParameters )
{
...
/* Send a packet of data to the bus slave */
masterTxBuffer[0]=0x00;
masterTxBuffer[1]=0xAF;
LPI2C_DRV_MasterSendDataBlocking(INST_LPI2C0, masterTxBuffer, 2, true, OSIF_WAIT_FOREVER);
xQueueSend( xQueue, &ulValueToSend, mainDONT_BLOCK );
}
}
6. Compile and Start bebug ==> LED shoud be blink but does not caused by LPI2C_DRV_MasterSendDataBlocking function.
==> LPI2C_DRV_MasterSendDataBlocking(INST_LPI2C0, masterTxBuffer, 2, true, OSIF_WAIT_FOREVER);
==> When I change OSIF_WAIT_FOREVER to 500 then LED start blinking.
Please check attached project file.