cancel
Showing results for 
Search instead for 
Did you mean: 

How to compile with -u _printf_float added to linker flags in AC6?

andreaspiezia9
Associate III

Hi all, 

I’m run a project that use printf with: 

Eclipse IDE for C/C++ Developers 

Version: Neon.3 Release (4.6.3) 

Build id: 20170314-1500

If I add -u _printf_float to linker flags I’ve error from compiler:

Invoking: MCU GCC Linker 

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -specs=nosys.specs -specs=nano.specs -u _printf_float -T�?../STM32F401RETx_FLASH.ld�? -Wl,-Map=output.map -Wl,--gc-sections -o “NucleoF401RE_53L1_Expansion.elf�? @�?objects.list�? -lm 

Application/SW4STM32/syscalls.o: In function `_sbrk’: 

C:/en.X-CUBE-53L1A1/STM32CubeExpansion_53L1A1_V2.1.0/Projects/STM32F401RE-Nucleo/Examples/53L1A1/SimpleRanging/SW4STM32/syscalls.c:135: undefined reference to `end’ 

collect2.exe: error: ld returned 1 exit status 

makefile:37: recipe for target ‘NucleoF401RE_53L1_Expansion.elf’ failed 

make: *** NucleoF401RE_53L1_Expansion.elf Error 1

If I don’t add -u _printf_float to linker flags it compile with no errors: 

make all 

Building target: NucleoF401RE_53L1_Expansion.elf 

Invoking: MCU GCC Linker 

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -specs=nosys.specs -specs=nano.specs -T�?../STM32F401RETx_FLASH.ld�? -Wl,-Map=output.map -Wl,--gc-sections -o “NucleoF401RE_53L1_Expansion.elf�? @�?objects.list�? -lm 

Finished building target: NucleoF401RE_53L1_Expansion.elf

make --no-print-directory post-build 

Generating hex and Printing size information: 

arm-none-eabi-objcopy -O ihex “NucleoF401RE_53L1_Expansion.elf�? “NucleoF401RE_53L1_Expansion.hex�? 

arm-none-eabi-size “NucleoF401RE_53L1_Expansion.elf�? 

text data bss dec hex filename 

8 0 0 8 8 NucleoF401RE_53L1_Expansion.elf

0 REPLIES 0