Hello Felix
The DMA controller in the KL27 is not as flexible as the eDMA in other parts but what you want to do is possible.
You need to use modulo mode of DMA operation (aligning your buffers on 16, 32, 64, 128... boundaries and using the same size) and then you can use free-running DMA operation. The free-running operation is in fact limited to 64k transfers (due to the max. counter value) but as long as this counter is reset to its max. value periodically (before it counts down to 0) it then is effectively infinite.
The uTasker project supports these mode for its UART and LPUART drivers (on all UARTs up to the DMA channel limit in the HW), including allowing the application to work with free-running DMA rx operation (also allowing FreeRTOS to benefit from the mode for interrupt and data loss free high speed UART reception up to several MBaud).
The operation is included in the open source uTasker version on GitHub for almost all Kinetis parts (including KL27) and allows the operation to be accurately simulated in Visual Studio for developing/debugging/understanding the underlying operation. Or in its supported commercial version with many more features and compatibility with i.MX RT parts.
Eg. Interrupt driver mode:
tInterfaceParameters.Channel = 0; // UART 0, 1, 2
tInterfaceParameters.ucDMAConfig = 0;
fnOpen(TYPE_TTY, FOR_I_O, ptrInterfaceParameters);
DMA transmission mode
tInterfaceParameters.ucDMAConfig = UART_TX_DMA;
fnOpen(TYPE_TTY, FOR_I_O, ptrInterfaceParameters);
DMA transmission and reception mode
tInterfaceParameters.ucDMAConfig = (UART_RX_DMA | UART_RX_MODULO | UART_TX_DMA);
fnOpen(TYPE_TTY, FOR_I_O, ptrInterfaceParameters);
whereby UART_RX_MODULO is needed only by parts without eDMA and the driver then does all the dirty work of aligning buffers accordingly. The user just needs to set the driver flags according to behavioral requirements.
DMA channel allocation is by project defines (with potential limitations due to DMA channels available in the actual device used - up to 4 can be actually used in the KL27!):
#define DMA_UART0_TX_CHANNEL 2 // use this DMA channel when using UART 0 for transmission driven by DMA
#define DMA_UART1_TX_CHANNEL 1 // use this DMA channel when using UART 1 for transmission driven by DMA
#define DMA_UART2_TX_CHANNEL 0 // use this DMA channel when using UART 2 for transmission driven by DMA
#define DMA_UART0_RX_CHANNEL 3 // use this DMA channel when using UART 0 for transmission driven by DMA
#define DMA_UART1_RX_CHANNEL 4 // use this DMA channel when using UART 1 for transmission driven by DMA
#define DMA_UART2_RX_CHANNEL 5 // use this DMA channel when using UART 2 for transmission driven by DMA
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT]