Skip to content

ThreadX Context Save/Restore of Floating Point Registers for Cortex-R5 #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
austinawolf opened this issue May 16, 2024 · 6 comments
Open
Assignees
Labels
discussion Flagged for discussion during the weekly team meeting feature New feature or enhancement request

Comments

@austinawolf
Copy link

austinawolf commented May 16, 2024

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?

@austinawolf austinawolf added the feature New feature or enhancement request label May 16, 2024
@austinawolf
Copy link
Author

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

@ted0xff
Copy link

ted0xff commented May 30, 2024

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...

@fdesbiens fdesbiens added the discussion Flagged for discussion during the weekly team meeting label Feb 27, 2025
@fdesbiens
Copy link
Contributor

@eclipse-threadx/iot-threadx-committers and @eclipse-threadx/iot-threadx-contributors: Please provide your feedback.

@billlamiework
Copy link

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.

@yuxinzhou5
Copy link

@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.

@austinawolf
Copy link
Author

Got it, thanks @billlamiework @yuxinzhou5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Flagged for discussion during the weekly team meeting feature New feature or enhancement request
Projects
None yet
Development

No branches or pull requests

5 participants