你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

stm32f1xx HAL库CanRxMsgTypeDef定义错误【已解决】

[复制链接]
captainliuy 提问时间:2015-3-26 10:45 /
本帖最后由 captainliuy 于 2015-10-21 10:24 编辑
  1. typedef struct
  2. {
  3.   uint32_t StdId;       /*!< Specifies the standard identifier.
  4.                              This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */

  5.   uint32_t ExtId;       /*!< Specifies the extended identifier.
  6.                              This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */

  7.   uint32_t IDE;         /*!< Specifies the type of identifier for the message that will be received.
  8.                              This parameter can be a value of @ref CAN_identifier_type */

  9.   uint32_t RTR;         /*!< Specifies the type of frame for the received message.
  10.                              This parameter can be a value of @ref CAN_remote_transmission_request */

  11.   uint32_t DLC;         /*!< Specifies the length of the frame that will be received.
  12.                              This parameter must be a number between Min_Data = 0 and Max_Data = 8. */

  13.   uint32_t Data[8];     /*!< Contains the data to be received.
  14.                              This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF. */

  15.   uint32_t FMI;         /*!< Specifies the index of the filter the message stored in the mailbox passes through.
  16.                              This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF. */

  17.   uint32_t FIFONumber;  /*!< Specifies the receive FIFO number.
  18.                              This parameter can be a value of @ref CAN_receive_FIFO_number_constants */

  19. }CanRxMsgTypeDef;
复制代码
uint32_t Data[8]; /*!< Contains the data to be received.
This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF. */
can接收数据应该是8个字节


在“STM32Cube_FW_F1_V1.2.0”中已fix。

收藏 1 评论7 发布时间:2015-3-26 10:45

举报

7个回答
肖久 回答时间:2015-3-27 09:13:27
帮顶 学习学习
党国特派员 回答时间:2015-3-27 09:32:13
是定的的8字节数组,哪里有错了? blank.png blank.png blank.png blank.png blank.png blank.png blank.png blank.png blank.png blank.png
wambob 回答时间:2015-3-30 14:17:31
谢谢分享
captainliuy 回答时间:2015-5-5 14:14:16
这样定义也许不是错误的,只是和CAN协议不同,初次见到会觉得有问题
Tension 回答时间:2015-5-6 17:05:12
对不对不能确定,但显然太随意了,浪费空间。
jameslee 回答时间:2015-8-4 14:01:41
他这样定义确实有些奇怪,但是他发送或接受的时候是没错的,注意给它赋值的时候就不要用memcpy这类接口函数了,你8个字节其实只是对数组的前两个成员赋值了,你需要一个个单独赋值
晴天-380557 回答时间:2016-2-26 14:59:28
这也有错????

所属标签

相似问题

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
微信公众号二维码 微信公众号
手机版二维码 手机版