newlib

How to make printf work on STM32F103?

故事扮演 提交于 2019-12-01 12:06:21
问题 I am new to the world of STM32F103. I have a demo code for STM32F103 and I am using arm-none-eabi to compile it. I tried what I could find on Google, but nothing worked so far. I have already spent three days on the problem. Anyone can give me a demo code for printf which works well? Part of my makefile: CFLAG = -mcpu=$(CPU) -mthumb -Wall -fdump-rtl-expand -specs=nano.specs --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lm -lrdimon -Wl,--end-group LDFLAG = -mcpu=$(CPU) -T ./stm32_flash.ld

undefined reference to “only some math.h” functions

青春壹個敷衍的年華 提交于 2019-11-27 23:49:56
I am having a strange problem. The math libraries has been added to my makefile. # include standard C library LDFLAGS += -lc # include standard math library LDFLAGS += -lm and in the output file (.map) I can see that everything has been linked properly: LOAD c:/gnu/powerpc-eabi/3pp.ronetix.powerpc-eabi/bin/../lib/gcc/powerpc-eabi/4.3.3/nof\libgcc.a LOAD c:/gnu/powerpc-eabi/3pp.ronetix.powerpc-eabi/bin/../lib/gcc/powerpc-eabi/4.3.3/../../../../powerpc-eabi/lib/nof\libc.a LOAD c:/gnu/powerpc-eabi/3pp.ronetix.powerpc-eabi/bin/../lib/gcc/powerpc-eabi/4.3.3/../../../../powerpc-eabi/lib/nof\libm.a