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() for IAR projects

Hi,

I'm using the Kernel example "mutex" right-out-of-the-box, no modifications. It compiles and executes fine up until I make the modifications to the "cfg" file to enable System_printf(); (see the 4 lines I added in the screenshot below).

The modifications were based on the thread below

e2e.ti.com/.../470509

I would like to learn how to successfully use System_printf()

Thanks

  • Hi,
    From your cfg file I see right after you assign SysStd as your System SupportProxy (on line 618), you reassigned it to SysCallback in line 619. That was the problem in the post you shared. Remove line 619 because you want SysStd as your SupportProxy as it's the one that prints to the console. Also make sure that your System_printf strings end with '\n' as it pushes characters to CIO when '\n' is received.
    Like the other post described, in your General Options - > Library Configuration settings of your project, ensure that "Semihosted" and "Via Semihosting" buttons are checked.

    Let me know if this helped.
    Moses
  • Hi Moses;

    1) I removed line 619 (i must have misunderstood the post that I referenced).

    2) The "mutex" example project uses '\n' in the System_printf's.

    3) The Library Configurations options were are correct.

    4) The code breaks on the lines after the System_printf's when I place breakpoints there.

    The project now builds without errors (Item #1), but there is still NO output to the console, do I have to "pull that window up", or should it be automatically presented like other windows when needed in the IDE?

    Confused.

  • Hi Saycoda,
    With IAR I remember you need to have the the console window opened up, it doesn't pop up automatically when you print to screen. In case that doesn't still do it, can you share you config file and a screen shot of the Library configuration settings window so I could take a look?

    Thanks,
    Moses
  • 1) I don't know what IAR calls the "console window" so I don't know how o open it up.

    2) attached are the "cfg" file and screenshot.

    2100.mutex.cfg

  • Hi Saycoda,
    Sorry for the delay. The console is called Terminal in IAR. So on the menu options select View -> Terminal to bring it up. Let me know if this works.

    Best,
    Moses
  • Moses,
    Yes, there is output going to the Terminal once I bring it up. But it dribbles out at about three characters at a time. I would have expected the entire string at once System_printf("Running task1 function\n");

    Why would it not printout "Running taskx function"<crlf> instead of "Runn"......."ing"......." tas"......"kx ", etc....... where ......refers to a delay.

    Thanks
  • Hi Saycoda,

       Sorry for the delay. In IAR you can specify different runtime library types that affect how characters are printed to console. By default our project uses the Normal version which doesn't have multibyte buffers that buffer the entire string and outputs it all at once. The Full library configuration supports this.  Here's the Project Options window where you can make this change.

    Regards,

    Moses

  • Thank You for your support Moses!