Code: Select all
/home/hazelnusse/toolchain/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -O2 -ggdb3 -fomit-frame-pointer -falign-functions=16 -march=armv7e-m -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/crt0.lst -DCORTEX_USE_FPU=TRUE -DTESTCXXSTUFF=0 -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/crt0.o.d -mthumb -DTHUMB -I. -I./ChibiOS-RT/os/ports/common/ARMCMx/CMSIS/include -I./ChibiOS-RT/os/ports/common/ARMCMx -I./ChibiOS-RT/os/ports/GCC/ARMCMx -I./ChibiOS-RT/os/ports/GCC/ARMCMx/STM32F4xx -I./ChibiOS-RT/os/kernel/include -I./ChibiOS-RT/test -I./ChibiOS-RT/os/hal/include -I./ChibiOS-RT/os/hal/platforms/STM32F4xx -I./ChibiOS-RT/os/hal/platforms/STM32 -I./ChibiOS-RT/os/hal/platforms/STM32/GPIOv2 -I./ChibiOS-RT/os/hal/platforms/STM32/I2Cv1 -I./ChibiOS-RT/os/hal/platforms/STM32/OTGv1 -I./ChibiOS-RT/os/hal/platforms/STM32/RTCv2 -I./ChibiOS-RT/os/hal/platforms/STM32/SPIv1 -I./ChibiOS-RT/os/hal/platforms/STM32/USARTv1 -I./board/ -I./ChibiOS-RT/os/various/lwip_bindings -I./ChibiOS-RT/ext/lwip/src/include -I./ChibiOS-RT/ext/lwip/src/include/ipv4 -I./ChibiOS-RT/ext/fatfs/src -I./ChibiOS-RT/os/various -I/home/hazelnusse/toolchain/arm-none-eabi/include -ISingleton ./ChibiOS-RT/os/ports/GCC/ARMCMx/crt0.c -o build/obj/crt0.o
./ChibiOS-RT/os/ports/GCC/ARMCMx/crt0.c: In function 'ResetHandler':
./ChibiOS-RT/os/ports/GCC/ARMCMx/crt0.c:267:3: error: 'SCB_FPCCR' undeclared (first use in this function)
./ChibiOS-RT/os/ports/GCC/ARMCMx/crt0.c:267:3: note: each undeclared identifier is reported only once for each function it appears in
./ChibiOS-RT/os/ports/GCC/ARMCMx/crt0.c:267:15: error: 'FPCCR_ASPEN' undeclared (first use in this function)
./ChibiOS-RT/os/ports/GCC/ARMCMx/crt0.c:267:29: error: 'FPCCR_LSPEN' undeclared (first use in this function)
./ChibiOS-RT/os/ports/GCC/ARMCMx/crt0.c:270:3: error: 'SCB_CPACR' undeclared (first use in this function)
./ChibiOS-RT/os/ports/GCC/ARMCMx/crt0.c:275:3: error: 'SCB_FPDSCR' undeclared (first use in this function)
make: *** [build/obj/crt0.o] Error 1
The code compiles fine if I change my Makefile to have USE_FPU = no, which then causes the compilation flag -DCORTEX_USE_FPU=FALSE. This is with ChibiOS from the latest git master.
I looked at git blame for crt0.c and this part of the code is about a year old so perhaps something else somewhere changed? Regardless, these symbols are defined in os/ports/common/ARMCMx/nvic.h, but the only file included by crt0.c is stdint.h. So it seems that either these symbols need to be defined in crt0.c or somehow nvic.h needs to be included, perhaps conditionally?
I think this is a bug but I'm not sure why it wouldn't have triggered for the last 6 months when I've been using USE_FPU=yes that whole time.
Luke