개발환경: TrueSTUDIO 9.3.0

결론: 프로젝트 속성 - Tool Settings에 있는 Assembler, C Compiler, C Linker에 Target FPU 속성을 FPv4-SP-D16으로 설정

 

안녕하세요.

 

CubeMX를 통해 TrueSTUDIO 프로젝트를 만들고 컴파일을 했는데

 

아래와 같은 메세지가 나타나면서 실패되는 현상이 있었습니다.

 

저는 아무것도 안했는데 말이죠...

error: Core\Src\adc.o uses VFP register arguments, Test.elf does not
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Core\Src\adc.o
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: Core\Src\gpio.o uses VFP register arguments, Test.elf does not
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Core\Src\gpio.o
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: Core\Src\main.o uses VFP register arguments, Test.elf does not
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Core\Src\main.o
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: Core\Src\stm32f4xx_hal_msp.o uses VFP register arguments, Test.elf does not
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Core\Src\stm32f4xx_hal_msp.o
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: Core\Src\stm32f4xx_it.o uses VFP register arguments, Test.elf does not
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Core\Src\stm32f4xx_it.o
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: Core\Src\syscalls.o uses VFP register arguments, Test.elf does not
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Core\Src\syscalls.o
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: Core\Src\system_stm32f4xx.o uses VFP register arguments, Test.elf does not
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Core\Src\system_stm32f4xx.o
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: Core\Src\tim.o uses VFP register arguments, Test.elf does not
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Core\Src\tim.o
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: Core\Src\usart.o uses VFP register arguments, Test.elf does not
d:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Core\Src\usart.o

 

 

그래서 구글링 해 본 결과

 

프로젝트 Tool 설정에서 Miscellaneous에  -mfloat-abi=softfp 옵션을 주라고 해결책이 있었습니다.

 

그래서 아래와 같이 -mfloat-abi=softfp 옵션을 줘서 컴파일을 했더니 에러가 싹 사라졌습니다.

 

 

하지만 디버그 버튼을 통해 프로그램 다운을 했는데 동작이 되지 않았습니다.

 

그래서 설정했던 옵션을 지우고, 다른 프로젝트와 설정 비교를 해보니 Target에 FPU가 None으로 되어있었습니다.

 

아래 빨간 박스에 있는 

Assembler, C Compiler, C Linker에 Target FPU 속성을 FPv4-SP-D16으로 설정해주었더니 컴파일도 정상적으로 되었고 디버그 버튼으로 다운로딩도 잘 되고 프로그램도 정상 동작하는 것을 확인 하였습니다.

 

 

 

 

출처: gcc - ARM compilation error, VFP registers used by executable, not object file - Stack Overflow

반응형

+ Recent posts