libopencm3/libopencm3 — pull request #65 by nagromo (2012-11-14 05:17:23+00:00)
Title: Update makefile for stm32f4 examples so usb_cdcacm example now compiles

On three different computers, the STM32F4 USB CDC example wouldn't compile; it gave a linker error about VFP registers not being used by libc.a. This is described in Issue #59.

I found that the linker was using arm-none-eabi/lib/libc.a when it should have been using arm-none-eabi/lib/thumb/cortex-m4/float-abi-hard/fpuv4-sp-d16/libc.a for the Cortex M4 hard-float version of the library. I modified the LDFLAGS -L directives to use the hard-float path.

I compiled all of the STM32F4 examples using the modified makefile and ran each one on my STM32F4Discovery board. They all ran as expected (although I don't have UART2 hooked up to check that, the LEDs blinked properly on the UART examples), even the USB CDC example which had previously given me linker errors.