Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
ART-Pi
HWTIMER_硬件定时器
Wifi示例工程
ART-Pi开发板,新建Wifi示例工程,打开hwtimer就42个错误?
发布于 2021-03-03 15:10:40 浏览:1098
订阅该版
RT-thread studio建工程,新建Wifi示例工程是有问题,打开hwtimer就42个错误? 使能timer13,按官方的示例建立的hwtimer_sample,hwtimer名称改为timer13了! 使用模板工程的话hwtimer_sample没有问题!这是什么怪问题? 新建工程rt-thread4.02,基于开发板art-pi 示例工程wifi 硬件里打开timer13,编译就出错,错误信息如下: ``` ../libraries/drivers/drv_hwtimer.c:83:5: error: unknown type name 'TIM_HandleTypeDef' arm-none-eabi-gcc "../libraries/drivers/drv_sdram.c" TIM_HandleTypeDef tim_handle; ^ In file included from E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\libraries\drivers\include/drv_config.h:112:0, from ../libraries/drivers/drv_hwtimer.c:18: E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\libraries\drivers\include/config/tim_config.h:34:8: error: field name not in record or union initializer .tim_handle.Instance = TIM13, \ ^ ../libraries/drivers/drv_hwtimer.c:139:5: note: in expansion of macro 'TIM13_CONFIG' TIM13_CONFIG, ^ E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\libraries\drivers\include/config/tim_config.h:34:8: note: (near initialization for 'stm32_hwtimer_obj[0]') .tim_handle.Instance = TIM13, \ ^ ../libraries/drivers/drv_hwtimer.c:139:5: note: in expansion of macro 'TIM13_CONFIG' TIM13_CONFIG, ^ In file included from E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\libraries\STM32H7xx_HAL\CMSIS\Device\ST\STM32H7xx\Include/stm32h7xx.h:115:0, from E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\board/board.h:15, from ../libraries/drivers/drv_hwtimer.c:13: E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\libraries\STM32H7xx_HAL\CMSIS\Device\ST\STM32H7xx\Include/stm32h750xx.h:2406:29: warning: initialization makes integer from pointer without a cast [-Wint-conversion] #define TIM13 ((TIM_TypeDef *) TIM13_BASE) ^ E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\libraries\drivers\include/config/tim_config.h:34:35: note: in expansion of macro 'TIM13' .tim_handle.Instance = TIM13, \ ^ ../libraries/drivers/drv_hwtimer.c:139:5: note: in expansion of macro 'TIM13_CONFIG' TIM13_CONFIG, ^ E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\libraries\STM32H7xx_HAL\CMSIS\Device\ST\STM32H7xx\Include/stm32h750xx.h:2406:29: note: (near initialization for 'stm32_hwtimer_obj[0].tim_handle') #define TIM13 ((TIM_TypeDef *) TIM13_BASE) ^ E:\RT-ThreadStudio\workspace\art_pi_wifi_sht30\libraries\drivers\include/config/tim_config.h:34:35: note: in expansion of macro 'TIM13' .tim_handle.Instance = TIM13, \ ^ ../libraries/drivers/drv_hwtimer.c:139:5: note: in expansion of macro 'TIM13_CONFIG' TIM13_CONFIG, ^ ../libraries/drivers/drv_hwtimer.c: In function 'timer_init': ../libraries/drivers/drv_hwtimer.c:209:5: error: unknown type name 'TIM_HandleTypeDef' TIM_HandleTypeDef *tim = RT_NULL; ^ ../libraries/drivers/drv_hwtimer.c:215:16: error: 'TIM_HandleTypeDef' undeclared (first use in this function) tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:215:16: note: each undeclared identifier is reported only once for each function it appears in ../libraries/drivers/drv_hwtimer.c:215:35: error: expected expression before ')' token tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:228:16: error: request for member 'Instance' in something not a structure or union if (tim->Instance == TIM13 || tim->Instance == TIM14) ^ ../libraries/drivers/drv_hwtimer.c:228:42: error: request for member 'Instance' in something not a structure or union if (tim->Instance == TIM13 || tim->Instance == TIM14) ^ ../libraries/drivers/drv_hwtimer.c:241:12: error: request for member 'Init' in something not a structure or union tim->Init.Period = 10000 - 1; ^ ../libraries/drivers/drv_hwtimer.c:242:12: error: request for member 'Init' in something not a structure or union tim->Init.Prescaler = prescaler_value; ^ ../libraries/drivers/drv_hwtimer.c:243:12: error: request for member 'Init' in something not a structure or union tim->Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; ^ ../libraries/drivers/drv_hwtimer.c:243:39: error: 'TIM_CLOCKDIVISION_DIV1' undeclared (first use in this function) tim->Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; ^ ../libraries/drivers/drv_hwtimer.c:246:16: error: request for member 'Init' in something not a structure or union tim->Init.CounterMode = TIM_COUNTERMODE_UP; ^ ../libraries/drivers/drv_hwtimer.c:246:39: error: 'TIM_COUNTERMODE_UP' undeclared (first use in this function) tim->Init.CounterMode = TIM_COUNTERMODE_UP; ^ ../libraries/drivers/drv_hwtimer.c:250:16: error: request for member 'Init' in something not a structure or union tim->Init.CounterMode = TIM_COUNTERMODE_DOWN; ^ ../libraries/drivers/drv_hwtimer.c:250:39: error: 'TIM_COUNTERMODE_DOWN' undeclared (first use in this function) tim->Init.CounterMode = TIM_COUNTERMODE_DOWN; ^ ../libraries/drivers/drv_hwtimer.c:252:12: error: request for member 'Init' in something not a structure or union tim->Init.RepetitionCounter = 0; ^ ../libraries/drivers/drv_hwtimer.c:255:12: error: request for member 'Init' in something not a structure or union tim->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; ^ ../libraries/drivers/drv_hwtimer.c:255:39: error: 'TIM_AUTORELOAD_PRELOAD_DISABLE' undeclared (first use in this function) tim->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; ^ ../libraries/drivers/drv_hwtimer.c:257:13: warning: implicit declaration of function 'HAL_TIM_Base_Init' [-Wimplicit-function-declaration] if (HAL_TIM_Base_Init(tim) != HAL_OK) ^ ../libraries/drivers/drv_hwtimer.c:271:13: warning: implicit declaration of function '__HAL_TIM_CLEAR_FLAG' [-Wimplicit-function-declaration] __HAL_TIM_CLEAR_FLAG(tim, TIM_FLAG_UPDATE); ^ ../libraries/drivers/drv_hwtimer.c:271:39: error: 'TIM_FLAG_UPDATE' undeclared (first use in this function) __HAL_TIM_CLEAR_FLAG(tim, TIM_FLAG_UPDATE); ^ ../libraries/drivers/drv_hwtimer.c:273:13: warning: implicit declaration of function '__HAL_TIM_URS_ENABLE' [-Wimplicit-function-declaration] __HAL_TIM_URS_ENABLE(tim); ^ ../libraries/drivers/drv_hwtimer.c: In function 'timer_start': ../libraries/drivers/drv_hwtimer.c:283:5: error: unknown type name 'TIM_HandleTypeDef' TIM_HandleTypeDef *tim = RT_NULL; ^ ../libraries/drivers/drv_hwtimer.c:287:12: error: 'TIM_HandleTypeDef' undeclared (first use in this function) tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:287:31: error: expected expression before ')' token tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:290:5: warning: implicit declaration of function '__HAL_TIM_SET_COUNTER' [-Wimplicit-function-declaration] __HAL_TIM_SET_COUNTER(tim, 0); ^ ../libraries/drivers/drv_hwtimer.c:292:5: warning: implicit declaration of function '__HAL_TIM_SET_AUTORELOAD' [-Wimplicit-function-declaration] __HAL_TIM_SET_AUTORELOAD(tim, t - 1); ^ ../libraries/drivers/drv_hwtimer.c:297:12: error: request for member 'Instance' in something not a structure or union tim->Instance->CR1 |= TIM_OPMODE_SINGLE; ^ ../libraries/drivers/drv_hwtimer.c:297:31: error: 'TIM_OPMODE_SINGLE' undeclared (first use in this function) tim->Instance->CR1 |= TIM_OPMODE_SINGLE; ^ ../libraries/drivers/drv_hwtimer.c:301:12: error: request for member 'Instance' in something not a structure or union tim->Instance->CR1 &= (~TIM_OPMODE_SINGLE); ^ ../libraries/drivers/drv_hwtimer.c:305:9: warning: implicit declaration of function 'HAL_TIM_Base_Start_IT' [-Wimplicit-function-declaration] if (HAL_TIM_Base_Start_IT(tim) != HAL_OK) ^ ../libraries/drivers/drv_hwtimer.c: In function 'timer_stop': ../libraries/drivers/drv_hwtimer.c:316:5: error: unknown type name 'TIM_HandleTypeDef' TIM_HandleTypeDef *tim = RT_NULL; ^ ../libraries/drivers/drv_hwtimer.c:320:12: error: 'TIM_HandleTypeDef' undeclared (first use in this function) tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:320:31: error: expected expression before ')' token tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:323:5: warning: implicit declaration of function 'HAL_TIM_Base_Stop_IT' [-Wimplicit-function-declaration] HAL_TIM_Base_Stop_IT(tim); ^ ../libraries/drivers/drv_hwtimer.c: In function 'timer_ctrl': ../libraries/drivers/drv_hwtimer.c:331:5: error: unknown type name 'TIM_HandleTypeDef' TIM_HandleTypeDef *tim = RT_NULL; ^ ../libraries/drivers/drv_hwtimer.c:338:12: error: 'TIM_HandleTypeDef' undeclared (first use in this function) tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:338:31: error: expected expression before ')' token tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:359:16: error: request for member 'Instance' in something not a structure or union if (tim->Instance == TIM13 || tim->Instance == TIM14) ^ ../libraries/drivers/drv_hwtimer.c:359:42: error: request for member 'Instance' in something not a structure or union if (tim->Instance == TIM13 || tim->Instance == TIM14) ^ ../libraries/drivers/drv_hwtimer.c:372:9: warning: implicit declaration of function '__HAL_TIM_SET_PRESCALER' [-Wimplicit-function-declaration] __HAL_TIM_SET_PRESCALER(tim, val - 1); ^ ../libraries/drivers/drv_hwtimer.c:375:12: error: request for member 'Instance' in something not a structure or union tim->Instance->EGR |= TIM_EVENTSOURCE_UPDATE; ^ ../libraries/drivers/drv_hwtimer.c:375:31: error: 'TIM_EVENTSOURCE_UPDATE' undeclared (first use in this function) tim->Instance->EGR |= TIM_EVENTSOURCE_UPDATE; ^ ../libraries/drivers/drv_hwtimer.c: In function 'timer_counter_get': ../libraries/drivers/drv_hwtimer.c:390:5: error: unknown type name 'TIM_HandleTypeDef' TIM_HandleTypeDef *tim = RT_NULL; ^ ../libraries/drivers/drv_hwtimer.c:394:12: error: 'TIM_HandleTypeDef' undeclared (first use in this function) tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:394:31: error: expected expression before ')' token tim = (TIM_HandleTypeDef *)timer->parent.user_data; ^ ../libraries/drivers/drv_hwtimer.c:396:15: error: request for member 'Instance' in something not a structure or union return tim->Instance->CNT; ^ ../libraries/drivers/drv_hwtimer.c: In function 'TIM8_UP_TIM13_IRQHandler': ../libraries/drivers/drv_hwtimer.c:465:5: warning: implicit declaration of function 'HAL_TIM_IRQHandler' [-Wimplicit-function-declaration] HAL_TIM_IRQHandler(&stm32_hwtimer_obj[TIM13_INDEX].tim_handle); ^ ../libraries/drivers/drv_hwtimer.c: At top level: ../libraries/drivers/drv_hwtimer.c:523:36: error: unknown type name 'TIM_HandleTypeDef' void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) ^ ../libraries/drivers/drv_hwtimer.c: In function 'timer_counter_get': ../libraries/drivers/drv_hwtimer.c:397:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ make: *** [libraries/drivers/subdir.mk:48: libraries/drivers/drv_hwtimer.o] Error 1 make: *** Waiting for unfinished jobs.... "make -j4 all" terminated with exit code 2. Build might be incomplete. 18:08:21 Build Failed. 42 errors, 22 warnings. (took 29s.975ms) ```
查看更多
2
个回答
默认排序
按发布时间排序
whj467467222
认证专家
2021-03-03
开源,分享,交流,共同进步
贴出更多的错误信息,才能棒到你哦
CharlesX
2022-09-27
Make science fiction science
猜测是没有在CubeMX里配置硬件定时器的相关代码?因为看上去似乎是很多ST的库文件结构体没有识别出来。
撰写答案
登录
注册新账号
关注者
0
被浏览
1.1k
关于作者
18001425105
这家伙很懒,什么也没写!
提问
2
回答
3
被采纳
0
关注TA
发私信
相关问题
1
RT-Thread Studio 编译ART-Pi 的SDK报错 求助!-
2
ART-Pi 在 Studio 中使用TouchGFX Library 编译报错
3
RT-Thread Studio 更新错误
4
基于ART-Pi开发板创建的工程,RT-Thread Settings打不开
5
在 ART-Pi 平台使用 openocd 直接烧录到外部 spi flash?
6
ART-Pi工程用mdk5打开后提示文件找不到
7
ART-PI demo是否能够增加demo流程框图或者详细设计文档
8
ART-Pi 的ST_Link无法识别
9
请把ART-Pi仓库放到gitee上一份。
10
仅有ART-Pi开发包时,RTT Studio无法创建ART-Pi工程
推荐文章
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
简单两步配置RTT源码阅读环境 vsc+clangd
2
恩智浦[FRDM-MCXN947]初探 之 ADC与DAC
3
LVGL使用字库IC芯片显示中文
4
基于STM32H750和Rt-Thread的CANFD通信实现的记录(一)
5
freemodbus主机在freertos的适配,参考rtthread例程
热门标签
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在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
SFUD
msh
rt_mq_消息队列_msg_queue
keil_MDK
ulog
MicroPython
C++_cpp
本月问答贡献
出出啊
1517
个答案
342
次被采纳
小小李sunny
1443
个答案
289
次被采纳
张世争
805
个答案
174
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
148
次被采纳
本月文章贡献
出出啊
1
篇文章
4
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
1
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部