Hi Mario,
I am calling again the dma_rx because I still receive data on the UART, and I cannot allocate a buffer more than 2047 bytes ( according nxp documentation ).
So I ask for a new DMA request.
The best will be to have a DMA that allows circular buffer.
I have tried the dma_example, and I well receive my data .
If I wait for dma_done in main loop and do not lost any buffer, but the problem is that it blocks all other event and especially BLE.
while(1)
{
done = FALSE;
dma_rx(DMA_TRANS_BYTE, DMA_UART1_RX, (uint32_t)rxbuffer,4, dma_done);
while(done == FALSE);
if(rxbuffer[0] != FIRST_MARKER_BYTE)
{
uart_printf(QN_UART0, (uint8_t *)"Lost BYTES!!!\n");
}
}
if I do the second request in the call_back,
void dma_done(void)
{
dma_rx(DMA_TRANS_BYTE, DMA_UART1_RX, (uint32_t)rxbuffer, 4, dma_done);
if(rxbuffer[0] != FIRST_MARKER_BYTE)
{
uart_printf(QN_UART0, (uint8_t *)"Lost BYTES!!!\n");
}
}
}
I lost some bytes between the requests. If I use huge DMA buffer, I do not have any data lost on the requested buffer, it's only between the requests
Regards,
Oliver