Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
BSP
dofly m3s 硬件定时器问题。不支持or配置错误
发布于 2019-04-15 12:57:52 浏览:2214
订阅该版
开发板: dofly m3s 代码: 4.0.1 master分支 bsp路径:\bsp\stm32\stm32f103-dofly-M3S 1. 默认 \board\kconfig 文件中 "On-chip Peripheral Drivers" 无硬件定时器配置相关的定义。 2. 手动添加如下定义在\board\kconfig 文件中 ``` menuconfig BSP_USING_TIM bool "Enable timer" default n select RT_USING_HWTIMER if BSP_USING_TIM config BSP_USING_TIM4 bool "Enable TIM4" default n endif``` 3. 通过env配置使能了硬件定时相关功能 ```/* Device Drivers */ #define RT_USING_DEVICE_IPC #define RT_PIPE_BUFSZ 512 #define RT_USING_SERIAL #define RT_SERIAL_USING_DMA #define RT_SERIAL_RB_BUFSZ 64 #define RT_USING_HWTIMER #define RT_USING_PIN /* On-chip Peripheral Drivers */ #define BSP_USING_GPIO #define BSP_USING_UART #define BSP_USING_UART1 #define BSP_USING_TIM #define BSP_USING_TIM4```4. 构建工程编译 报错如下 ```compiling drv_hwtimer.c... ..\libraries\HAL_Drivers\drv_hwtimer.c(78): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef tim_handle; ..\libraries\HAL_Drivers\drv_hwtimer.c(98): error: #3626: a designator cannot be used with a non-aggregate type "
" TIM4_CONFIG, ..\libraries\HAL_Drivers\drv_hwtimer.c(98): error: #144: a value of type "TIM_TypeDef *" cannot be used to initialize an entity of type "IRQn_Type" TIM4_CONFIG, ..\libraries\HAL_Drivers\drv_hwtimer.c(157): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(157): error: #20: identifier "tim" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(163): error: #29: expected an expression tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c(163): error: #65: expected a ";" tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c(185): error: #20: identifier "TIM_CLOCKDIVISION_DIV1" is undefined tim->Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; ..\libraries\HAL_Drivers\drv_hwtimer.c(188): error: #20: identifier "TIM_COUNTERMODE_UP" is undefined tim->Init.CounterMode = TIM_COUNTERMODE_UP; ..\libraries\HAL_Drivers\drv_hwtimer.c(192): error: #20: identifier "TIM_COUNTERMODE_DOWN" is undefined tim->Init.CounterMode = TIM_COUNTERMODE_DOWN; ..\libraries\HAL_Drivers\drv_hwtimer.c(196): error: #20: identifier "TIM_AUTORELOAD_PRELOAD_DISABLE" is undefined tim->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; ..\libraries\HAL_Drivers\drv_hwtimer.c(198): warning: #223-D: function "HAL_TIM_Base_Init" declared implicitly if (HAL_TIM_Base_Init(tim) != HAL_OK) ..\libraries\HAL_Drivers\drv_hwtimer.c(212): warning: #223-D: function "__HAL_TIM_CLEAR_FLAG" declared implicitly __HAL_TIM_CLEAR_FLAG(tim, TIM_FLAG_UPDATE); ..\libraries\HAL_Drivers\drv_hwtimer.c(212): error: #20: identifier "TIM_FLAG_UPDATE" is undefined __HAL_TIM_CLEAR_FLAG(tim, TIM_FLAG_UPDATE); ..\libraries\HAL_Drivers\drv_hwtimer.c(214): warning: #223-D: function "__HAL_TIM_URS_ENABLE" declared implicitly __HAL_TIM_URS_ENABLE(tim); ..\libraries\HAL_Drivers\drv_hwtimer.c(224): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(224): error: #20: identifier "tim" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(228): error: #29: expected an expression tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c(228): error: #65: expected a ";" tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c(231): warning: #223-D: function "__HAL_TIM_SET_AUTORELOAD" declared implicitly __HAL_TIM_SET_AUTORELOAD(tim, t); ..\libraries\HAL_Drivers\drv_hwtimer.c(236): error: #20: identifier "TIM_OPMODE_SINGLE" is undefined tim->Instance->CR1 |= TIM_OPMODE_SINGLE; ..\libraries\HAL_Drivers\drv_hwtimer.c(240): warning: #223-D: function "HAL_TIM_Base_Start_IT" declared implicitly if (HAL_TIM_Base_Start_IT(tim) != HAL_OK) ..\libraries\HAL_Drivers\drv_hwtimer.c(251): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(251): error: #20: identifier "tim" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(255): error: #29: expected an expression tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c(255): error: #65: expected a ";" tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c(258): warning: #223-D: function "HAL_TIM_Base_Stop_IT" declared implicitly HAL_TIM_Base_Stop_IT(tim); ..\libraries\HAL_Drivers\drv_hwtimer.c(263): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(263): error: #20: identifier "tim" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(269): error: #29: expected an expression tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c(269): error: #65: expected a ";" tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c(303): warning: #223-D: function "__HAL_TIM_SET_PRESCALER" declared implicitly __HAL_TIM_SET_PRESCALER(tim, val - 1); ..\libraries\HAL_Drivers\drv_hwtimer.c(306): error: #20: identifier "TIM_EVENTSOURCE_UPDATE" is undefined tim->Instance->EGR |= TIM_EVENTSOURCE_UPDATE; ..\libraries\HAL_Drivers\drv_hwtimer.c(321): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(321): error: #20: identifier "tim" is undefined TIM_HandleTypeDef *tim = RT_NULL; ..\libraries\HAL_Drivers\drv_hwtimer.c(325): error: #29: expected an expression tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c(325): error: #65: expected a ";" tim = (TIM_HandleTypeDef *)timer->parent.user_data; ..\libraries\HAL_Drivers\drv_hwtimer.c: 7 warnings, 30 errors```
查看更多
1
个回答
默认排序
按发布时间排序
misonyo
2019-04-15
这家伙很懒,什么也没写!
cubemx里面也要配置一下定时器然后生成代码。
撰写答案
登录
注册新账号
关注者
0
被浏览
2.2k
关于作者
minnow
这家伙很懒,什么也没写!
提问
3
回答
4
被采纳
0
关注TA
发私信
相关问题
1
STM32 407 串口接收数据 系统卡死
2
RTT nrf24l01 设备驱动程序
3
stm32f10x串口只能发送数据,无法接收
4
第一次尝试移植rt-thread 到stm32F103系列问题
5
有人把stm32L07xx的bsp移到rtt上来了吗?求一个
6
rt-thread线程调度异常在stm32f103芯片上
7
RTT是否支持STM32F429
8
请问谁有 STM32F40x HAL + RT-THREAD 模板
9
rt-thread在stm32f411下的移植问题
10
针对STM32F7系列平台的MPU,Cache特性,需要注意哪些问题?
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
使用RC522软件包驱动FM1722
2
常量数据类型和表达式陷阱分享
3
进行i2c驱动移植的经验总结
4
在VSCode中使用clang-format
5
我该如何使用这个微雪的WIFI400 WIFI-LPB-100在rtt里或者我该怎样为它开发驱动
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
UART
WIZnet_W5500
ota在线升级
freemodbus
PWM
flash
cubemx
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
rt_mq_消息队列_msg_queue
SFUD
msh
keil_MDK
ulog
C++_cpp
MicroPython
本月问答贡献
出出啊
1517
个答案
342
次被采纳
小小李sunny
1444
个答案
289
次被采纳
张世争
809
个答案
175
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
148
次被采纳
本月文章贡献
catcatbing
3
篇文章
5
次点赞
qq1078249029
2
篇文章
2
次点赞
xnosky
2
篇文章
1
次点赞
Woshizhapuren
1
篇文章
5
次点赞
YZRD
1
篇文章
2
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部