LPI2C DRV + FreeRTOS OSIF error

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

LPI2C DRV + FreeRTOS OSIF error

Jump to solution
1,847 Views
markus1
Contributor II

Hello,

I currently try to implement my eeporm interface in a project using the FreeRTOS V10.0.1 port in PE. Therefore, I added the LPI2C Peripheral Driver in PE. With this configuration, I can see communication on the I2C lines but the application never ends the blocking LPI2C functions.

I tried to reproduce the issue in a smaller project. Using only the LPI2C driver, communication is working. This configuration is using the osif_baremetal.c.

As soon as I add FreeRTOS to the configuration, osif_baremetal.h references to osif_freertos.c. From this moment on, I2C communication fails. Anyway, if I set breakpoints inside the OSIF_SemaWait(...) function to get some delay, the interface is working.

My conclusion: The issue is caused by the freertos osif.

I attached the small project that reproduces the issue.

Can anyone please give me a hint how to fix this problem?

Thanks and best regards,

Markus

Labels (1)
0 Kudos
1 Solution
1,500 Views
ovidiualexandru
NXP TechSupport
NXP TechSupport

Hi Markus,


I notice that in your project the scheduler is not started. This is probably the cause for the wrong behavior.


When starting FreeRTOS, a set of tasks need to be defined and eventually the OS scheduler started as well. From that point, the CPU time is shared only between the tasks, and the full functionality of the OS is available.


I have attached a modified main file that should create a task for the I2C and start the scheduler. Please let me know if this does what you are expecting.


Best regards,

Ovidiu

View solution in original post

3 Replies
1,501 Views
ovidiualexandru
NXP TechSupport
NXP TechSupport

Hi Markus,


I notice that in your project the scheduler is not started. This is probably the cause for the wrong behavior.


When starting FreeRTOS, a set of tasks need to be defined and eventually the OS scheduler started as well. From that point, the CPU time is shared only between the tasks, and the full functionality of the OS is available.


I have attached a modified main file that should create a task for the I2C and start the scheduler. Please let me know if this does what you are expecting.


Best regards,

Ovidiu

1,501 Views
gravity_one
Contributor III

hi ,Ovidiu

can you help me ?about S32K146 IIC +RTos

but i do not send my project to you.

I'm in the same issue, but my project is startup scheduler.

Best regards,

Grayli

0 Kudos
1,500 Views
markus1
Contributor II

Hey Ovidiu,

thanks a lot for your fast response. This was really a help for me.

Best regards,

Markus

0 Kudos