Hi, my UART "flush" function is this
/***********************************************************************
*
*
you call uart66SendBuf
starts UART-DMA sending
task (wait for semaphore)
*
***************************************************************************/
uint32_t uart66SendBuf(const uint8_t * txBuff, uint32_t txSize, uint32_t
timeout)
{
portBASE_TYPE semaphoreStat;
if (uart66.txIrqSync == NULL)
{
LOGM66P(6, logmDebug, "M66portuart66SendBuf() semaphore NULL\n");
return kStatus_UART_NullParameter;
}
semaphoreStat = xSemaphoreTake(uart66.txIrqSync, timeout);
if(semaphoreStat == pdFALSE) // timeout
{
LOGM66P(7, logmDebug, "M66portuart66SendBuf() semaphore take
FAIL\n");
return (kStatus_UART_Timeout);
}
/* Update txBuff and txSize. */
DMA0->TCD[TXDMACH].SADDR = (uint32_t)txBuff;
DMA0->TCD[TXDMACH].BITER_ELINKNO = txSize;
DMA0->TCD[TXDMACH].CITER_ELINKNO = txSize;
/* Enable DMA major loop interrupt */
DMA0->TCD[TXDMACH].CSR = DMA_CSR_INTMAJOR_MASK | DMA_CSR_DREQ_MASK;
/* Start DMA channel */
DMA0->SERQ = 1;
LOGM66P(8, logmDebug, "M66portuart 66SendBuf() UART Tx started\n");
return (kStatus_UART_Success);
}
Radomir
po 25. 5. 2020 v 8:36 odesílatel prashantdev <admin@community.nxp.com>
napsal:
NXP Community
<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>
Re: DMA buffer to Tx UART on K10DN512
reply from prashantdev
<https://community.nxp.com/people/prashantdev?et=watches.email.thread> in *Kinetis
Microcontrollers* - View the full discussion
<https://community.nxp.com/message/1316554?commentID=1316554&et=watches.email.thread#comment-1316554>