ThreadX Context Save/Restore of Floating Point Registers for Cortex-R5
I'm working on setting up ThreadX with Cortex-R5F on Xilinx Ultrascale+ R5F. I've noticed some data corruption associated with using floating point registers on memcpy and now looking at _tx_thread_context_save for R5 port, it seems like it doesn't save context floating point registers.
There are some references to VFP support on other processor ports but isn't much documentation to go off.
Is it possible to use hard floating point math on R5 with ThreadX?
Some of the other ARM ports seem to have support for using TX_ENABLE_VFP_SUPPORT then using tx_thread_vfp_enable to enable it, but the R5 is missing is the extension define here:
https://github.com/eclipse-threadx/threadx/blob/master/ports/cortex_r5/gnu/inc/tx_port.h#L197
Like for the A9: https://github.com/eclipse-threadx/threadx/blob/master/ports/cortex_a9/gnu/inc/tx_port.h#L199
Funny, seems related to our #382 two weeks before your report, we are on the same problematics
Our Quick and Dirty solution is , for now, building in softFP...
@eclipse-threadx/iot-threadx-committers and @eclipse-threadx/iot-threadx-contributors: Please provide your feedback.
It looks like all this is missing are the prototypes in tx_port.h, e.g., the VFP code and enable/disable APIs are in the assembly port files. You do need to build the assembly code with TX_ENABLE_VFP_SUPPORT defined though.
@austinawolf Following suggestions from @billlamiework: (1) Add "#define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; " to your tx_port.h (2) Rebuild the ThreadX library and all the application code with the symbol TX_ENABLE_VFP_SUPPORT defined.
The ThreadX team will review a fix for the next release.
Got it, thanks @billlamiework @yuxinzhou5