cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
258 Views
Registered: ‎02-14-2020

FreeRTOS on MicroBlaze with FPU - workaround?

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?

Brian

0 Kudos
2 Replies
Highlighted
Observer
Observer
193 Views
Registered: ‎04-26-2008

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.

Regards,
Richard.

+ http://www.FreeRTOS.org
The de facto standard, downloaded every 4.2 minutes during 2015.

+ http://www.FreeRTOS.org/plus
IoT, Trace, Certification, TCP/IP, FAT FS, Training, and more...
Highlighted
Observer
Observer
73 Views
Registered: ‎12-03-2019

Hi Richard,
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

 

0 Kudos