I’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. Are you running other tasks that could also be performing floating point operations? You might want to check if the same is true for the PIC32 parts and if so, if the port is in fact saving the math variables to each task’s stack.
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.
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?
There was a change made between V6.0.1 and V6.0.2 that could effect that (unlikely, but could). If your version is pre V6.0.2 could you update to the latest version and try it again?