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.

Will System_flush() output or clear output buffer?

Hi,

When I run a GPIO project for Tiva-C 1294 LaunchPad, it is found that the SysMin does not show the message as expected. After step through the code, I see the message before System_flush(). The message in the buffer is cleared after System_flush().

Here is the code:

int main(void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initUART();

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the GPIO Interrupt example\nSystem provider is set"
                  " to SysMin. Halt the target to view any SysMin contents in"
                  " ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* install Button callback */
    GPIO_setCallback(Board_BUTTON0, gpioButtonFxn0);

    /* Enable interrupts */
    GPIO_enableInt(Board_BUTTON0);

    /*
     *  If more than one input pin is available for your device, interrupts
     *  will be enabled on Board_BUTTON1.
     */
    if (Board_BUTTON0 != Board_BUTTON1) {
        /* install Button callback */
        GPIO_setCallback(Board_BUTTON1, gpioButtonFxn1);
        GPIO_enableInt(Board_BUTTON1);
    }

    /* Start BIOS */
    BIOS_start();

    return (0);
}

There is some posts on the forum, such as the below link. All are contrary to what my example shows. Is there something different from those old threads and the comments before the System_flush() line.

    /* SysMin will only print to the console when you call flush or exit */

The config file is also attached for your reference.3771.gpiointerrupt.cfg

  • This picture is shown the message is displayed without flush.

    In the original example (without flush commented out), flush will clear the output buffer, i.e. there is no message under OutputBuffer.

    Thanks,

  • If you are using SysMin, the output is in an internal buffer that can be viewed via ROV. If you call System_flush, the output is flushed to the CCS CIO console. The internal buffer is cleared after a System_flush. If you have SysMin.flushAtExit set to true (which is the default value) in the .cfg, when the application terminates, the internal buffer is also flushed to the CCS CIO console.