rtel wrote on Monday, October 11, 2010:
I’m currently using the MPLAB SIM with MPLAB 8.56
As a general rule I don’t like to try and support anything that is done on a simulator. You are testing a small piece of software (FreeRTOS) on a large piece of software (the simulator), and generally it is the large piece of software that is at fault.
In this case, when I was developing the FreeRTOS, the MPLAB simulator definitely did not simulate any FreeRTOS applications correctly, although that was some time ago and maybe it is fixed now?
gives var2 = 1.0 if implemented in main().
gives var2 = 1.999878 if implemented inside a task().
I would say the result was about as close to 1 as a 32bit CPU could get without actually being 1. I don’t see this as a particular issue (?).
'm not sure how the PIC32 compiler / libraries deal with variables for the soft-float routines, but I know the PIC18 libraries use global variables that must be saved with the task’s context during every task switch
The PIC18 is a completely different type of processor, and the compiler does not generate re-entrant code, the PIC32 should do and I would be amazed if it used global memory areas. Despite which, the flop test tasks do not fail, and would if global memory was being used.
portFLOAT va2r = constant / constant works…. i.e. var2 = 4.0 / 2.0 = 2.0
There you are dividing a const by a const, and most compilers (if not all) would do the calculation at compile time and not run time, so your result is not surprising to me. Have you checked the generated asm code to see if anything is being done by the PIC32 itself to get an answer to the division?