This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1352R: TI15.4 - UART Read Write is delayed.

Part Number: CC1352R
Other Parts Discussed in Thread: SYSBIOS

Hi,

I am using Ti 15.4 Collector example on CC1352R board. I want to perform UART read write operations in the same.

I wrote my UART read function in the “Collector_process” function (after if(collector_event==0) condition), which is called continuously from main.c. I am using the default UART parameter settings provided in the Collector code. So the problem occurs when I type something on the serial interface it takes around 20 seconds to reflect back on the screen. To write it back to console i am using System_printf.

I am not able to figure out the reason for this delay. Is it because of the place I have written UART read in, or is it something else?
Can anyone help me in knowing where I’m going wrong?

Thank You,

Yash.

  • Hello Yash,

    This is because you are using the uart_printf. In this implementation it is intended to be called by the Idle task when nothing else is running.
    This is achieved by setting up the Idle task in the TI-RTOS configuration script like so:

    var Idle = xdc.useModule('ti.sysbios.knl.Idle');
    Idle.addFunc('&uartPrintf_flush');

    This is better to keep up with real time performance, since you are not interfering with the stack process at all and the cpu does not output anything through UART unless it is in the IDLE Task, which basically means it is doing nothing.

    Regards,
    AB
  • Hi AB,
    Thanks for your response. I understood the reason for that delay, so is there any workaround for not getting the delayed output?

    I tried using UART in Callback mode and the delay is significantly reduced(around 3 seconds), but it's still there. So is this delay because of the Sensor's configuration or is it something else?
    If yes, then what configuration is responsible for that? And how can i minimise the delay(in either case - UART in blocking mode and UART in Callback mode).

    Thanks,
    Yash.
  • If you want to write instantly to the console (not recommended since you might affect real time performance), your best bet would be to use the UART_write() API.

    The handle for uart is already extern into the application, all you would need to do is write something along the lines of:

    UART_write(hUart, "Test msg\n\r", sizeof("Test msg\n\r");

    Regards,
    AB