Merging different projects and initializing multiple sources for multiple UART ports for DMAMUX

cancel
Showing results for 
Search instead for 
Did you mean: 

Merging different projects and initializing multiple sources for multiple UART ports for DMAMUX

Jump to solution
355 Views
VolcanicCheese
Contributor III

Question1

I am currently working on implementing LPUART on top of the the powermode switch example code. From what I understand, transferring code from different project does not work because of the Freertos configuration/setting the project is defined as. How do I check if the configuration of the Freertos in the powermode switch example code would work in corresponding with the code written LPUART edma example code.

Question 2

If I want to initialize three LPUARTS ports, I was not sure how the DMA channels were selected. I was not able to find any documentation and understand how the value are being selected for TX and RX DMA channel. Also, how do I make sure that the channel I set for UART corresponds to the pins that I want to use on the DEV board for UART communication. This is the part of the example code I am not sure about. How to set the LPUART_TX_DMA_CHANNEL? I am assuming that all the LPUART would be set under one DMAMUX and is that a safe assumption.

/* Set channel for LPUART */
DMAMUX_SetSource(DMAMUX, LPUART_TX_DMA_CHANNEL, kDmaRequestMuxLPUART1Tx);
DMAMUX_SetSource(DMAMUX, LPUART_RX_DMA_CHANNEL, kDmaRequestMuxLPUART1Rx);
DMAMUX_SetSource(DMAMUX, LPUART_TX_DMA_CHANNEL, kDmaRequestMuxLPUART2Tx);
DMAMUX_SetSource(DMAMUX, LPUART_RX_DMA_CHANNEL, kDmaRequestMuxLPUART2Rx);
DMAMUX_SetSource(DMAMUX, LPUART_TX_DMA_CHANNEL, kDmaRequestMuxLPUART3Tx);
DMAMUX_SetSource(DMAMUX, LPUART_RX_DMA_CHANNEL, kDmaRequestMuxLPUART3Rx);

0 Kudos
1 Solution
349 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @VolcanicCheese ,

1. There is no settings or restrictions for use  LPUART in freertos.

2. Please refer to the DMA mux chapter in reference manual. Each DMA channel can only be used once. So, at least you should 

DMAMUX_SetSource(DMAMUX, 1, kDmaRequestMuxLPUART1Tx);
DMAMUX_SetSource(DMAMUX, 2, kDmaRequestMuxLPUART1Rx);
DMAMUX_SetSource(DMAMUX, 3, kDmaRequestMuxLPUART2Tx);
DMAMUX_SetSource(DMAMUX, 4, kDmaRequestMuxLPUART2Rx);
DMAMUX_SetSource(DMAMUX, 5, kDmaRequestMuxLPUART3Tx);
DMAMUX_SetSource(DMAMUX, 6, kDmaRequestMuxLPUART3Rx);

 

Regards,

Jing

View solution in original post

1 Reply
350 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @VolcanicCheese ,

1. There is no settings or restrictions for use  LPUART in freertos.

2. Please refer to the DMA mux chapter in reference manual. Each DMA channel can only be used once. So, at least you should 

DMAMUX_SetSource(DMAMUX, 1, kDmaRequestMuxLPUART1Tx);
DMAMUX_SetSource(DMAMUX, 2, kDmaRequestMuxLPUART1Rx);
DMAMUX_SetSource(DMAMUX, 3, kDmaRequestMuxLPUART2Tx);
DMAMUX_SetSource(DMAMUX, 4, kDmaRequestMuxLPUART2Rx);
DMAMUX_SetSource(DMAMUX, 5, kDmaRequestMuxLPUART3Tx);
DMAMUX_SetSource(DMAMUX, 6, kDmaRequestMuxLPUART3Rx);

 

Regards,

Jing