Using FPU in ISR and main() Code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-10 2:17 AM - edited ‎2024-08-10 2:19 AM
I want to use the FPU in an ISR. Will I have context switching issues or i have to specifically make changes in the System_stmxx.c if i am using code generated from CubeIDE.
Do i need to setup these registers explicitly or it is handled by CubeIDE by default? (i didn't found these bits explicitly setup in System_stmxxx.c )
CubeIDE Ver: 1.16.0
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-10 7:06 AM
Those two bits are set by default, so no explicit setup is needed.
There are no other issues or special considerations you need to make to get this to work. When the first FPU instruction is used within an ISR, the FPU registers are pushed onto the stack. This is handled by the core. You'll lose some cpu cycles due to this, but the program will function as intended.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-10 7:06 AM
Those two bits are set by default, so no explicit setup is needed.
There are no other issues or special considerations you need to make to get this to work. When the first FPU instruction is used within an ISR, the FPU registers are pushed onto the stack. This is handled by the core. You'll lose some cpu cycles due to this, but the program will function as intended.
