Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

RTOS/CC2650: UART_read with callback eventually crashes. And I think I tried everything.

$
0
0

Part Number:CC2650

Tool/software: TI-RTOS

I'm using tirtos_cc13xx_cc26xx_2_21_01_08.

I'm running UART_read and UART_write in parallel. The initial naive implementation was having the callback function set via uartParams.readCallback calling UART_read again. From what I read online that is ok, but I see it crashing after an hour or so, the callback function is never called even though there is UART activity on the bus.

I've then moved on to an implementation where the callback function releases a semaphore and the main thread calls _read again when that happens. This was worse than before, but when I add another function checking for the RXE bit to restart the read process I got it the most stable it has been.

    if(Semaphore_getCount(uart_read_sem) != 0)
    {
        Semaphore_pend(uart_read_sem, -1);
        UART_read(uartHandle, &uart_rx_buf[uart_next_rx_bufpos], uart_next_rx_bytes);
    }
    else if(!(HWREG(UART0_BASE + UART_O_CTL) & UART_CTL_RXE))
    {
       // Semaphore_pend(uart_read_sem, -1);
        UART_read(uartHandle, &uart_rx_buf[uart_next_rx_bufpos], uart_next_rx_bytes);
    //    while(1);
    }

But it still crashes. Please see the registers dump attached.

What the heck am I supposed to do here?

Thank you!


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>