S32K144 LPUART0 EDMA

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

S32K144 LPUART0 EDMA

1,800 Views
海雄周
Contributor II

Hi:

  Program source is as follows:

     uint8_t  uarttxBuff[8]={0,};

    uarttxBuff[0]=0x2f;
    uarttxBuff[1]=1;
    uarttxBuff[2]=2;
   uarttxBuff[3]=3;
   uarttxBuff[4]=4;
   uarttxBuff[5]=5;
   uarttxBuff[6]=6;
   uarttxBuff[7]=7;

EDMA_DRV_Init(&dmaController1_State, &dmaController1_InitConfig0,edmaChnStateArray, edmaChnConfigArray, EDMA_CONFIGURED_CHANNELS_COUNT);

EDMA_DRV_ConfigSingleBlockTransfer(0,EDMA_TRANSFER_MEM2PERIPH,(uint32_t)DMA_TCD_SADDR_SADDR(&uarttxBuff), 0x4006A01C,EDMA_TRANSFER_SIZE_1B,4);

EDMA_DRV_TriggerSwRequest(0);

  LPUART0 can only send the first data:0x2f;Can not send the first four data(uarttxBuff[0]~uarttxBuff[3]).

If changed to bulk transmission:EDMA_DRV_ConfigMultiBlockTransfer(0,EDMA_TRANSFER_MEM2PERIPH,(uint32_t)&uarttxBuff[0], 0x4006A01C,EDMA_TRANSFER_SIZE_1B,4,2,1)

It is the same, sending only the first data
Tags (1)
0 Kudos
2 Replies

1,306 Views
c_joshi
Contributor II

Have you checked this thread?

I think there was same issue and she/he could debug it. Check the answers.

LPUART - eDMA configuration 

Solution: I solved the problem by changing the priority of the DMA channel 0 (the one connected to the LPUART1_RX) to 2 instead of 0.

0 Kudos

1,306 Views
razva_tilimpea
NXP Employee
NXP Employee

Hi,

You must configure all necessary channels in EDMA_DRV_Init and after that you call LPUART_DRV_Init. Please be sure that dma configurations initializes the same channels as the channels used in LPUART initialization and LPUART is in DMA mode.

Please take a look at LPSI - DMA example because is a similar usecase.

Best regards,

Razvan

0 Kudos