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.

[FAQ] Where is the output of System_printf going?

I'm using SYS/BIOS (the TI-RTOS kernel) in an application. I call System_printf, but I'm not sure where the output is going to. It is not being shown in the console. Help!

  • By default in CCS (and similarily in IAR), printf output goes to a CIO ('C' Input/Output) buffer. When the CIO buffer is full or a EOL character (i.e. '\n') is written, a breakpoint is hit and CCS reads the contents of the buffer. CCS then resumes the target. As one can guess, this action can have very bad implications for real-time performance. For this reason, TI-RTOS includes the System_printf API.

    System_printf has the same basic functionality as printf, however you can configure how the output data is handled. The application can configure how the output is handled by setting the System.SupportProxy in the .cfg file. For example:

    var System = xdc.useModule('xdc.runtime.System');
    var SysMin = xdc.useModule('xdc.runtime.SysMin'); SysMin.bufSize = 1024; System.SupportProxy = SysMin;

    The above sets the output to be handled by SysMin. The SysMin module stores the output characters in an internal buffer (size set by SysMin.bufSize). Storing the output in an internal buffer avoids the real-time impact of standard printf. The output can be viewed via Tools->Runtime Object View (or ROV Classic) in CCS (ROV is supported in IAR also). For example:

    When System_flush() is called or by default, when SysMin.flushAtExit is true and the program terminates, the output is flushed to the CCS console.

    Here are the main System support proxies and a brief description.

    xdc.runtime.SysMin Stores characters in an internal buffer that is viewable from ROV
    xdc.runtime.SysCallback Allows the application to plug in functions that will be called (e.g. putchFxn, abortFxn, etc.) The default callbacks do nothing.
    xdc.runtime.SysStd Basically the same as printf()

    For more details, refer to the SYS/BIOS User Guide's "System Module" section (http://www.ti.com/lit/ug/spruex3u/spruex3u.pdf).

    For SimpleLink SDK users, there is a SimpleLink Academy lab dedicated to how to output debug information. Please refer to dev.ti.com's Resource Explorer and search for your SimpleLink Academy (e.g. http://dev.ti.com/tirex/explore/node?node=ANqagjxZxWnBRB7bx0EnOw__pTTHBmu__LATEST). 

    [The above picture of the SimpleLink Academy lab is rather large, so E2E shrinks it to an icon. Click it to expand it.]