My SPI synchronization and SPI+DMA asynchronous functions have been verified and debugged.
Now it is necessary to reduce the read and write time of SPI by issuing read and write instructions multiple times in one task and reading data in the next task.
This will use the Lpspi_ip_Asynchronous TransmitFast interface. But when I was configuring the Lpspi_ic_Asynchronous TransmitFast function, I found that calling this interface would cause the entire SPI to be in a blocked state. May I ask if there are any official demos or other related manuals that can be referenced.
Hi,
as far as I know no demo exists for this. The driver's UM shows steps and example how to use this API in chapter 6.2.5.7 Lpspi_Ip_AsyncTransmitFast(), similar info is given in the comment above Lpspi_Ip_AsyncTransmitFast() in Lpspi_Ip.h
BR, Petr
Hi,
Thank you for your reply.
I have two more questions now:
The first question is:
As indicated in the recommended configuration, I configured ScatterGathers configuration for three Tx channels and two Rx channels, and set SpiPhyUnit/SpiMaxDmaFastTransfer to 2. However, S32DS keeps reporting errors and prompts the following message.
I had to configure the ScatterGathers configuration for the Tx channel to four in order for S32DS to not report any errors.
All transmission length configurations are set to 8
The global configuration is the same
The following is the configuration when I call the Lpspi_ic_Asynchronous TransmitFast() interface
Hi,
not sure for first one, it looks like some error message related to MCAL driver, no jobs are set in IP level setting.
For a second one, try to have Rx DMA ISR priority level higher than Tx DMA ISR.
BR, Petr
Hi,
Thank you for your reply.
I tried to set the priority of DMA Rx to the highest among all ISR. However, DMA Rx ISR still cannot be triggered.
But when I don't call the Lpspi_ip_Asynchronous TransmitFast() interface and instead call the Lpspi_ip_Asynchronous Transmit() interface, the DMA Rx ISR can be triggered normally
The following is the program stack when the Lpspi_ic_Asynchronous Transmit() interface is called normally
DMA0_CH0 is the ISR of DMA Tx channel
DMA0_CH1 is the ISR of DMA Rx channel
And the ISR processing function corresponding to SPI is also called normally
Hi,
let me check with RTD team.
BR, Petr
Hello,
Here is the answer from RTD team:
I have a S32K344 SPI fast transfer demo with RTD 4.0.0 (MCAL layer). Please check the attachment.
According to your description(in SPI IP layer driver), the actual required number of DMA scatter/gather elements should be:
Note that the above calculation method is not applicable to the MCAL layer driver.
Best regards,
Peter
Hi,
Has there been any progress on this inspection?
Look forward to your reply.
BR