当前位置: 首页 > ds >正文

Keil MDK 嵌入式开发问题:Error: L6218E: Undefined symbol HAL_TIM_PWM_ConfigChannel

  • 在 Keil MDK 中,编译项目时,报如下错误
*** Using Compiler 'V5.06 update 1 (build 61)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'Target 1'
assembling startup_stm32f103xe.s...
compiling system_stm32f1xx.c...
compiling stm32f1xx_hal_cortex.c...
compiling delay.c...
compiling stm32f1xx_hal_gpio.c...
compiling stm32f1xx_hal_gpio_ex.c...
compiling stm32f1xx_hal.c...
compiling main.c...
compiling stm32f1xx_hal_rcc.c...
compiling stm32f1xx_it.c...
compiling stm32f1xx_hal_rcc_ex.c...
compiling sys.c...
compiling usart.c...
compiling stm32f1xx_hal_dma.c...
compiling stm32f1xx_hal_uart.c...
compiling stm32f1xx_hal_usart.c...
compiling gtim.c...
linking...
..\..\hal_led_breathe.axf: Error: L6218E: Undefined symbol HAL_TIM_PWM_ConfigChannel (referred from gtim.o).
..\..\hal_led_breathe.axf: Error: L6218E: Undefined symbol HAL_TIM_PWM_Init (referred from gtim.o).
..\..\hal_led_breathe.axf: Error: L6218E: Undefined symbol HAL_TIM_PWM_Start (referred from gtim.o).
Not enough information to list image symbols.
Finished: 1 information, 0 warning and 3 error messages.
"..\..\hal_led_breathe.axf" - 3 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:07
# 关键错误..\..\hal_led_breathe.axf: Error: L6218E: Undefined symbol HAL_TIM_PWM_ConfigChannel (referred from gtim.o).
..\..\hal_led_breathe.axf: Error: L6218E: Undefined symbol HAL_TIM_PWM_Init (referred from gtim.o).
..\..\hal_led_breathe.axf: Error: L6218E: Undefined symbol HAL_TIM_PWM_Start (referred from gtim.o).
问题原因
  1. 这个错误表示主要涉及 PWM 相关 HAL 库函数的未定义,即链接器找不到它们的实现

  2. 工程配置遗漏或未正确包含 PWM 相关的 HAL 库文件

处理策略
  • 在 Keil MDK 工程中,确保以下 HAL 库文件被包含
  1. stm32f1xx_hal_tim.c:基础定时器驱动

  2. stm32f1xx_hal_tim_ex.c:高级定时器驱动,PWM 需要

http://www.xdnf.cn/news/16576.html

相关文章:

  • GIt学习——分布式版本控制工具
  • 设计模式(八)结构型:桥接模式详解
  • 设计模式(七)结构型:适配器模式详解
  • 【网络协议安全】任务15:DHCP与FTP服务全配置
  • 安装Selenium⾃动化
  • PiscCode使用OpenCV实现漂浮方块特效
  • 三种常用的抗锯齿
  • Java大数据面试实战:Hadoop生态与分布式计算
  • esp32s3创建rust工程 window成功mac
  • 结构化文本文档的内容抽取与版本重构策略
  • net8.0一键创建支持(Orm-Sqlite-MySql-SqlServer)
  • 【最新最完整】SpringAI-1.0.0开发MCP Server,搭建MCP Client 实战笔记(进阶+详细+完整代码)
  • Map(HashMap、LinkedHashMap、TreeMap)双列集合
  • 【机器学习深度学习】LLaMAFactory评估数据与评估参数解析
  • 《频率之光:危机降临》
  • 下载 | Win11 官方精简版,系统占用空间极少!(7月更新、Win 11 IoT物联网 LTSC版、适合老电脑安装使用)
  • 进度条制作--Linux知识的小应用
  • RabbiteMQ安装-ubuntu
  • Flutter实现列表功能
  • 【lucene】向量搜索底层文件关系梳理
  • git删除远程分支和本地分支
  • WPFC#超市管理系统(2)顾客管理、供应商管理、用户管理
  • docker 自定义网桥作用
  • macOS 安装 Homebrew
  • Vue基础(25)_组件与Vue的内置关系(原型链)
  • 「iOS」————消息传递和消息转发
  • K8S 九 安全认证 TLS
  • 深入理解现代前端开发中的 <script type=“module“> 与构建工具实践
  • Orange的运维学习日记--13.Linux服务管理
  • OpenLayers 综合案例-点位聚合