FreeRTOS LPSPI

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
652件の閲覧回数
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 解決策
538件の閲覧回数
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 返答(返信)
629件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

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

BR, Petr

0 件の賞賛
617件の閲覧回数
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 件の賞賛
595件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

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

BR, Petr

0 件の賞賛
587件の閲覧回数
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 件の賞賛
539件の閲覧回数
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 件の賞賛
532件の閲覧回数
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 件の賞賛