Progress! I had to update your Makefile to include -msoft-float and -mfpu=vfp to the COMPILE_OPTS. I am not sure if I needed to, but I also added them to the link options as well. So to sum up, in case anyone else is having these same issues, my path to getting this working looked something like this:
On my 32-bit windows machine:
1) Set up my environment per the instructions from Robotis for embedded C programming...this doesn't work with floating point out of the box.
2) Installed the arm-none-eabi-gcc compiler and replaced the Makefile in my project with the one from tician's post (post #2) above (modifying the MAIN_OUT accordingly). This solved the linking issues with the math.h library, but the controller would still lock up whenever a float operation was excecuted.
3) Edited the Makefile by adding the -mfpu=vfp -msoft-float flags to the compiler options and linker options, and this solved the controller crashing during floating point operations. The respective lines in the Makefile now look like this:
Code:
COMPILE_OPTS = -mcpu=cortex-m3 -mthumb -mfpu=vfp -msoft-float -Wall -g -Os -fno-common -lm
LDFLAGS = -mcpu=cortex-m3 -mthumb -mfpu=vfp -msoft-float -Wl,--gc-sections,[email protected],-cref,-u,Reset_Handler $(INCLUDE_DIRS) $(LIBRARY_DIRS) -T stm32.ld -lm
It's possible that the -msoft-float is optional, and it may be optional to include them in the linker flags, but I have already spent more time than I should have on this, so perhaps someone can test those out and confirm. I hope this ends up being helpful to others. Thank you tician for the great starting point.
Bookmarks