How do I enable FPU in STM32 without resorting to assembly. Currently I have this from the ARM site which works:
void enable_FPU(void)
{
__asm volatile(
// CPACR is located at address 0xE000ED88
"LDR.W R0, =0xE000ED88 \n\t"
// Read CPACR
"LDR R1, [R0] \n\t"
// Set bits 20-23 to enable CP10 and CP11 coprocessors
"ORR R1, R1, #0xF << 20 \n\t"
// Write back the modified value to the CPACR
"STR R1, [R0] \n\t"
: // No outputs
: // No input operands
: "r0", "r1");
}
But I don't care for assembly, and considering there are proponents here claiming Cortex-M can be programmed entirely in C, someone ought to know how to do it more easily..