Rebuild started: Project: LED *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin' Rebuild target 'LED' assembling startup_stm32f10x_hd.s... startup_stm32f10x_hd.s: Warning: A1950W: The legacy armasm assembler is deprecated. Consider using the armclang integrated assembler instead. compiling core_cm3.c... Warning: A1950W: The legacy armasm assembler is deprecated. Consider using the armclang integrated assembler instead. Fatal error: L3900U: Unrecognized option '--vfemode=force'. Finished: 0 information, 0 warning, 0 error and 1 fatal error messages. compiling misc.c... compiling stm32f10x_adc.c... compiling system_stm32f10x.c... compiling stm32f10x_it.c... compiling main.c... compiling stm32f10x_bkp.c... compiling stm32f10x_can.c... compiling stm32f10x_cec.c... compiling stm32f10x_dbgmcu.c... compiling stm32f10x_dma.c... compiling stm32f10x_exti.c... compiling stm32f10x_crc.c... compiling stm32f10x_dac.c... compiling stm32f10x_flash.c... compiling stm32f10x_fsmc.c... compiling stm32f10x_iwdg.c... compiling stm32f10x_i2c.c... compiling stm32f10x_gpio.c... compiling stm32f10x_pwr.c... compiling stm32f10x_rcc.c... compiling stm32f10x_rtc.c... compiling stm32f10x_sdio.c... compiling stm32f10x_spi.c... compiling stm32f10x_wwdg.c... compiling delay.c... compiling stm32f10x_usart.c... compiling bsp.c... compiling stm32f10x_tim.c... compiling bsp_LED.c... "..\OBJ\LED.axf" - 1 Error(s), 2 Warning(s). Target not created. Build Time Elapsed: 00:00:03
时间: 2025-06-10 18:07:49 浏览: 29
<think>好的,我现在需要帮助用户解决他们在Keil MDK编译STM32项目时遇到的错误。用户提供的编译日志中有几个关键问题需要处理:汇编器警告、L3900U致命错误,以及最终目标未创建。让我一步步分析这些问题。
首先,用户看到关于legacy armasm assembler被弃用的警告。这说明项目可能还在使用旧的ARM汇编器,而Keil推荐迁移到armclang的集成汇编器。我需要确认如何切换编译器设置,可能需要调整项目选项中的汇编器选项。
接下来是致命错误L3900U,指出无法识别的选项'--vfemode=force'。这个选项看起来像是与向量浮点相关的,但可能在当前编译器版本中不再支持。需要查找这个选项的来源,可能是在链接器或编译器的某个配置中被错误地添加了。用户需要检查项目配置中的链接器或编译器额外选项,删除这个无效参数。
另外,编译过程中虽然有多个文件被编译,但最终出现了错误导致目标文件未生成。需要确保所有错误都被解决,尤其是致命错误,因为它会中断编译过程。
可能的解决步骤包括:更新Keil到最新版本,确保使用的编译器是ARMCLANG而不是旧的ARMCC;检查项目设置中的汇编器选项,改用armclang;检查链接器命令行是否有无效参数,特别是--vfemode=force,并删除它;可能还需要更新设备支持包或项目模板,以兼容新编译器。同时,用户需要确认是否在项目配置中误加了该选项,或者是否有旧的配置文件残留导致的问题。
需要提醒用户注意备份项目,逐步排查配置选项,确保所有路径和库都正确设置。如果用户使用的是旧教程或示例代码,可能需要根据新编译器的要求进行调整,比如启动文件的汇编语法是否有变化,或者某些编译器指令需要更新。</think>您的Keil MDK编译过程中出现了两个主要问题和若干警告,导致目标文件未生成。以下是详细分析及解决方案:
$$ \textcolor{red}{致命错误} $$
`Fatal error: L3900U: Unrecognized option '--vfemode=force'`
+ **原因**:使用了无效的链接器参数
+ **解决方案**:
1. 打开`Project -> Options for Target -> Linker`
2. 在`Misc controls`栏位中删除`--vfemode=force`参数
3. 确认`Use Memory Layout from Target Dialog`已勾选
$$ \textcolor{orange}{警告问题} $$
`Warning: A1950W: The legacy armasm assembler is deprecated`
+ **原因**:使用了旧版汇编器
+ **分步解决方案**:
1. 更新Keil至最新版本(建议V5.38+)
2. 右键点击`.s`启动文件 → `Options for File`
3. 将`Assembler`选项改为`Use Default Compiler Version 6`
4. 在`Project -> Manage -> Project Items`中确认`.s`文件类型为`Assembly`
$$ \textcolor{blue}{建议优化} $$
1. **编译器迁移**(针对ARMCLANG):
- 在`Project -> Manage -> Migrate to Version 6 Format`执行转换
- 修改启动文件语法:
```assembly
; 旧语法
AREA RESET, CODE, READONLY
; 新语法
.section .text.Reset_Handler, "ax", %progbits
```
2. **工程配置验证**:
| 配置项 | 推荐值 |
|---------------------|-----------------------|
| ARM Compiler | V6.19 |
| Optimization Level | -O1 |
| FPU Settings | Use FPU (Hardware) |
| Linker Script | 自动生成*.sct文件 |
3. **常见问题排查**:
- 检查`RTE/Device`是否包含正确的STM32F10x_DFP库
- 确认`system_stm32f10x.c`中`#define STM32F10X_HD`匹配芯片型号
- 删除`Objects`和`Listings`文件夹后重新编译
**注意**:若仍出现链接错误,建议在`Options for Target -> Output`勾选`Create HEX File`以验证完整编译流程,编译成功后平均耗时约00:00:15(取决于CPU性能)。
阅读全文
相关推荐











