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.

MSP432E411Y: Why is System_printf() recommended instead of System_printf().

Guru 12965 points
Part Number: MSP432E411Y


Hi, 

[Question 1]
"spruex3v" seems to strongly recommend using System_printf() instead of printf(). Why is System_printf() recommended?

[Question 2]
This is a continuation of question 1.
In the MSP432E411Y implementation code, printf() is used to check whether a certain function is being executed, and the character string is output to the CCS console. When printf() is used, it is output as shown below.


From the contents of question 1, I tried using System_printf(), but this function does not output the string to the CCS console.
Do I need to do anything special to be able to output to the console?

Thanks,

Astro

  • From what I understand, the System_printf is more efficient, but it seems to only works from a task context. If you try and call it before BIOS_Start(), bad things happen.

    To get output to the console:

    1) In the sys config GUI - Display, Change the Display type from UART to HOST.

    2) Where you initialise the display with
    display = Display_open(Display_Type_UART, NULL);

    change that to 

    display = Display_open(Display_Type_HOST, NULL);

    I think (kind of guess) that using the console has some processor overhead. I prefer using the UART option and, in the Display setup in the GUI, tick use UART_2. This doesn't mean use UART number 2, but means use the extended UART_2 driver which supports DMA so, with no real evidence, I have convinced myself that this is more efficient Slight smile

    Jim

  • Hi,

      Thanks to Jim for the information.

      While printf can be used, It takes quite a few resources and cycles to execute and includes a breakpoint as well. System_printf() is a little “lighter” in terms of footprint and execution time and many users use it to print error messages to the Console screen during the debug cycle of their development.