Closed epibaikas closed 4 weeks ago
Hi @epibaikas,
Sorry we didn't explain clearly how to use uart API. After receiving UART data, UART RX should be enabled again to receive incoming data. You can modify the uart_dma_rx_cb() function as follows.
void uart_dma_rx_cb(void)
{
int i;
xprintf("Transfer : RX Done\r\n");
xprintf("Data Received: \r\n");
for (i = 0; i < g_datasize; i++)
xprintf("0x%02x,", rbuffer[i]);
memset(rbuffer, 0x00, g_datasize);
dev_uart_ptr->uart_control(UART_CMD_SET_RXINT_BUF, (UART_CTRL_PARAM)&rx_buffer);
dev_uart_ptr->uart_control(UART_CMD_SET_RXINT, (UART_CTRL_PARAM)1);
}
Hi, I am trying to receive data over the UART0 peripheral through interrupts. I am following example 4 (Usage-4) from the
hx_drx_uart.h
header file.I would like the
uart_dma_rx_cb()
interrupt service routine to be triggered every time the rx_buffer becomes full with new data. However, with the example code, the callback function is triggered only the first time that therx_buffer
becomes full. Therefore, I believe that it is necessary to somehow lower the flag that is raised for the interrupt so that the callback may be triggered again.What changes could I make to accomplisht that?
Here is my current code:
Global variables
Main function:
Callback function:
The
uart_pinmux_cfg()
function that I call frompinmux_init()
is: