LPSPI0 for S32K344 only sends and only receives

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

LPSPI0 for S32K344 only sends and only receives

跳至解决方案
246 次查看
jiafeimao
Contributor III

My S32K344 device is connected to a ferroelectric memory via LPSPI0.

1. When writing storage data, I send "write command", "write address", and finally send several data to be written through LPSPI0.

2. When reading data, I send a "read command" and "read data address" through LPSPI0, and then perform several byte data reads.

In the above two processes, The sending and receiving of LPSPI0 are done separately. During process 1, LPSPI0 only needs to send, during process 2, LPSPI0 sends "read command", "read data address", and finally only needs to receive. How to achieve this.


The following seems to be an incorrect approach:

1.

Lpspi_Ip_AsyncTransmitHalfDuplex(&Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_Instance_0, WRITE, 1, LPSPI_IP_HALF_DUPLEX_TRANSMIT, NULL);

Lpspi_Ip_AsyncTransmitHalfDuplex(&Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_Instance_0, ADDRESS, 2, LPSPI_IP_HALF_DUPLEX_TRANSMIT, NULL);

Lpspi_Ip_AsyncTransmitHalfDuplex(&Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_Instance_0, TX_BUFFER, Length LPSPI_IP_HALF_DUPLEX_TRANSMIT, NULL);

2.

Lpspi_Ip_AsyncTransmitHalfDuplex(&Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_Instance_0, READ, 1, LPSPI_IP_HALF_DUPLEX_RECEIVE, NULL);

Lpspi_Ip_AsyncTransmitHalfDuplex(&Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_Instance_0, ADDRESS, 2, LPSPI_IP_HALF_DUPLEX_RECEIVE, NULL);

Lpspi_Ip_AsyncTransmitHalfDuplex(&Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_Instance_0, RX_BUFFER, Length, LPSPI_IP_HALF_DUPLEX_RECEIVE, NULL);

0 项奖励
回复
1 解答
222 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @jiafeimao,

In the Async mode, do you call the Flexio_Spi_Ip_GetStatus() for each of the transfers until each of them is completed?

You need to specify either SIN or SOUT for the half-duplex transfer, and then configure the pin in the SIUL2 driver.

Please scope the bus.

danielmartynek_0-1716977104141.png

 

 

Thanks,

BR, Daniel

在原帖中查看解决方案

0 项奖励
回复
2 回复数
223 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @jiafeimao,

In the Async mode, do you call the Flexio_Spi_Ip_GetStatus() for each of the transfers until each of them is completed?

You need to specify either SIN or SOUT for the half-duplex transfer, and then configure the pin in the SIUL2 driver.

Please scope the bus.

danielmartynek_0-1716977104141.png

 

 

Thanks,

BR, Daniel

0 项奖励
回复
209 次查看
jiafeimao
Contributor III

通过这两天的调试,我大致了解了344的LPSPI没有单独的发送(忽略接收)和接收(忽略发送)功能接口。LPSPI0 不能在前一刻使用单独的发送(忽略接收),然后在下一刻使用单独的接收(忽略发送)。我将使用 Lpspi_Ip_SyncTransmit() 函数并忽略任何不必要的数据。感谢您的回复。

0 项奖励
回复