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

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.dtcms.com/a/300564.html

相关文章:

  • C++编程入门:从基础到复合类型
  • 逆向入门(43)程序逆向篇-tsrh-crackme
  • SpringBoot 整合 Langchain4j AIService 深度使用详解
  • maven命令详解
  • 栈----5.柱状图中最大的矩形
  • 多模态视觉语言模型FILA-细粒度分辨率融合策略
  • 前缀和-560.和为k的子数组-力扣(LeetCode)
  • 望言OCR视频字幕提取2025终极评测:免费版VS专业版提全方位对比(含免费下载)
  • 3D芯片香港集成:技术突破与产业机遇全景分析
  • sealos 方式安装k8s5节点集群
  • CentOS 9 配置国内 YUM 源
  • Flutter开发实战之CI/CD与发布流程
  • Java AI面试实战:Spring AI与RAG技术落地
  • MySQL - 主从复制与读写分离
  • VILA系列论文解读
  • 预处理详解
  • rust-模块树中引用项的路径
  • PostgreSQL并发控制
  • Android:Reverse 实战 part 2 番外 IDA python
  • Android MQTT 长连接最佳实践技术分享
  • 力扣-76.最小覆盖子串
  • 安卓怎么做一个像QQ一样的开关切换控件
  • Kotlin位运算
  • EMCCD相机与电可调变焦透镜的同步控制系统设计与实现
  • Kotlin递归
  • MYSQL:索引
  • golang设置http代理
  • Flink2.0学习笔记:Stream API 常用转换算子
  • maven <dependencyManagement>标签的作用
  • 基于开源AI智能名片链动2+1模式S2B2C商城小程序的人格品牌化实现路径研究