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.

Printf support for TMS570 Code Composer Studio

Other Parts Discussed in Thread: TMS570LS20216

Hi All,

How do I enable "printf" support for TMS570 Code Composer Studio?

- Tried the procedure indicated at 

http://processors.wiki.ti.com/index.php/Printf_support_for_MSP430_CCSTUDIO_compiler

- Then, I modified the default linker command file (sys_link.cmd) by adding

.sysmem  : {} > RAM 

in Section Configuration

but still nothing was printed to the Debug Console when I ran the program.

I'm using TMS570LS20216 USB Kit  with Code Composer Studio 4.2.4.00033 with the ff. setup

Code Generation Tool: TI v4.6.6

Runtime Support Library: rtsv7R4_T_be_v3D16_eabi.lib

Regards,

Dennis

  • Hi All,

    I managed to display the "Hello World" message in the console window when I used the 

    printf("Hello World\n");

    , but when I removed the "\n" character in the code:

    printf("Hello World");

    nothing is displayed in the console window.

    What's the reason for such behaviour? 

  • Hello Dennis,

    A couple of comments:

    1) We confirmed your observation. Also, if you have multiple printf statements and one with "\n", the previous strings are also printed out.

    2) I am not sure why console behaves like this; hence will forward your question to the CCS experts, who can elaborate on this.

    Regards,
    Diwakar

  • Hello,

    Output will be sent to the console when the buffer gets flushed. \n will flush the buffer. Otherwise I believe it will trigger when the buffer is full or when the program exits.

    Thanks

    ki

  • Ki-Soo Lee said:
    Output will be sent to the console when the buffer gets flushed. \n will flush the buffer. Otherwise I believe it will trigger when the buffer is full or when the program exits.

    More info on this:

    http://processors.wiki.ti.com/index.php/Tips_for_using_printf#Flushing

    ki

  • Hi Diwakar,

    I'm a user of TMS570LS04X board. I want to use printf function in my ccs project.. But it really can't work. Here is my project,please give me some advices.Thank you!!

    void main(void)
    {
    /* USER CODE BEGIN (3) */
        uint16_t value;
        uint16_t i = 0;
        //char buffersize[512];
        gioInit();
        hetInit();

        add_device("dbgu", _SSA,
                DBGU_open, DBGU_close,
                DBGU_read, DBGU_write,
                DBGU_lseek, DBGU_unlink, DBGU_rename);
        fopen("dbgu","w");
        freopen("dbgu:", "w", stdout);
        setvbuf(stdout, NULL, _IONBF, 0);

    It goto error when run setvbuf(stdout, NULL, _IONBF, 0);

    The full project is                  6874.TMS570LS04x_KEY_SERAIL.rar