transfer two UARTs with DMA at the same time

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User7688
Level 2
Level 2
I want to transfer the data from Memory to UART using the DMA. (XMC4500 RELAX KIT)

Is it possible to transfer two UARTs with DMA at the same time?

DMA003_Handle0 transfers them first 256 Bytes, and stops DMA003_Handle1.

my code:

UART001_Handle0 -> 115200 bps
UART001_Handle1 -> 1200 bps

size = 256

DMA_UART_TRANSFER(DMA003_Handle0, (uint32_t)&source_buffer, UART001_Handle0, size);
DMA_UART_TRANSFER(DMA003_Handle1, (uint32_t)&source_buffer, UART001_Handle1, size);


uint32_t DMA_UART_TRANSFER(DMA003_ChannelHandleType DMAH, uint32_t SRC, UART001_HandleType UART, uint32_t LEN)
{
uint8_t MappedSRno;
status_t status = DAVEApp_SUCCESS; // Declaration of return variable for DAVE3 APIs

DMAH.ChConfig.SrcAddress = (uint32_t)SRC;
DMAH.ChConfig.DstAddress = (uint32_t)&UART.UartRegs->IN[0]; // (&destination_buffer);
DMAH.ChConfig.BlockSize = LEN;

status = DMA003_SetChannelTransferParams(&DMAH,&DMAH.ChConfig);
if ( status != DAVEApp_SUCCESS)
return status;

status = DMA003_StartTransfer(&DMAH);
if (status != DAVEApp_SUCCESS)
return status;

MappedSRno = (((uint32_t)UART.UartRegs->TBCTR & USIC_CH_TBCTR_STBINP_Msk) >> USIC_CH_TBCTR_STBINP_Pos);
UART.UartRegs->FMR |= ((uint32_t)(0x01U << (USIC_CH_FMR_SIO0_Pos + MappedSRno)));

return status;
}


425.attach
0 Likes
3 Replies
User7688
Level 2
Level 2
please i need to know if is possible to use this configuration, any response from anyone?

thanks in advance!

pd: sorry for my english
0 Likes
User7688
Level 2
Level 2
already solved, thanks
0 Likes
User5327
Level 4
Level 4
Hi edgardocerone,
can you describe your solution? or upload your example?
Thanks
0 Likes