Using the arm-gcc direct from ARM and I’m having issues including the math floor function. I’ve checked the source for newlib-nano and it has an implementation for floor, so it seems like it should work. It also is a builtin in GCC, so it seems like I should have that version as a fallback. Adding -lm to compiler/linker options does not help.
undefined reference to `floor'
collect2: error: ld returned 1 exit status
My C options:
set(CMAKE_C_FLAGS "-Wall -Wextra -mthumb -mcpu=cortex-m0plus -march=armv6s-m -std=c99 -specs=nosys.specs -specs=nano.specs")
Linker:
set(CMAKE_EXE_LINKER_FLAGS "-T ${CMAKE_SOURCE_DIR}/linker_release.ld -Xlinker --gc-sections " CACHE INTERNAL "")
Line of code triggering the error:
float currentRounded = (float)(floorf(currentCvSetPoint * 100.0)) / 100.0;