Chip :S32K314
RTD: 4.0.0
S32DS3.5
SPI setting : LPSPI_1, Slave, CS3
Pindefine:
DMA
/* Initialize Dma */
Dma_Ip_Init(&Dma_Ip_xDmaInitPB);
void spi_init(uint32_t instance)
{
/* Initalized spi using instance lpspi as a spi slave */
Lpspi_Ip_Init(&Lpspi_Ip_PhyUnitConfig_SpiPhyUnit_0_Instance_1);
/* Update Framesize */
Lpspi_Ip_UpdateFrameSize(&SLAVE_EXTERNAL_DEVICE, 8U);
/* Update Transfered Bit order */
Lpspi_Ip_UpdateLsb(&SLAVE_EXTERNAL_DEVICE, FALSE);
/* Update Transfer Mode */
Lpspi_Ip_UpdateTransferMode(SLAVE_EXTERNAL_DEVICE.Instance, LPSPI_IP_INTERRUPT);
IntCtrl_Ip_InstallHandler(DMATCD0_IRQn, Dma0_Ch0_IRQHandler, NULL_PTR);
IntCtrl_Ip_EnableIrq(DMATCD0_IRQn);
IntCtrl_Ip_InstallHandler(DMATCD1_IRQn, Dma0_Ch1_IRQHandler, NULL_PTR);
IntCtrl_Ip_EnableIrq(DMATCD1_IRQn);
spi_recv(INST_LPSPI1, spi_send_buf, spi_recv_buf, SIZE_MT2715_EXCHANGE_SPI_MSG, BLOCK_SPI_RX_TX_TYPE);
}
When I use the same settings on S32k312EVB in S32DS3.4 and RTD2.0.0, SpI communication can operate normally, but when I move the program to S32k314 S32DS3.5 RTD4.0.0, it cannot operate normally. , do you have any related questions?
There is no way to enter the interrupt triggering of dma
已解决! 转到解答。
Hi,
check if DMAMUX is configured as well, this would be done in Rm module. You can refer e.g. to
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K312-SPI-Transmit-amp-Receive-Using-DMA-...
BR, Petr
After referring to this example, it was found that there is no way to set polling or interrupt in the IDE, and the DMA setting needs to be called separately in the RM of MCAL.
Since the original version was migrated from S32DS3.4 and does not require RM initialization, I hope there can be an overall difference between S32DS3.4 and S32DS3.5.
DMA can work normally after reconfiguring rm_init.
Hi,
check if DMAMUX is configured as well, this would be done in Rm module. You can refer e.g. to
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K312-SPI-Transmit-amp-Receive-Using-DMA-...
BR, Petr