4.1.2. Initializing the FPU

If the processor has been implemented with a Floating Point Unit (FPU) you must enable it before floating point instructions can be executed. The following code is an example of how to enable the feature.

CPACR EQU 0xE000ED88

      LDR r0, =CPACR           

      LDR r1, [R0]             ; Read CPACR
      ORR r1, R1, #(0xF << 20) ; Set bits 20-23 to enable CP10 and CP11 coprocessors
      STR r1, [R0]             ; Write back the modified value to the CPACR

      DSB
      ISB

See the Arm®v7-M Architecture Reference Manual for more information.

Note

Floating point logic is only available with the Cortex-M7 processor with FPU.

Copyright © 2014-2016, 2018 Arm. All rights reserved.ARM DDI 0489F
Non-ConfidentialID121118