Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread Studio
看门狗
STM32F103
新手“RT-Thread Settings”创建看门狗的时候后编译不通过的问题
发布于 2020-10-22 10:52:46 浏览:1577
订阅该版
大神们,我用RTT studio创建了一个默认的工程,通过“RT-Thread Settings”勾选WDT保存后编译不通过。这个是怎么回事? ``` 10:42:51 **** 构建 of configuration Debug for project test1 **** make -j24 all arm-none-eabi-gcc "../rt-thread/src/clock.c" arm-none-eabi-gcc "../rt-thread/src/components.c" arm-none-eabi-gcc "../rt-thread/src/device.c" arm-none-eabi-gcc "../rt-thread/src/idle.c" arm-none-eabi-gcc "../rt-thread/src/ipc.c" arm-none-eabi-gcc "../rt-thread/src/irq.c" arm-none-eabi-gcc "../rt-thread/src/kservice.c" arm-none-eabi-gcc "../rt-thread/src/mem.c" arm-none-eabi-gcc "../rt-thread/src/mempool.c" arm-none-eabi-gcc "../rt-thread/src/object.c" arm-none-eabi-gcc "../rt-thread/src/scheduler.c" arm-none-eabi-gcc "../rt-thread/src/signal.c" arm-none-eabi-gcc "../rt-thread/src/thread.c" arm-none-eabi-gcc "../rt-thread/src/timer.c" arm-none-eabi-gcc "../rt-thread/libcpu/arm/cortex-m3/context_gcc.S" arm-none-eabi-gcc "../rt-thread/libcpu/arm/cortex-m3/cpuport.c" arm-none-eabi-gcc "../rt-thread/libcpu/arm/common/backtrace.c" arm-none-eabi-gcc "../rt-thread/libcpu/arm/common/div0.c" arm-none-eabi-gcc "../rt-thread/libcpu/arm/common/showmem.c" arm-none-eabi-gcc "../rt-thread/components/libc/compilers/minilibc/ctype.c" arm-none-eabi-gcc "../rt-thread/components/libc/compilers/minilibc/math.c" arm-none-eabi-gcc "../rt-thread/components/libc/compilers/minilibc/qsort.c" arm-none-eabi-gcc "../rt-thread/components/libc/compilers/minilibc/rand.c" arm-none-eabi-gcc "../rt-thread/components/libc/compilers/minilibc/stdlib.c" arm-none-eabi-gcc "../rt-thread/components/libc/compilers/minilibc/string.c" arm-none-eabi-gcc "../rt-thread/components/libc/compilers/minilibc/time.c" arm-none-eabi-gcc "../rt-thread/components/finsh/cmd.c" arm-none-eabi-gcc "../rt-thread/components/finsh/msh.c" arm-none-eabi-gcc "../rt-thread/components/finsh/shell.c" arm-none-eabi-gcc "../rt-thread/components/drivers/watchdog/watchdog.c" arm-none-eabi-gcc "../rt-thread/components/drivers/src/completion.c" arm-none-eabi-gcc "../rt-thread/components/drivers/src/dataqueue.c" arm-none-eabi-gcc "../rt-thread/components/drivers/src/pipe.c" arm-none-eabi-gcc "../rt-thread/components/drivers/src/ringblk_buf.c" arm-none-eabi-gcc "../rt-thread/components/drivers/src/ringbuffer.c" arm-none-eabi-gcc "../rt-thread/components/drivers/src/waitqueue.c" arm-none-eabi-gcc "../rt-thread/components/drivers/src/workqueue.c" arm-none-eabi-gcc "../rt-thread/components/drivers/serial/serial.c" arm-none-eabi-gcc "../rt-thread/components/drivers/misc/pin.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/Legacy/stm32f1xx_hal_can.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cec.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_crc.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac_ex.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_eth.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_hcd.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2s.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_irda.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_mmc.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nand.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nor.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pccard.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sd.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_smartcard.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_usart.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_wwdg.c" arm-none-eabi-gcc "../libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c" arm-none-eabi-gcc "../libraries/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xb.S" arm-none-eabi-gcc "../libraries/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c" arm-none-eabi-gcc "../drivers/board.c" arm-none-eabi-gcc "../drivers/drv_adc.c" arm-none-eabi-gcc "../drivers/drv_clk.c" arm-none-eabi-gcc "../drivers/drv_common.c" arm-none-eabi-gcc "../drivers/drv_eth.c" arm-none-eabi-gcc "../drivers/drv_flash_f1.c" arm-none-eabi-gcc "../drivers/drv_gpio.c" arm-none-eabi-gcc "../drivers/drv_hwtimer.c" arm-none-eabi-gcc "../drivers/drv_pwm.c" arm-none-eabi-gcc "../drivers/drv_qspi.c" arm-none-eabi-gcc "../drivers/drv_rtc.c" arm-none-eabi-gcc "../drivers/drv_sdio.c" arm-none-eabi-gcc "../drivers/drv_soft_i2c.c" arm-none-eabi-gcc "../drivers/drv_spi.c" arm-none-eabi-gcc "../drivers/drv_usart.c" arm-none-eabi-gcc "../drivers/drv_usbd.c" arm-none-eabi-gcc "../drivers/drv_usbh.c" arm-none-eabi-gcc "../drivers/drv_wdt.c" arm-none-eabi-gcc "../applications/main.c" ../drivers/drv_wdt.c:23:5: error: unknown type name 'IWDG_HandleTypeDef' IWDG_HandleTypeDef hiwdg; ^ ../drivers/drv_wdt.c: In function 'wdt_control': ../drivers/drv_wdt.c:41:12: warning: implicit declaration of function 'HAL_IWDG_Refresh' [-Wimplicit-function-declaration] if(HAL_IWDG_Refresh(&stm32_wdt.hiwdg) != HAL_OK) ^ ../drivers/drv_wdt.c:51:28: error: request for member 'Init' in something not a structure or union stm32_wdt.hiwdg.Init.Reload = (*((rt_uint32_t*)arg)) * LSI_VALUE / 256 ; ^ ../drivers/drv_wdt.c:57:27: error: request for member 'Init' in something not a structure or union if(stm32_wdt.hiwdg.Init.Reload > 0xFFF) ^ ../drivers/drv_wdt.c:67:17: warning: implicit declaration of function 'HAL_IWDG_Init' [-Wimplicit-function-declaration] if (HAL_IWDG_Init(&stm32_wdt.hiwdg) != HAL_OK) ^ ../drivers/drv_wdt.c:78:53: error: request for member 'Init' in something not a structure or union (*((rt_uint32_t*)arg)) = stm32_wdt.hiwdg.Init.Reload * 256 / LSI_VALUE; ^ ../drivers/drv_wdt.c: In function 'rt_wdt_init': ../drivers/drv_wdt.c:108:20: error: request for member 'Instance' in something not a structure or union stm32_wdt.hiwdg.Instance = IWDG; ^ ../drivers/drv_wdt.c:110:20: error: request for member 'Init' in something not a structure or union stm32_wdt.hiwdg.Init.Prescaler = IWDG_PRESCALER_256; ^ ../drivers/drv_wdt.c:110:38: error: 'IWDG_PRESCALER_256' undeclared (first use in this function) stm32_wdt.hiwdg.Init.Prescaler = IWDG_PRESCALER_256; ^ ../drivers/drv_wdt.c:110:38: note: each undeclared identifier is reported only once for each function it appears in ../drivers/drv_wdt.c:112:20: error: request for member 'Init' in something not a structure or union stm32_wdt.hiwdg.Init.Reload = 0x00000FFF; ^ make: *** [drivers/subdir.mk:69: drivers/drv_wdt.o] Error 1 make: *** Waiting for unfinished jobs.... "make -j24 all" terminated with exit code 2. Build might be incomplete. 10:45:55 Build Failed. 10 errors, 2 warnings. (took 3m:3s.842ms) ```
查看更多
whj467467222
认证专家
2020-10-22
开源,分享,交流,共同进步
首先实名羡慕一下楼主的电脑。 1. MCU型号的drv_dwt.c还没有支持导致的。 2. hal_config.h 没有打开门狗的宏定义 3. hal_dwt.h 没有被包含
2
个回答
默认排序
按发布时间排序
CONMI
2020-10-22
这家伙很懒,什么也没写!
已经解决。 总以为是这龟儿“stm32f1xx_hal_conf_template.h”已经启用“HAL_IWDG_MODULE_ENABLED”, 突然细看这文件是“_template.h”!!! ![image.png](/uploads/20201022/cf6c4dd8d0ae5e672600912145240464.png) 此前看别人的代码(有一份项目的代码用了很古老的版本,狗也他自己写的),好像要配置“stm32f1xx_hal_conf.h”。突然醒悟,原来VSCODE直接引导到没注释的宏上面了,我去~~ 然后全局找了一下,终于找到: ![image.png](/uploads/20201022/4fc5d20fc8129e80ad31c371e5923feb.png) 去掉注释,雨过天晴。 ![image.png](/uploads/20201022/1f474b3cf40df6f6c4b6eda8ca8cf24d.png)
撰写答案
登录
注册新账号
关注者
0
被浏览
1.6k
关于作者
CONMI
这家伙很懒,什么也没写!
提问
19
回答
9
被采纳
0
关注TA
发私信
相关问题
1
rt_thread studio 啥时候能用呢
2
RT_Thread使用反馈帖子
3
RTT studio 下的 AT指令问题。
4
什么时候RTT Sdudio支持Ubuntu,Deepin和UOS操作系统
5
rt thread Studio 关于J-LINK下载问题
6
RT-Thread studio 调试设置问题
7
RTT-Studio 如何设置调试配置参数?
8
rt_thread studio 软件包配置
9
RT-Studio目前只能开发STM32的项目吗?
10
rtt studio 生成hex名字修改
推荐文章
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
RTduino物联网应用零基础入门
2
TinyUSB Demo运行教程
3
RT-Thread学习大礼包一键带走!
4
freemodbus从机调试说明
5
【1024】瑞萨 RA 系列 BSP 制作与适配最新版本的 Keil 、 RSC、固件,较新的 FSP
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
ART-Pi
FinSH
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
ota在线升级
UART
cubemx
PWM
flash
packages_软件包
freemodbus
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
ulog
C++_cpp
at_device
本月问答贡献
张世争
7
个答案
2
次被采纳
用户名由3_15位
10
个答案
1
次被采纳
KunYi
4
个答案
1
次被采纳
踩姑娘的小蘑菇
2
个答案
1
次被采纳
bernard
1
个答案
1
次被采纳
本月文章贡献
出出啊
1
篇文章
2
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
4
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部