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.

Compiler/MSP432P401R: print 32 bits number on terminal

Part Number: MSP432P401R


Tool/software: TI C/C++ Compiler

Hi!

I'm trying to print 32 bits number (input) to the terminal. However, it didn't print anything (or maybe I do not know where to look for the output). I got warnings when I run the project. Below is the warning and I include the lines.

"../project_zero.c", line 1169: warning #225-D: function "printf" declared implicitly

case LED_CHAR1:
        switch (PROFILE_ID_CHARTYPE(charID))
        {
        case PROFILE_VALUE:
            //32 bits
            LEDService_getParameter(charID, &value);
            printf("%d\n", value);
            break;

        default:
            break;
        }
        break;
       

"../Profile/led_service.c", line 501: warning #70-D: integer conversion resulted in truncation ".

 case LED_CHAR1:
        switch (PROFILE_ID_CHARTYPE(charID))
        {
        case PROFILE_VALUE:
            if (len == sizeof(ls_LED0OnOFFVal))
            {
                memcpy((uint8_t *)&ls_LED032BitsVal, pData, sizeof(ls_LED032BitsVal));
                status = SNP_SUCCESS;
                notifyApp = LS_LED0_32BITS_UUID;
            }
            break;

./Profile/led_service.c", line 535: warning #169-D: argument of type "uint8_t" is incompatible with parameter of type "void *__restrict__" "..

/Profile/led_service.c", line 537: warning #70-D: integer conversion resulted in truncation

 case LED_CHAR3:
        switch (PROFILE_ID_CHARTYPE(charID))
        {
        case PROFILE_VALUE:
            if (len == sizeof(ls_LED0SwitchVal))
            {  
                memcpy(ls_LED0SwitchVal, pData, sizeof(ls_LED0SwitchVal));
                status = SNP_SUCCESS;
                notifyApp = LS_LED0_HA_INTENSTITY_UUID;
            }
            break;

Thanks,

Janna Razali

  • Please see the article Tips for using printf, and observe the tips it contains.  From this ...

    Janna Razali said:
    "../project_zero.c", line 1169: warning #225-D: function "printf" declared implicitly

    ... it is clear you need to #include <stdio.h>

    Janna Razali said:
    maybe I do not know where to look for the output

    It appears in the Console view of CCS. If you run outside of control of CCS, you won't see anything.

    Thanks and regards,

    -George