FreeRTOS LPSPI

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FreeRTOS LPSPI

跳至解决方案
1,166 次查看
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 项奖励
回复
1 解答
1,052 次查看
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 项奖励
回复
6 回复数
1,143 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

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

BR, Petr

0 项奖励
回复
1,131 次查看
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 项奖励
回复
1,109 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

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

BR, Petr

0 项奖励
回复
1,101 次查看
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 项奖励
回复
1,053 次查看
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 项奖励
回复
1,046 次查看
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 项奖励
回复