cancel
Showing results for 
Search instead for 
Did you mean: 

makefile:43 error pls help

M.umit
Associate II

Hi!

I am trying to create a very first Hello World project like that:

/**

 ******************************************************************************

 * @file      : main.c

 * @author     : Auto-generated by STM32CubeIDE

 * @brief     : Main program body

 ******************************************************************************

 * @attention

 *

 * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.

 * All rights reserved.</center></h2>

 *

 * This software component is licensed by ST under BSD 3-Clause license,

 * the "License"; You may not use this file except in compliance with the

 * License. You may obtain a copy of the License at:

 *            opensource.org/licenses/BSD-3-Clause

 *

 ******************************************************************************

 */

#if !defined(__SOFT_FP__) && defined(__ARM_FP)

 #warning "FPU is not initialized, but the project is compiling for an FPU. Please initialize the FPU before use."

#endif

#include<stdio.h>

int main(void)

{

printf("Hello World\n");

for(;;);

}

But I have encountered an error like that:

14:35:10 **** Incremental Build of configuration Debug for project 001HelloWorld ****

make -j4 all 

arm-none-eabi-gcc "../Src/syscalls.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DSTM32 -DSTM32F407G_DISC1 -DSTM32F4 -DSTM32F407VGTx -DDEBUG -c -I../Inc -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/syscalls.d" -MT"Src/syscalls.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Src/syscalls.o"

arm-none-eabi-gcc -o "001HelloWorld.elf" @"objects.list"  -mcpu=cortex-m4 -T"C:\Users\MehmetUmit2\MCU_STM32\MCU1_Project\First\001HelloWorld\STM32F407VGTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="001HelloWorld.map" -Wl,--gc-sections -static --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: error: Src/sysmem.o uses VFP register arguments, 001HelloWorld.elf does not

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: failed to merge target specific data of file Src/sysmem.o

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:43: 001HelloWorld.elf] Error 1

"make -j4 all" terminated with exit code 2. Build might be incomplete.

14:35:11 Build Failed. 1 errors, 0 warnings. (took 1s.273ms)

How can I solve it. Thanks for all the help!

4 REPLIES 4
TDK
Guru

> error: Src/sysmem.o uses VFP register arguments, 001HelloWorld.elf does not

The error is saying half of your project uses the FPU, and half does not. Change "-mfloat-abi=soft" to "-mfloat-abi=hard -mfpu=fpv4-sp-d16".

If you feel a post has answered your question, please click "Accept as Solution".
M.umit
Associate II

I have changed them. But there is still an error:

15:21:51 **** Incremental Build of configuration Debug for project 001HelloWorld ****

make -j4 all 

arm-none-eabi-gcc -o "001HelloWorld.elf" @"objects.list"  -mcpu=cortex-m4 -T"C:\Users\MehmetUmit2\MCU_STM32\MCU1_Project\First\001HelloWorld\STM32F407VGTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="001HelloWorld.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: error: 001HelloWorld.elf uses VFP register arguments, Src/main.o does not

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: failed to merge target specific data of file Src/main.o

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: error: 001HelloWorld.elf uses VFP register arguments, Src/syscalls.o does not

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: failed to merge target specific data of file Src/syscalls.o

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:43: 001HelloWorld.elf] Error 1

"make -j4 all" terminated with exit code 2. Build might be incomplete.

15:21:52 Build Failed. 1 errors, 0 warnings. (took 938ms)

How did you generate your code? Create a project in CubeMX and start with that. Where is src/syscalls.c coming from?
If you feel a post has answered your question, please click "Accept as Solution".

I have tried to start over. I have created a new project and my problem has solved!

Thanks for the help!