Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: SYSCONFIG
Hello,
I try to use 4 UARTs on AM243x and enable DMA for all of them. For some preliminary tests I just modified the uart_echo_dma example.
Following UARTs should be used:
USART1
USART2
USART3
USART4
I added all of them into sysconfig and activated DMA Mode for transfer mode. Running the application Drivers_open() then tries to open all 4 UARTs. However, for last UART (USART4) it fails.
[MAIN_Cortex_R5_0_0] ASSERT: 0.10212s: uart/v0/dma/udma/uart_dma_udma.c:UART_udmaInitRxCh:129: UDMA_SOK == retVal failed !!!
If I delete a UART e.g. USART3 the code works again. So, for me it rather seems to be a problem with the number of USARTs than with one particular USART.
My question is can 4 UARTs with DMA be used together/parallel or is there any restriction?
What can I do to overcome this error? As far as I see the error seems to occur in Udma_chAllocResource() (returns -5), which calls Udma_rmAllocRxCh(). There rmInitPrms->numRxCh is set to 3. This setting/limit seems to originate from Udma_rmGetSciclientDefaultBoardCfgRmRange(), so this is a hard limit for the board/I cannot use 4 DMA channels?
Here the relevant part of sysconfig:
/** * Write custom configuration values to the imported modules. */ uart1.$name = "CONFIG_UART_CONSOLE"; uart1.intrEnable = "DMA"; uart1.operMode = "13X"; uart1.baudRate = 921600; uart1.UART.$assign = "USART1"; uart2.$name = "CONFIG_UART2"; uart2.intrEnable = "DMA"; uart2.baudRate = 921600; uart2.operMode = "13X"; uart2.UART.$assign = "USART2"; uart3.$name = "CONFIG_UART3"; uart3.operMode = "13X"; uart3.baudRate = 921600; uart3.intrEnable = "DMA"; uart3.UART.$assign = "USART3"; uart4.$name = "CONFIG_UART4"; uart4.baudRate = 921600; uart4.operMode = "13X"; uart4.intrEnable = "DMA"; uart4.UART.$assign = "USART4"; udma1.$name = "CONFIG_UDMA0"; uart1.udmaDriver = udma1; uart2.udmaDriver = udma1; uart3.udmaDriver = udma1; uart4.udmaDriver = udma1; udma1.instance = "PKTDMA_0";