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.

RTOS/CC1310: CC1310 System_sprintf/puts works but printf and System_printf do not

Part Number: CC1310
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

On the CC1310 Launch XL I can get puts to put output to the CCS console reliably.

However System_printf and System_putch do not display anything not sure where the output should be going?

Standard printf is also behaving odd I get no output from it (I would assume it uses the same output  mechanism as puts?) and the UART stuff at the bottom of the function below fails to work if I uncomment the printf statement as if it is corrupting something.

The function below is my added/changed stuff in the main thread of the CC1310 Uart Echo Example if you want to replicate.

Also added following includes

#include <stdint.h>
#include <stddef.h>

#include <stdio.h>

/* Driver Header files */
#include <ti/drivers/GPIO.h>
#include <ti/drivers/UART.h>

/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Clock.h>

/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/runtime/Assert.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>


/* Example/Board Header files */
#include "Board.h"

The updated function:

 void *mainThread(void *arg0)
{
    char        input;
    const char  echoPrompt[] = "SCX Echoing characters:\r\n";
    UART_Handle uart;
    UART_Params uartParams;
    char textbuff[80];
    int i;
    static char msg[]="ABCD123456";

    /* Call driver init functions */
    GPIO_init();
    UART_init();


    puts("SCX PUTS Call More text to this");

    System_sprintf(textbuff,"SCX The System sprintf function result");

    for (i=0;i<10;i++) {
       System_putch(msg[i]);
    }
    System_putch('\n');

    System_flush();

    puts(textbuff);

    // printf("SCX The System printf function");

    /* Configure the LED pin */
    GPIO_setConfig(Board_GPIO_LED0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);

    /* Turn on user LED */
    GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);

    /* Create a UART with data processing off. */
    UART_Params_init(&uartParams);
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_BINARY;
    uartParams.readReturnMode = UART_RETURN_FULL;
    uartParams.readEcho = UART_ECHO_OFF;
    uartParams.baudRate = 115200;

    uart = UART_open(Board_UART0, &uartParams);

    if (uart == NULL) {
        /* UART_open() failed */
        while (1);
    }

    UART_write(uart, echoPrompt, sizeof(echoPrompt));

    /* Loop forever echoing */
    while (1) {
        UART_read(uart, &input, 1);
        input=input+1;
        UART_write(uart, &input, 1);
    }
}

  • Please see:

    Siri

  • Figured it out, mostly!

    The default setup was to use SysCallback with a callback that sent things nowhere?? Kind of a stupid default!

    By either adding a default that sent out the UART or using SysMin that sends to the CCS console I got proper output. Although this should be made easier!

    Despite getting this to work neither is a good solution for putting out realtime debugging if the UART is being used for something else. See my other post regarding debugging messages for more details on what I am looking to do and how I think this is best achieved if only I could get it to work and thats what I need some help with.