AnsweredAssumed Answered

MC13224v Floating point calculations failed

Question asked by Guest on Jul 27, 2009
Latest reply on Aug 3, 2009 by Guest

I have problems with floating point calculations. When I do this simple test the floating point calculation complete failed.

 

1: Create a Generic Application with the Freescale Beekit 1.9.8 and codebase ARM7 SMAC 1.1.2

2: Set the security option in the property list tab

3: Export the solution to IAR 5.20

 

I use the terminal I/O screen in the view menu to watch the debug messages.

 

4: Go to the options windows and change the follow options.

a) General Options > Library Configuration > Library low-level interface implementation to Semihosted

b) General Options > Library options > Printf formatter to Full.

 

5: Add the follow lines to the generic_app(void) function

  printf("Test float 1 %2.2f\n\r", 142.567);
  printf("Test float 2 %2.5f\n\r", 67.52);
  printf("Test float 3 %2.2f\n\r", 9.3332);
  printf("Test float 5 %4.2f\n\r", 9372.43);

 

6: Download and debug the application to a MC13224v development board.

 

7: Now open the terminal I/O windows and watch the result. I get the follow strange ouput.

 

Test float 1 -740805657577357739210128000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.00

Test float 2 -0.00000

Test float 3 0.00

Test float 5 0.00

 

Test float 1 -740805657577357739210128000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.00

Test float 2 -0.00000

Test float 3 0.00

Test float 5 0.00

 

When I do the same test with the MAC codebase project, I got the same result. Why doesn't this work?

Outcomes