Thanks for the example code. It was helpful to see another version of the same code that I was working on. I implemented my code to look like your example code. This time I'm including the entire function for triggering a receive packet (modified to match your code). If I call this repeatedly you can see the values that I get from the printf at the end of the function. Specifically nothing (all 0's) where I'm expecting to get something like 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x34. The last two values of the 8-byte packet are a sequence number and CRC8 which are essentially random until I start getting successive packets and start checking the CRC8. Thanks in advance for any more help you can provide.
void CoreUART_TriggerReceivePacket( void )
{
memset( g_ReceivePacket, 0, 8 );
UART3->C5 |= (uint8_t)UART_C5_RDMAS_MASK;
DMA0->TCD[0].SOFF = 0;
DMA0->TCD[0].DOFF = 1;
DMA0->TCD[0].DLAST_SGA = -(unsigned long)8;
DMA0->TCD[0].SLAST = 0;
DMA0->TCD[0].ATTR = DMA_ATTR_SSIZE(0) | DMA_ATTR_DSIZE(0); // 0,0=8-bit
DMA0->TCD[0].SADDR = (uint32_t)UART_GetDataRegisterAddress(UART3);
DMA0->TCD[0].CSR = 0;
DMA0->TCD[0].DADDR = (uint32_t)(&g_ReceivePacket[0]);
DMA0->TCD[0].NBYTES_MLNO = 1;
DMA0->TCD[0].CITER_ELINKNO = (unsigned short)8;
DMA0->TCD[0].BITER_ELINKNO = (unsigned short)8;
// POWER_UP_ATOMIC(6, DMAMUX0); // Don't know what this is supposed to do.
DMAMUX->CHCFG[1] = (uint8_t)((DMAMUX->CHCFG[1] & ~DMAMUX_CHCFG_SOURCE_MASK) | DMAMUX_CHCFG_SOURCE(kDmaRequestMux0UART3Tx));
DMAMUX->CHCFG[1] |= DMAMUX_CHCFG_ENBL_MASK;
DMA0->SERQ = DMA_SERQ_SERQ(0);
UART3->C2 |= (uint8_t)UART_C2_RIE_MASK | UART_C2_RE_MASK;
GPIO_PinWrite( GPIOC, 18, 0); // RTS_
Timer_Wait( 1 ); // Wait's 1-2ms. Should produce at least one packet
GPIO_PinWrite( GPIOC, 18, 1); // RTS_
printf( "0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X\n",
g_ReceivePacket[0], g_ReceivePacket[1], g_ReceivePacket[2], g_ReceivePacket[3],
g_ReceivePacket[4], g_ReceivePacket[5], g_ReceivePacket[6], g_ReceivePacket[7] );
}
Values that I get from the printf
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00