flop.c fail after cache enable

Hi: when I enable data cache, flop.c fails in float data calculate. but it is correct when I disable cache. I found vCompetingMathTask3 and vCompetingMathTask4 malloc a memory space to save result. and those result changes in malloced memory sometimes.. but vCompetingMathTask1 and vCompetingMathTask2 never fails in both cache enable or disable.. anyone can help ? Vincent

flop.c fail after cache enable

Which port? Sometimes you must call portTASKUSESFLOATING_POINT() in a task before it uses floating point instructions.

flop.c fail after cache enable

my cpu is a special cpu which is not in demo project… I don’t see flop.c call portTASKUSESFLOATING_POINT() the API ? how to port the API ? is there a example ?

flop.c fail after cache enable

anyway, I am alwaysing use soft float point… there is no FPU inside

flop.c fail after cache enable

If you are using soft floating point, then the floating point routines are just C function, so there should be no difference in behaviour when you call a C function that is not using floating point instructions to one that is using floating point instructions. Maybe the floating point emulation functions are using a lot of stack – do you have stack overflow checking switched on? As this is your own port, are you absolutely sure the tack overflow checking is working? Is your port saving and restoring all the processor’s special purpose registers correctly? Are the floating point emulation functions thread safe?

flop.c fail after cache enable

before cache off, all demo common example run smoothly and work well … but after cache on, I only found flop.c fail so far… I enable #define configCHECKFORSTACK_OVERFLOW 1 in config file… Are the floating point emulation functions thread safe? what does it mean ? I only call vStartMathTasks to create 8 task to run floadting point function and check it with another task … I also dump all tasks stack status and do not find any overflow in stack.

flop.c fail after cache enable

Are the floating point emulation functions thread safe?
what does it mean ?
If you do not have a floating point unit then the compiler will generate a function call for each floating point operation. Are the functions inserted by the compiler safe to call from more than one thread of execution at a time? If they use global variables or shared buffers then they won’t be.