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.

CCS/TMS320C6742: Iam Unable to get the floating variable output!!

Part Number: TMS320C6742

Tool/software: Code Composer Studio

i developed a program using float variable but iam unable to get the output i am unable to understand the source of error so anybody please help regarding this issue!!!

CODE:

#include<stdio.h>
void main(void)
{
volatile float a,b,sum,sub,mul,div;
printf("Enter the First Float Number:");
scanf("%f", &a);
printf("\n Enter the Second float Number:");
scanf("%f", &b);
sum=a+b;
sub=a-b;
mul=a*b;
div=a/b;
printf("Floting Substraction of two Number: %f", sum);
printf("\n Floting Substraction of two Number : %f", sub);
printf("\n Floting Multiplication of two Number : %f", mul);
printf("\n Floting Division of two Number : %f", div);

}

  • Hi,

    Can you share which CCS version are you using?
    Is this a bare-metal example or are you running some SDK underneath it?

    Best Regards,
    Yordan
  • Thankyou for your reply!

    Iam Using CCS V4

  • Sandeep,

    Debug your program using the features of CCS. After loading the program, it should run to main(). Put all of the relevant variables in the Local or Watch Windows (I do not remember how to use CCSv4 very well, some of these changed names).

    Use Single-Step-Over or set a breakpoint and run to it (such as on line 9). Then look at the variables to see if they are set correctly. If not, then you should try another method to input data.

    To test the output section, insert variable assignment statements in the code (or force values through the Watch Window) and see if the display is correct from the last printfs.

    The fact that the last printfs display nothing instead of some trash value seems odd. Try making the stack and heap sections larger. I do not know the exact way to do that, but somewhere in the Project->Properties you will find them, probably associated with the linker.

    Regards,
    RandyP