Hi,
I have some strange behaviour related to FPU operation. After some time of testing and trying around I have the feeling, that the real-time kernel does not care about the FPU registers of the LPC3250. In project settings the FPU is enabled normally. But when I have several threads, that make use of the FPU, "strange" things happen. Functions deliver correct results only, if there are "a couple of nops" (3 to 5) between certain floating point operations). Unfortunately this only happens with compiler optimizations set to at least -O2, where debugging is very difficult (cannot see local variables etc.). Furthermore I am not able to see the FPU registers in the IDE at all...
With the FPU disabled globally in the whole project everything is working fine. If I enable the FPU for exactly 1 single C file (with 1 thread using the FPU), still everything is fine. When I enable the FPU for another C file (with another thread using the FPU), floating point operations no longer work (deliver wrong results).
Can anybody confirm this behaviour? Does the real-time kernel safe the FPU registers during context switch? Is the behaviour of the kernel configurable related to this issue? (Can I tell the compiler/linker, that the FPU state shall be safed and restored during context switch?)
I have not found any useful information in the official documentation from Keil. Application note AN10902 from NXP contains at least the hint, that the FPU should be only used by 1 thread, if the scheduler does not care about it. But there is no information about, how Keil scheduler handles this...
any help is greatly appreciated, René