Skip to main content
LCE
Principal II
July 24, 2026
Question

FPU: CubeIDE setting overrides register SCB->CPACR

  • July 24, 2026
  • 3 replies
  • 25 views

Heyho,

just played with / checked the FPU on a G431.

I found that the CubeIDE setting overrides the enable via register SCB->CPACR.

So, if source code sets FPU on, but IDE says FPU off, the FPU is off.

That a bug or a feature?

3 replies

mƎALLEm
ST Technical Moderator
July 24, 2026

So if it’s a question on CubeIDE, that must be asked in STM32CubeIDE.

I’m moving the post then.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
TDK
July 24, 2026

That’s not how it works. The IDE can set some things up but once the source code is running it controls things. Recheck your assumptions.

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
July 24, 2026

> if source code sets FPU on

How?

> but IDE says FPU off, the FPU is off

How do you know FPU is off?

 

I don’t use CubeIDE, but my guess would be, that any “FPU on/off” tickbox results in preprocessor symbols being defined/not defined, probably through command-line -Dxxx switch, which are then used in SystemInit()

void SystemInit (void)
{
/* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << (10*2))|(3UL << (11*2))); /* set CP10 and CP11 Full Access */
#endif

so if your code changes that before SystemInit is called, it will be overriden.

Or not. I don’t Cube.

JW