My setup: Eclipse, nrf52832 on a custom target board, s132, SDK13
I am trying to implement the workaround for the problem described here:
However, when I compile the project, __FPU_USED is defined as 0, so that section of code is not compiled. If I look up where __FPU_USED is defined, I find this in core_cm4.h:
#elif defined ( __GNUC__ ) #if defined (__VFP_FP__) && !defined(__SOFTFP__) #if (__FPU_PRESENT == 1U) #define __FPU_USED 1U #else #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" #define __FPU_USED 0U #endif #else #define __FPU_USED 0U #endif
In that block of code, __GNUC__ is defined, but __VFP_FP__ is not. My understanding is that __VFP_FP__ should be defined by the compiler, based on some flags that are set in my make file:
CFLAGS += -DARM_MATH_CM4 CFLAGS += -mcpu=cortex-m4 CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 ... ASMFLAGS += -DARM_MATH_CM4 ... LDFLAGS += -mcpu=cortex-m4 LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
However, __VFP_FP__ is not defined, and so __FPU_USED is not defined as 1. Is there another step I am missing here?