Enable floating-point coprocessor on reset.

Always enable the floating-point coprocessor with full access on
reset, allowing usage of hard-fp toolchains.
This commit is contained in:
Daniel Serpell 2012-08-22 00:05:08 -04:00 committed by Nicolas Schodet
parent 584052c28c
commit e4819d3cd2

View File

@ -18,6 +18,8 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f4/scb.h>
#define WEAK __attribute__ ((weak))
/* Symbols exported by the linker script(s): */
@ -224,6 +226,9 @@ void reset_handler(void)
__asm__("MSR msp, %0" : : "r"(&_stack));
/* Enable access to Floating-Point coprocessor. */
SCB_CPACR |= SCB_CPACR_FULL * (SCB_CPACR_CP10 | SCB_CPACR_CP11);
for (src = &_data_loadaddr, dest = &_data; dest < &_edata; src++, dest++)
*dest = *src;