This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52832 errata and docs: __get_FPSCR() has side effects?

We're disabling pending FPU exceptions and clearing pending FPU IRQs before calling sd_app_evt_wait(), as per a few references:

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.0.0%2Fhardware_driver_fpu.html&cp=4_0_3_2_2

http://infocenter.nordicsemi.com/pdf/nRF52832_Rev_1_Errata_v1.6.pdf

We see the same pattern recommended, which is an unused call to __get_FPSCR(). I understand that issuing FPU instructions triggers lazy stacking, but the examples provided already retrieve the FPSCR register contents using __get_FPSCR().

I thought there might be side effects to reading FPSCR, but the ARM manual doesn't mention any:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/BABBFJEC.html

So, does anyone know the purpose of the additional "(void)__get_FPSCR();" after __set_FPSCR(...) is called?

Related