Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
CAN总线
drv_can.c编译报错
发布于 2019-04-17 10:25:30 浏览:3853
订阅该版
429平台加入can驱动会报错,如下: ``` ..\libraries\HAL_Drivers\drv_can.h(40): error: #20: identifier "CanTxMsgTypeDef" is undefined CanTxMsgTypeDef TxMessage; ..\libraries\HAL_Drivers\drv_can.h(41): error: #20: identifier "CanRxMsgTypeDef" is undefined CanRxMsgTypeDef RxMessage; ..\libraries\HAL_Drivers\drv_can.h(42): error: #20: identifier "CanRxMsgTypeDef" is undefined CanRxMsgTypeDef Rx1Message; ..\libraries\HAL_Drivers\drv_can.h(43): error: #20: identifier "CAN_FilterConfTypeDef" is undefined CAN_FilterConfTypeDef FilterConfig; ..\libraries\HAL_Drivers\drv_can.c(83): warning: #223-D: function "__HAL_CAN_TRANSMIT_STATUS" declared implicitly if (__HAL_CAN_TRANSMIT_STATUS(hcan, CAN_TXMAILBOX_0)) ..\libraries\HAL_Drivers\drv_can.c(83): error: #20: identifier "CAN_TXMAILBOX_0" is undefined if (__HAL_CAN_TRANSMIT_STATUS(hcan, CAN_TXMAILBOX_0)) ..\libraries\HAL_Drivers\drv_can.c(97): error: #20: identifier "CAN_TXMAILBOX_1" is undefined else if (__HAL_CAN_TRANSMIT_STATUS(hcan, CAN_TXMAILBOX_1)) ..\libraries\HAL_Drivers\drv_can.c(112): error: #20: identifier "CAN_TXMAILBOX_2" is undefined else if (__HAL_CAN_TRANSMIT_STATUS(hcan, CAN_TXMAILBOX_2)) ..\libraries\HAL_Drivers\drv_can.c(137): error: #20: identifier "CanRxMsgTypeDef" is undefined CanRxMsgTypeDef* pRxMsg = NULL; ..\libraries\HAL_Drivers\drv_can.c(137): error: #20: identifier "pRxMsg" is undefined CanRxMsgTypeDef* pRxMsg = NULL; ..\libraries\HAL_Drivers\drv_can.c(141): warning: #223-D: function "__HAL_CAN_MSG_PENDING" declared implicitly while (__HAL_CAN_MSG_PENDING(hcan, CAN_FIFO0) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FMP0) != RESET) ..\libraries\HAL_Drivers\drv_can.c(141): error: #20: identifier "CAN_FIFO0" is undefined while (__HAL_CAN_MSG_PENDING(hcan, CAN_FIFO0) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FMP0) != RESET) ..\libraries\HAL_Drivers\drv_can.c(141): error: #20: identifier "CAN_IT_FMP0" is undefined while (__HAL_CAN_MSG_PENDING(hcan, CAN_FIFO0) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FMP0) != RESET) ..\libraries\HAL_Drivers\drv_can.c(146): error: #136: struct "__CAN_HandleTypeDef" has no field "pRxMsg" pRxMsg = hcan->pRxMsg; ..\libraries\HAL_Drivers\drv_can.c(176): warning: #223-D: function "__HAL_CAN_FIFO_RELEASE" declared implicitly __HAL_CAN_FIFO_RELEASE(hcan, CAN_FIFO0); ..\libraries\HAL_Drivers\drv_can.c(185): error: #20: identifier "CAN_IT_FF0" is undefined if (__HAL_CAN_GET_FLAG(hcan, CAN_FLAG_FF0) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FF0) != RESET) ..\libraries\HAL_Drivers\drv_can.c(192): error: #20: identifier "CAN_IT_FOV0" is undefined if (__HAL_CAN_GET_FLAG(hcan, CAN_FLAG_FOV0) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FOV0) != RESET) ..\libraries\HAL_Drivers\drv_can.c(208): error: #20: identifier "CanRxMsgTypeDef" is undefined CanRxMsgTypeDef* pRxMsg = NULL; ..\libraries\HAL_Drivers\drv_can.c(208): error: #20: identifier "pRxMsg" is undefined CanRxMsgTypeDef* pRxMsg = NULL; ..\libraries\HAL_Drivers\drv_can.c(212): warning: #223-D: function "__HAL_CAN_MSG_PENDING" declared implicitly while (__HAL_CAN_MSG_PENDING(hcan, CAN_FIFO1) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FMP1) != RESET) ..\libraries\HAL_Drivers\drv_can.c(212): error: #20: identifier "CAN_FIFO1" is undefined while (__HAL_CAN_MSG_PENDING(hcan, CAN_FIFO1) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FMP1) != RESET) ..\libraries\HAL_Drivers\drv_can.c(212): error: #20: identifier "CAN_IT_FMP1" is undefined while (__HAL_CAN_MSG_PENDING(hcan, CAN_FIFO1) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FMP1) != RESET) ..\libraries\HAL_Drivers\drv_can.c(217): error: #136: struct "__CAN_HandleTypeDef" has no field "pRx1Msg" pRxMsg = hcan->pRx1Msg; ..\libraries\HAL_Drivers\drv_can.c(247): warning: #223-D: function "__HAL_CAN_FIFO_RELEASE" declared implicitly __HAL_CAN_FIFO_RELEASE(hcan, CAN_FIFO1); ..\libraries\HAL_Drivers\drv_can.c(256): error: #20: identifier "CAN_IT_FF1" is undefined if (__HAL_CAN_GET_FLAG(hcan, CAN_FLAG_FF1) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FF1) != RESET) ..\libraries\HAL_Drivers\drv_can.c(263): error: #20: identifier "CAN_IT_FOV1" is undefined if (__HAL_CAN_GET_FLAG(hcan, CAN_FLAG_FOV1) != RESET && __HAL_CAN_GET_IT_SOURCE(hcan, CAN_IT_FOV1) != RESET) ..\libraries\HAL_Drivers\drv_can.c(573): error: #20: identifier "CAN_IT_EWG" is undefined __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG | ..\libraries\HAL_Drivers\drv_can.c(573): error: #20: identifier "CAN_IT_EPV" is undefined __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG | ..\libraries\HAL_Drivers\drv_can.c(573): error: #20: identifier "CAN_IT_BOF" is undefined __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG | ..\libraries\HAL_Drivers\drv_can.c(573): error: #20: identifier "CAN_IT_LEC" is undefined __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG | ..\libraries\HAL_Drivers\drv_can.c(573): error: #20: identifier "CAN_IT_ERR" is undefined __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG | ..\libraries\HAL_Drivers\drv_can.c(573): error: #20: identifier "CAN_IT_FMP0" is undefined __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG | ..\libraries\HAL_Drivers\drv_can.c(573): error: #20: identifier "CAN_IT_FOV0" is undefined __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG | ..\libraries\HAL_Drivers\drv_can.c(573): error: #20: identifier "CAN_IT_FMP1" is undefined __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG | ..\libraries\HAL_Drivers\drv_can.c(573): error: #20: identifier "CAN_IT_FOV1" is undefined __HAL_CAN_ENABLE_IT(hcan, CAN_IT_EWG | ..\libraries\HAL_Drivers\drv_can.c: 5 warnings, 30 errors ```
查看更多
3
个回答
默认排序
按发布时间排序
zhangjun
2019-06-15
这家伙很懒,什么也没写!
已经修复了编译错误,你可以帮忙测试下: - [修复了stm32f4平台的can驱动](https://club.rt-thread.org/ask/question/e59cf0d9eae6908e.html)
tsx1983
2019-04-17
这家伙很懒,什么也没写!
主要报的是drv_can.h文件里 ```c struct stm32_drv_can { CAN_HandleTypeDef CanHandle; CanTxMsgTypeDef TxMessage; CanRxMsgTypeDef RxMessage; CanRxMsgTypeDef Rx1Message; CAN_FilterConfTypeDef FilterConfig; }; ``` `CanTxMsgTypeDef,CanRxMsgTypeDef`等结构体都找不到定义,这驱动还没有完全写完吗
misonyo
2019-04-17
这家伙很懒,什么也没写!
>主要报的是drv_can.h文件里 F4的库比较旧,有个PR做了适配,还没有合并。你可以参考那个PR改一下应该就可以用了: - https://github.com/RT-Thread/rt-thread/pull/2514
撰写答案
登录
注册新账号
关注者
0
被浏览
3.9k
关于作者
tsx1983
这家伙很懒,什么也没写!
提问
18
回答
65
被采纳
0
关注TA
发私信
相关问题
1
我也来传一个CANOpen移植,RTT+STM32F107+CanOpenNode
2
谁有STM32裸跑的CANopen程序啊???
3
CAN驱动程序框架
4
CAN驱动接口如何规范一下
5
RTT无法进入线程.Cannot access Memory
6
编译提示arm-none-eabi/bin/ld: cannot find crt0.o: No such file o
7
rtt 2.1.0 正式版 mdk4 bsp/stm32 编译canapp.c错误
8
STM32F10XCAN驱动使用的问题
9
2.1版本stm32f10x分支bxcan驱动波特率设置的bug
10
rtthread2.1.0下,找不到can1设备
推荐文章
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
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
2
RT-Thread 发布 EtherKit开源以太网硬件!
3
rt-thread使用cherryusb实现虚拟串口
4
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
5
《原子操作:程序世界里的“最小魔法单位”解析》
热门标签
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
WIZnet_W5500
UART
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
ulog
C++_cpp
at_device
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
a1012112796
13
个答案
2
次被采纳
张世争
9
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
本月文章贡献
程序员阿伟
7
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
3
次点赞
ThinkCode
1
篇文章
1
次点赞
Betrayer
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部