08-21-2020 03:53 PM
I see in the wiki that the MicroBlaze port of FreeRTOS doesn't support the floating point unit. Are there straightforward workarounds for this? For example, would it be sufficient to use vTaskSuspendAll() or task_ENTER_CRITICAL() to block context switching during the math routine?
08-22-2020 11:55 AM
FreeRTOS has at least some floating point support: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/master/portable/GCC/MicroBlazeV9/port.c#L124 But in any case, with the caveats below, if only one task uses the floating point unit nothing should be required - if multiple tasks do then you should be ok if you do what you suggest.
The caveat is that some compilers will use wide floating point registers to optimise things like memory moves within the standard C library - when that is the case each task needs a floating point context.
09-21-2020 10:22 AM
Can you comment on what is the recommended way of doing this?
I have a single task with floating point math which causes Microblaze to throw an exception that is interpreted by the freertos port (v10, Xilinx v1_4) as:
"XEXC_ID_FPU see ulFSR value"
I've tried scoping the floating point operations in a critical block, but the result is the same. If I work on bare metal, all the floating point operations work as expected.
Microblaze was built with FPU support and xparameters.h indicates:
#define XPAR_MICROBLAZE_USE_FPU 2