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.

System_printf() doesn't print?

I'm trying a short example to learn about tasks. But the System_printf() doesn't print.

This doesn't work:

void main()
{
    System_printf("hello world\n");

    BIOS_start();
}

void gpio_led_task_func(UArg arg0, UArg arg1)
{
    System_printf("gpio_led_task_func Entering\n");

    System_printf("gpio_led_task_func Exiting\n");

}

 

This works:

 

void main()
{
    System_printf("hello world\n");

    BIOS_start();
}

void gpio_led_task_func(UArg arg0, UArg arg1)
{
    System_printf("gpio_led_task_func Entering\n");

    System_printf("gpio_led_task_func Exiting\n");

    BIOS_exit(0);
}

It prints all text when executing BIOS_exit().

What am I doing wrong?

 

 

  • Marko,

    The System output functions are configurable (pluggable) to accommodate different app needs. See the docs here:

    http://rtsc.eclipse.org/docs-tip/Using_xdc.runtime_System

    From your description above, it looks like you are using the SysMin module. This implementation just buffers the output characters in memory. Optionally, at exit time (BIOS_exit()), it will send those characters to the C stdio stdout stream. You could also force this to happen before exit by calling System_flush() as needed.

    Alternatively, you could switch to using the SysStd module. This implementation sends characters directly to stdout. While this lets you see the output sooner, it does have a bigger real-time impact as the default is for the characters to be sent via JTAG up to the host.

    The wiki article above shows how to make the switch between SysMin and SysStd in your .cfg file. You can also do it using the GUI editor for .cfg files that comes with CCS.

    Mark