S32K322 DMA request

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K322 DMA request

293 Views
vignesh3
Contributor II

How can I know that if peripherals are requesting to the DMA channel or not ?

0 Kudos
Reply
3 Replies

256 Views
vignesh3
Contributor II

Hi @Julián_AragónM ,

I am getting the interrupt but the data not present in the RxBuff array.

can you help me with this I am attaching the code below.

void uartRxDmaReqCallBack(void)
{
while(0);
}
 
int main(void)
{
    /* Write your code here */
//clock init
Clock_Ip_Init(Clock_Ip_aClockConfig);
Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS_PortContainer_0_BOARD_InitPeripherals,g_pin_mux_InitConfigArr_PortContainer_0_BOARD_InitPeripherals);
 
    IntCtrl_Ip_InstallHandler(DMATCD2_IRQn, uartRxDmaReqCallBack, NULL_PTR);
    IntCtrl_Ip_EnableIrq(DMATCD2_IRQn);
 
    IntCtrl_Ip_Init(&IntCtrlConfig_1);
 
    /* init DMA */
Dma_Ip_Init(&Dma_Ip_xDmaInitPB);
/* Initialize DMAMUX via HLD RM driver */
Rm_Init(&Rm_Config_BOARD_INITPERIPHERALS);
Lpuart_Uart_Ip_Init(0U,&Lpuart_Uart_Ip_xHwConfigPB_0_BOARD_INITPERIPHERALS);
Lpuart_Uart_Ip_AsyncReceive(0U,RxBuff,10);
 
    //S32_NVIC->ISPR[(uint32)(DMATCD2_IRQn) >> 5U] = (uint32)(1UL << ((uint32)(DMATCD2_IRQn) & (uint32)0x1FU));
    for(;;)
    {
    Siul2_Dio_Ip_WritePin(LED_PORT,LED_PIN,true);
    delay();
    Siul2_Dio_Ip_WritePin(LED_PORT,LED_PIN,false);
    delay();
        if(exit_code != 0)
        {
            break;
        }
    }
    return exit_code;
}

 

  

0 Kudos
Reply

249 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @vignesh3,

If DMA is reporting data transfer, but you cannot see it, it may be an issue with the cache. Try adding "__attribute__((section(".mcal_bss_no_cacheable")))" to your Tx and Rx buffers. Also, MPU_ENABLE needs to be added if not included already:

Best regards,
Julián

0 Kudos
Reply

269 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @vignesh3,

I assume you are trying to check if a DMA transfer has happened? You can configure an interrupt for the following events: 

  1. The major loop is half complete (INTHALF)
  2. The major loop is complete (INTMAJOR)
  3. A configuration error occurs (EEI)

You can check with the first two if any major loop has been completed after requesting a transfer. You can also check the CHn_CSR field for the ACTIVE & DONE fields. 

  • ACTIVE Status field indicating the channel is currently in execution
  • DONE Status field indicating major loop completion (cleared by software when a channel begins execution)

Please refer to chapter 15.5.6 Monitoring transfer descriptor status from the S32K3XX's Reference Manual as it describes how to monitor the eDMA status.

Best regards,
Julián

0 Kudos
Reply