从 NUCLEO-L476RG 链接器的 2_Images 示例应用程序编译 UserApp 时,输出以下错误:
不能使用可执行文件“../../SBSFU/Debug/se_interface_app.o”作为链接的输入
- arm-none-eabi-gcc -z max-page-size=1 -o "UserApp.elf" @"objects.list" ../../SBSFU/Debug/se_interface_app.o -mcpu=cortex-m4 -T"../STM32L476RGTx.ld" --specs=nosys.specs -Wl,-Map="UserApp.map" -Wl,--gc-sections -static -Xlinker -L ../../Linker_Common --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
- c:ststm32cubeide_1.0.0stm32cubeidepluginscom.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127toolsarm-none-eabibinld.exe: cannot use executable file '../../SBSFU/Debug/se_interface_app.o' as input to a link
- collect2.exe: error: ld returned 1 exit status
- make[1]: *** [makefile:66: UserApp.elf] Error 1
- make: *** [makefile:59: all] Error 2
我在 STM32CubeIDE v1.8.0 上使用 X-CUBE-SBSFU v2.5 和适用于 STM32 (10.3-2021.10) 的 GNU 工具。
但是,当使用相同的 IDE 但使用较旧的工具链时,问题消失并且构建成功 - 使用 GNU Tools for STM32 (9-2020-q2-update) 和 GNU Tools for STM32 (7-2018-q2-update) 检查。