s32k314 Lpspi_Ip_SyncTransmit and Lpspi_Ip_AsyncTransmit transmit issue

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

s32k314 Lpspi_Ip_SyncTransmit and Lpspi_Ip_AsyncTransmit transmit issue

跳至解决方案
3,864 次查看
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 项奖励
回复
1 解答
3,707 次查看
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 项奖励
回复
11 回复数
3,188 次查看
LBowen
Contributor I
可以发一份示例代码吗,我最近也在做SPI方面的项目,一直有困难,想借鉴一下
0 项奖励
回复
3,185 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
3,172 次查看
LBowen
Contributor I
有安装RTD3.0的SDK吗,和4.0可以共存吗
0 项奖励
回复
3,168 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
3,161 次查看
LBowen
Contributor I
请问能否把RTD3.0文件发给我,我在官网上没有找到,还有你说的这个意思是安装两个S32DS软件吗
0 项奖励
回复
3,155 次查看
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 项奖励
回复
3,813 次查看
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 项奖励
回复
3,176 次查看
LBowen
Contributor I
可是我安装的是RTD4.0,这个例程没有找到
0 项奖励
回复
3,787 次查看
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 项奖励
回复
3,708 次查看
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 项奖励
回复
3,599 次查看
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 项奖励
回复