9 years, 1 month ago.

Enable/disable FPU on Cortex-M4 ?

I'm not quite sure where to ask this general question.

Bu anyway .. I just want to know how to disable/enable the FPU on Cortex-M4 .. (eg STM32F411RE) I have been told, that it is possible inside Keil uVision IDE, but can not find any platform-setiing in mBed allowing this.

I want to make two performance test: 1) test with FPU (hardware) 2) test without FPU (software library)

But how ?

1 Answer

8 years, 11 months ago.

I found some information on this in the Programming Manual of the chip you mentioned here: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/programming_manual/DM00046982.pdf

Since this is platform specific, you'll have to set the registers manually.

Section 4.6.6 gives some assembly code to enable the FPU, it looks like you just have to set bits 20-23 of the CPACR. I haven't tested this but it might be worth a shot, at least to get started.

Hope that helps!

Brian