Michael
The uTasker project includes K60 Rx DMA ring buffer support - either circular as you have suggested as solution, full-buffer or half-buffer interrupt (less useful though). Full source available at:
http://www.utasker.com/forum/index.php?topic=1721.0
Usage: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF
The ring buffer size can be any length (doesn't need to be a modulo length).
With Rx DMA there is little point in HW flow control since the DMA ensures that no reception is lost at the byte level. You just need to ensure that the application polls at a rate that doesn't allow the ring buffer to overflow - the K60 has quite a lot of RAM so the buffer size can be set fairly large to bridge the worst case.
Personnally I have used the method in a communication product using multiple UARTs in the 1.5MBaud region (specifically to route IP data over serial based RF links) and know of no issues (in production for around 3 years and several thousand in the field). In parallel there are Ethernet and USB operations taking place.
Typical usage:
// Configuration
//
TTYTABLE tInterfaceParameters; // table for passing information to driver
tInterfaceParameters.Channel = 0; // set UART channel for serial use
tInterfaceParameters.ucSpeed = SERIAL_BAUD_921600; // baud rate
tInterfaceParameters.Rx_tx_sizes.RxQueueSize = (4 * 1024); // input buffer size
tInterfaceParameters.Rx_tx_sizes.TxQueueSize = (1 * 1024); // output buffer size
tInterfaceParameters.Config = (CHAR_8 + NO_PARITY + ONE_STOP + CHAR_MODE);
tInterfaceParameters.ucDMAConfig = (UART_TX_DMA | UART_RX_DMA); // activate DMA on transmission and use free-running DMA on rx
if ((SerialPortID = fnOpen(TYPE_TTY, ucDriverMode, &tInterfaceParameters)) != NO_ID_ALLOCATED) { // open or change the channel with defined configurations (initially inactive)
fnDriver(SerialPortID, (TX_ON | RX_ON), 0); // enable rx and tx
}
// In polling task
//
unsigned char ucRxBuffer[RX_BUFFER_SIZE];
unsigned long ulLength = fnRead(SerialPortID, ucRxBuffer, RX_BUFFER_SIZE); // extract max RX_BUFFER_SIZE size from the UART input buffer
if (ulLength != 0) {
// process ulLength of reception
}Although it would be nice to have some other mechanisms in the HW to signal the DMA progress you shouldn't have any practical issues with this on the K60.
Regards
Mark