FreeRTOS LPSPI

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

FreeRTOS LPSPI

Jump to solution
673 Views
fancycang
Contributor I

hi everyone

After I added the FreeRTOS module, there were issues with my LPSPI transmission,What is the reason for this?

fancycang_0-1699943442638.png

fancycang_1-1699943507233.png

I perform SPI transmission on external Flash, and the code can run normally without FreeRTOS. When FreeRTOS is added, the code will make an error at the command being transmitted.Why?

 

 

 

0 Kudos
1 Solution
559 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

what about to increase heap size in FreeRTOS component?
Or share simplified project showing an issue.

BR, Petr

View solution in original post

0 Kudos
6 Replies
650 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

did you try to initialize LPSPI driver within some init task after scheduler is started?

BR, Petr

0 Kudos
638 Views
fancycang
Contributor I

Hi Petr

I did not initialize LPSPI in task scheduling, just like SDK v4.0 freertos_s32k144 demo use prvSetupHardware() function Initialize LPSPI .Start SPI communication after initialization, using LPSPI_ DRV_ The MasterTransferBlocking function will report an error.

My phenomenon is that after adding the freertos module, my SPI transfer function will directly report an error.

Best Reagrds

0 Kudos
616 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you should call init and send functions from task after scheduler is started.

BR, Petr

0 Kudos
608 Views
fancycang
Contributor I

Hi Petr

Thank you for your reply. I seem to have found the cause of the problem, The SemaWait() function was called in the LPSPI_DRV_MasterTransferBlocking() function.When the freertos module was not added, this function exists in osif_baremetal. c. However, after adding freertos, it will jump to osif_ Freertos. c, this may be the reason why the function cannot run, but I haven't found a solution yet. Do you have any ideas?

Best Regards

0 Kudos
560 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

what about to increase heap size in FreeRTOS component?
Or share simplified project showing an issue.

BR, Petr

0 Kudos
553 Views
fancycang
Contributor I

Hi petr

Thank you for your answer. I have solved this problem and can only achieve SPI transmission in task scheduling.

Beat Regards

0 Kudos