Linker STM32F4发现链接问题

Linker STM32F4发现链接问题,linker,cross-compiling,stm32,stm32f4discovery,Linker,Cross Compiling,Stm32,Stm32f4discovery,我正在尝试在STM32F4发现板(芯片:STM32F407VGT6)上运行一些代码 $(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s 这说明了编译和链接核仁板(芯片:STM32F401RE)所需的必要代码和步骤。我已尝试将此过程转换到我的Discovery board,但在尝试链接对象文件时出现以下链接错误 error: system.o: Conflicting

我正在尝试在STM32F4发现板(芯片:STM32F407VGT6)上运行一些代码

$(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s
这说明了编译和链接核仁板(芯片:STM32F401RE)所需的必要代码和步骤。我已尝试将此过程转换到我的Discovery board,但在尝试链接对象文件时出现以下链接错误

error: system.o: Conflicting architecture profiles M/A
failed to merge target specific data of file system.o
error: main.o: Conflicting architecture profiles M/A
failed to merge target specific data of file main.o
error: startup_stm32f407xx.o: Conflicting architecture profiles M/A
failed to merge target specific data of file startup_stm32f407xx.o
$(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s
我的项目结构如下

├── STM32Cube_FW_F4_V1.13.0
│   ├── Drivers/
│   ├── Projects/
│   └── Utilities/
├── stm32f4 (my project folder)
│   ├── main.c
│   ├── Makefile
│   ├── startup_stm32f407xx.s
│   └── system.c
$(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s
这是我的Makefile():

$(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s
我从中复制了启动\u stm32f407xx.o

$(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s
我已在main.c中将BSRRLBSSRH更改为BSRR系统中的压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆压水堆

$(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s
进行了这些更改,以便代码可以编译,并且我的董事会的HeaderFile中没有默认变量名

$(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s
我已经看了两遍教程,并搜索了有关错误消息的信息,但无法解决此问题

$(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s

有人能告诉我我做错了什么,或者给我指出了正确的方向吗?

我不是gcc用户,但看起来投诉是在链接步骤中,它正在查找一些目标代码,这些代码是针对ARM v7-A的,还有一些是针对ARM v7-M的。我将仔细检查编译器标志是否完整,以及链接步骤是否需要其他标志。您是否需要
-march=armv7-m
?您是在Linux还是Windows计算机上工作?我不是gcc用户,但投诉似乎是在链接步骤中,它正在查找一些目标代码,这些代码是针对ARM v7-A的,还有一些是针对ARM v7-M的。我将仔细检查编译器标志是否完整,以及链接步骤是否需要其他标志。您是否需要
-march=armv7-m
?您使用的是Linux还是Windows计算机?
$(STM32Cube)/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s