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.

  • TI Thinks Resolved

[FAQ] CCS/MSP-EXP430FR5994: Using puts

Intellectual 320 points

Replies: 4

Views: 197

Part Number: MSP-EXP430FR5994

Tool/software: Code Composer Studio

Hello,

I'm new to the MSP430. Using the MSP43fr5994 launchpad,

Using Code Composer Studio  9.1.0.00010

Code is based on 'BlinkLED...' example.

Code is compiling and running well (LED is toggled) but I'm not seeing any output of the puts in the CCS 'Console' tab.

What is missing?

#include <driverlib.h>
#include <stdio.h>

int main(void) {

    volatile uint32_t i;

    // Stop watchdog timer
    WDT_A_hold(WDT_A_BASE);

    // Set P1.0 to output direction
    GPIO_setAsOutputPin(
        GPIO_PORT_P1,
        GPIO_PIN0
        );

    // Disable the GPIO power-on default high-impedance mode
    // to activate previously configured port settings
    PMM_unlockLPM5();

    puts("Started");

    while(1)
    {
        // Toggle P1.0 output
        GPIO_toggleOutputOnPin(
            GPIO_PORT_P1,
			GPIO_PIN0
			);
        puts("1");

        // Delay
        for(i=100000; i>0; i--);
    }
}

Thanks.

  • how long did you give it? Did you try a fflush()? Are you running under the debugger?

  • In reply to Keith Barkley:

    Keith Barkley

    how long did you give it? Did you try a fflush()? Are you running under the debugger?

    1. I give it a few seconds, something like 30 seconds (but isn't it should appear immediately (1-2 seconds) ?)

    2. Tried also with fflush, no change.

    3. Running under debugger with Code Composer Studio. Launchpad is connected via USB.

    So using fflush my code is:

        while(1)
        {
            // Toggle P1.0 output
            GPIO_toggleOutputOnPin(
                GPIO_PORT_P1,
    			GPIO_PIN0
    			);
            puts("1");
            fflush(stdout);
    
            // Delay
            for(i=100000; i>0; i--); //1 second delay
        }

    It seems that the code is running and Led1 on launchpad is toggling each ~1 second. but no puts..

  • In reply to Ron Shem:

    One of the Tips for Using Printf usually fixes the problem.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    Visit this FAQ to learn how to search for a bug

  • In reply to George Mock:

    George,

    Thanks for replay.

    Indeed, Setting the heap size to 400 bytes (Originally was 160 in the exmaple) solved the problem. 

    (Stay the stack size with 160 bytes as was originally in the example )

    Thanks.

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.