configuring DMA RTD for a dummy transfer using S32k3xx

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

configuring DMA RTD for a dummy transfer using S32k3xx

758 次查看
user_244572
Contributor II

Hello,

I am trying to create a dummy transfer between 2 int global variables (source and destination).

I have filled the transfer list as follows :

LocTransferList[0].Param = DMA_IP_CH_SET_SOURCE_ADDRESS;
// LocTransferList[0].Value = (uint32) pwm_get_sin_lut_address();
LocTransferList[0].Value = (uint32) &g_source_variable;

LocTransferList[1].Param = DMA_IP_CH_SET_SOURCE_TRANSFER_SIZE;
LocTransferList[1].Value = DMA_IP_TRANSFER_SIZE_4_BYTE;

LocTransferList[2].Param = DMA_IP_CH_SET_DESTINATION_ADDRESS;
LocTransferList[2].Value = (uint32) &g_destination_variable;

LocTransferList[3].Param = DMA_IP_CH_SET_DESTINATION_TRANSFER_SIZE;
LocTransferList[3].Value = DMA_IP_TRANSFER_SIZE_4_BYTE;

LocTransferList[4].Param = DMA_IP_CH_SET_CONTROL_SOFTWARE_REQUEST;
LocTransferList[4].Value = 0U; /* FALSE */

LocTransferList[5].Param = DMA_IP_CH_SET_CONTROL_EN_MAJOR_INTERRUPT;
LocTransferList[5].Value = 1U; /* TRUE */
LocTransferList[6].Param = DMA_IP_CH_SET_CONTROL_EN_HALF_MAJOR_INTERRUPT;
LocTransferList[6].Value = 0U; /* FALSE */

LocTransferList[7].Param = DMA_IP_CH_SET_CONTROL_DIS_AUTO_REQUEST;
LocTransferList[7].Value = 0U; /* FALSE */

LocTransferList[8].Param = DMA_IP_CH_SET_SOURCE_SIGNED_OFFSET;
LocTransferList[8].Value = 0U; /* Auto add 2 to get next address in the DSPSS Dma read buffer */

LocTransferList[9].Param = DMA_IP_CH_SET_DESTINATION_SIGNED_OFFSET;
LocTransferList[9].Value = 0U; /* Auto add 2 to get address of next Result Buffer */

LocTransferList[10].Param = DMA_IP_CH_SET_MINORLOOP_SIZE;
LocTransferList[10].Value = 1U; /* Transfer in bytes each minor loop (i.e. a Dma request) */

LocTransferList[11].Param = DMA_IP_CH_SET_MAJORLOOP_COUNT;
LocTransferList[11].Value = 1U;

LocTransferList[12].Param = DMA_IP_CH_SET_SOURCE_SIGNED_LAST_ADDR_ADJ;
LocTransferList[12].Value = (uint32) &g_source_variable;

LocTransferList[13].Param = DMA_IP_CH_SET_DESTINATION_SIGNED_LAST_ADDR_ADJ;
LocTransferList[13].Value = (uint32) &g_destination_variable;

LocTransferList[14].Param = DMA_IP_CH_SET_MINORLOOP_EN_DST_OFFSET;
LocTransferList[14].Value = 0U;
LocTransferList[15].Param = DMA_IP_CH_SET_MINORLOOP_SIGNED_OFFSET;
LocTransferList[15].Value = 0U;
 
and then called the transfer :
dma_ret = Dma_Ip_SetLogicChannelTransferList(DMA_LOGIC_CH_0, LocTransferList, LocTransferListNumElems);
 
--> The return of the transfer is DMA_IP_STATUS_SUCCESS, however the destination variable is empty !
 
I have called Dma_Ip_Init() before this and ensured that the initialization is done successfully.
 
What is wrong with my configuration ? Can you provide example for a simple DMA transfer (using RTD) in S32 design studio for S32k3xx ?
 
Thank you in advance.
0 项奖励
回复
1 回复

729 次查看
RomanVR
NXP Employee
NXP Employee

Hi @user_244572.

I recommend referring to the community threads below, which contains example codes demonstrating usage of the DMA with LPSPI:
- Example S32K344 SPI Transmit & Receive Using DMA DS3.5 RTD500

You can also access to a wide variety of examples at the S32K Knowledge Base for S32K3xx device family.

Please let me know if you have any other doubt.

-RomanVR.

Best Regards!
0 项奖励
回复