LPi2c Driver - FreeRTOS issue : I could not generate multiple i2c data

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPi2c Driver - FreeRTOS issue : I could not generate multiple i2c data

1,055 Views
well29
Contributor I

I followed the recommendation to successfully fix issue of lpi2c and freertos integration from
S32K142: lpi2c is not working with freeRTOS integration. - NXP Community.

The problem is that when I use LPI2C_DRV_MasterSendDataBlocking function to write data with big size like in example foo function below, it could not write the whole data block and would send stop after around 4 bytes. The same function works without FreeRtos but not with it. 

foo(uint8_t reg, uint8_t* data, uint16_t count) {
uint8_t dt[256];
dt[0] = reg;
uint8_t i;
for(i = 0; i < count; i++)
dt[i+1] = data[i];

LPI2C_DRV_MasterSendDataBlocking(INST_LPI2C0, dt, count+1, true, 10);

}

I'm using S32 Design Studio for S32 Platform Version: 3.5 Build id: 220726. 
I used the freeRtos example and added i2c peripheral.

Is there a way to quickly solve this?

0 Kudos
Reply
3 Replies

988 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @well29,

Is the driver initialized inside a FreeRTOS task after the scheduler is started?

 

Thank you

 

0 Kudos
Reply

962 Views
well29
Contributor I

Yes, the i2c works. It's just that it's capped to about 5-10 sent data bytes. I'm trying to send about 128 data bytes and that's where it failed.

0 Kudos
Reply

956 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @well29,

Does the function return, what is the status?

Have you tried the non-blocking function?

 

Thank you

0 Kudos
Reply