s32k314 Lpspi_Ip_SyncTransmit and Lpspi_Ip_AsyncTransmit transmit issue

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

s32k314 Lpspi_Ip_SyncTransmit and Lpspi_Ip_AsyncTransmit transmit issue

Jump to solution
1,275 Views
jwkang
Contributor III
I am testing SPI communication on S32K314.

It was confirmed that the correct data was output through Lpspi_Ip_SyncTransmit. 
 
    status = Lpspi_Ip_SyncTransmit(&SLAVE_EXTERNAL_DEVICE, pTxData, pRxData, length, 1000);
    if( LPSPI_IP_STATUS_SUCCESS == status ) {
        retval = true;
    }
However, even if Interrupt is set, the Finish interrupt does not occur.
        status = Lpspi_Ip_Init( &Lpspi_Ip_PhyUnitConfig_SpiPhyUnit_0_Instance_0 );
        if( status != LPSPI_IP_STATUS_SUCCESS ) {
        }

        IntCtrl_Ip_InstallHandler(LPSPI0_IRQn, Lpspi_Ip_LPSPI_0_IRQHandler, NULL_PTR);
        IntCtrl_Ip_EnableIrq(LPSPI0_IRQn);
 
    Lpspi_Ip_UpdateTransferMode(SLAVE_EXTERNAL_DEVICE.Instance, LPSPI_IP_INTERRUPT);
 
 
So, we are trying to communicate through Lpspi_Ip_AsyncTransmit.

However, correct data is not output through Lpspi_Ip_AsyncTransmit.

jwkang_0-1720503824948.png

Values ​​0x01, 0x02 ~ 0x20 are being transmitted as test values, but it appears that only the first 3 bytes are transmitted as correct values, and the rest are transmitted as garbage values.

jwkang_1-1720503953146.png

If there is anything you can help me with, please do so.

0 Kudos
Reply
1 Solution
1,118 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

I’m sorry for delayed response, we are heavily overloaded now.
Cache_Ip_InvalidateByAddr is for when DMA is used. If you don’t use DMA, then there is no need to call it.
If RTD 3.0.0 and DMA is used, then DMAMUX must be configured in Rm regardless of whether MCAL is used. (Rm->RmConfigSet->Dma Mux)
Would you please send me a simplified test project privately?

View solution in original post

0 Kudos
Reply
11 Replies
599 Views
LBowen
Contributor I
可以发一份示例代码吗,我最近也在做SPI方面的项目,一直有困难,想借鉴一下
0 Kudos
Reply
596 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

All Example S32K312 DS3.5 RTD-3.0.0 里面就有SPI的例子

0 Kudos
Reply
583 Views
LBowen
Contributor I
有安装RTD3.0的SDK吗,和4.0可以共存吗
0 Kudos
Reply
579 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

单独再安装一个C:\NXP\S32DS.3.5_RTD300  然后安装RTD3.0.0。 

0 Kudos
Reply
572 Views
LBowen
Contributor I
请问能否把RTD3.0文件发给我,我在官网上没有找到,还有你说的这个意思是安装两个S32DS软件吗
0 Kudos
Reply
566 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

S32K3 RTD 3.0.0开始每个S23DS v3.5里同时只能存在一个版本的S32K3 RTD。 所以不得不再安装一个S32DS v3.5.   请参考 HOWTO: offline install S32K3 RTD 3.0.0 in S32DS v3.5

另外建议在论坛里新建提问帖子。

0 Kudos
Reply
1,224 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Please refer to the Example S32K312 SPI Transmit & Receive Using DMA DS3.5 RTD300

Lpspi_Ip_AsyncTransmit is used in this project.


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
587 Views
LBowen
Contributor I
可是我安装的是RTD4.0,这个例程没有找到
0 Kudos
Reply
1,198 Views
jwkang
Contributor III

Thank you for the source code. I am referring to it.


Since our project doesn't use MCAL, we don't use Rm.


Is it necessary to use the Cache_Ip_InvalidateByAddr function?

Currently, I am transmitting using the Lpspi_Ip_AsyncTransmit function, but when I read it with Lpspi_Ip_GetStatus, LPSPI_IP_FIFO_ERROR occurs. Do you know how to resolve LPSPI_IP_FIFO_ERROR?

0 Kudos
Reply
1,119 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

I’m sorry for delayed response, we are heavily overloaded now.
Cache_Ip_InvalidateByAddr is for when DMA is used. If you don’t use DMA, then there is no need to call it.
If RTD 3.0.0 and DMA is used, then DMAMUX must be configured in Rm regardless of whether MCAL is used. (Rm->RmConfigSet->Dma Mux)
Would you please send me a simplified test project privately?

0 Kudos
Reply
1,010 Views
jwkang
Contributor III

Yes, I solved the problem by using RM.


In order to use DMA in SPI, dmamux must be used, but my project did not use mcal. Since there is no way to add dmamux in projects that do not use mcal in SDK components, I had no choice but to add mcal. I confirmed that it works well by registering dmamux in rm.

0 Kudos
Reply