S32K314 SPI DMA RTD4.0.0 S32DS3.5

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

S32K314 SPI DMA RTD4.0.0 S32DS3.5

跳至解决方案
795 次查看
Alex_hsu
Contributor II

Chip :S32K314

RTD: 4.0.0

S32DS3.5

SPI setting : LPSPI_1, Slave, CS3

Pindefine:

Alex_hsu_6-1708685053622.png

 

Alex_hsu_0-1708684512192.png

Alex_hsu_1-1708684528705.png

DMA

Alex_hsu_2-1708684651321.pngAlex_hsu_3-1708684663732.pngAlex_hsu_4-1708684676162.pngAlex_hsu_5-1708684687242.png

OsIf_Init(NULL_PTR);
 
clock_init(CLOCK_RUN_INST);
 
/* Initialize all pins using the Port driver */
Siul2_Port_Ip_PortStatusType Status_Init_Port = SIUL2_PORT_ERROR;
Status_Init_Port = Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS_PortContainer_0_BOARD_InitPeripherals, g_pin_mux_InitConfigArr_PortContainer_0_BOARD_InitPeripherals);
 

/* 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

 

 

标记 (3)
0 项奖励
回复
1 解答
770 次查看
PetrS
NXP TechSupport
NXP TechSupport

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

在原帖中查看解决方案

0 项奖励
回复
2 回复数
733 次查看
Alex_hsu
Contributor II

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.

0 项奖励
回复
771 次查看
PetrS
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复