eric2013 发表于 2023-10-17 01:42:52

BSP视频教程第27期:CANopen协议栈专题,实战方式系统了解NMT,PDO,SDO,时间戳,同步报文,紧急报文等(2023-10-17)

本期视频教程为大家分享CANopen协议栈相关知识内容,涉及到的内容非常多。

看完本身视频教程,继续看下期
BSP视频教程第28期:CANopen协议栈专题,CANopen主从机组网实战,CAN词典工具使用方法以及吃透PDO玩法(2023-11-01)
https://www.armbbs.cn/forum.php?mod=viewthread&tid=121619

视频教程:

https://www.bilibili.com/video/BV1Vw411w7Dd

https://www.bilibili.com/video/BV1Vw411w7Dd/


视频提纲:
https://img.alicdn.com/imgextra/i4/299314119/O1CN01znVRDJ1gIYHauZ2SE_!!299314119.png

https://img.alicdn.com/imgextra/i2/299314119/O1CN01cVtzZ71gIYHdI5F0K_!!299314119.png

https://img.alicdn.com/imgextra/i1/299314119/O1CN01w7O2Si1gIYHYhUgQw_!!299314119.png

https://img.alicdn.com/imgextra/i1/299314119/O1CN01sl4ZIM1gIYHWkP2Uw_!!299314119.png

https://img.alicdn.com/imgextra/i2/299314119/O1CN01s1f7DS1gIYHevBijj_!!299314119.png


参考资料:
1、基于V7的CANopen例程模板和词典工具,使用的CANFD2接口。下次视频分享V5,V6,V7和CANopen主从机模板

链接:https://pan.baidu.com/s/1NEUPAeRKODop1GsZIUHgXA提取码:fr27

2、H7-TOOL的CANopen解析操作说明:
https://www.armbbs.cn/forum.php?mod=viewthread&tid=120863

3、CiA联盟文档下载:
https://www.can-cia.org/groups/specifications/

4、CAN词典,各种关键词含义,中文版
https://www.armbbs.cn/forum.php?mod=viewthread&tid=121421

5、西门子CANopen入门教程
https://www.armbbs.cn/forum.php?mod=viewthread&tid=121430

6、周立功CANopen入门教程
https://www.armbbs.cn/forum.php?mod=viewthread&tid=117650

7、CANopen电子书
https://www.armbbs.cn/forum.php?mod=viewthread&tid=110717

8、一张图了解CANopen常用命令
https://www.armbbs.cn/forum.php?mod=viewthread&tid=121245

9、CiA301中英文手册:
https://www.armbbs.cn/forum.php?mod=viewthread&tid=117799

eric2013 发表于 2023-10-17 02:01:18

更新完成。

huangxxshuai 发表于 2023-10-17 08:34:04

跟着大佬继续学习!再攻克一城

AiK 发表于 2023-10-17 08:41:08

:victory: 收下了 学习

missfox 发表于 2023-10-17 08:48:06

怒赞:victory:

qq1646544 发表于 2023-10-17 09:07:59

绝了,今晚就看

Vxworks 发表于 2023-10-17 10:20:43

终于发布了:victory:

uyk 发表于 2023-10-17 11:19:57

收下了,谢谢。请问下会出 CiA402 的吗

eric2013 发表于 2023-10-17 11:42:41

uyk 发表于 2023-10-17 11:19
收下了,谢谢。请问下会出 CiA402 的吗
下次CANopenNode程序框架,V5,V6,V7得CANopen主从机组网和CAN词典工具使用方法。

longquan 发表于 2023-10-17 22:56:21

zlg的书,故意叫你看不懂,学不会,我是看瑞萨的白皮书看明白的。

周老板特别爱出版书,还爱讲课,但不是讲技术

eric2013 发表于 2023-10-18 08:07:41

longquan 发表于 2023-10-17 22:56
zlg的书,故意叫你看不懂,学不会,我是看瑞萨的白皮书看明白的。

周老板特别爱出版书,还爱讲课,但不 ...
这次分享的周立功那个CANopen书籍还不错,主要是对这张表的汉化和注解

https://img.anfulai.cn/dz/attachment/forum/202309/28/095145xlp8nb7048wyat4y.png

Vxworks 发表于 2023-10-23 14:28:35

本帖最后由 Vxworks 于 2023-10-23 14:46 编辑

尝试SDO主机通信,没找到对应得API应该调用那个。

eric2013 发表于 2023-10-23 14:47:08

eric2013 发表于 2023-10-18 08:07
这次分享的周立功那个CANopen书籍还不错,主要是对这张表的汉化和注解

CANopenNode主机做SDO通信测试代码
https://www.armbbs.cn/forum.php?mod=viewthread&tid=121409

tankooo 发表于 2023-10-24 00:46:37

请教一个问题   按照我的理解。    tpdo 节点是不是最多只可以传输8*4=32个字节的数据。假设分机传输5组内容给主机,每组内容8字节,要怎么处理。1:每次都要主机sdo主动问分机多余的8字节数据?   2:主机定时修改分机tpdo的映射表? 还是有其他办法?

eric2013 发表于 2023-10-24 08:40:35

tankooo 发表于 2023-10-24 00:46
请教一个问题   按照我的理解。    tpdo 节点是不是最多只可以传输8*4=32个字节的数据。假设分机传输5组内 ...

TPDO的同步非周期方式。这个玩法是节点先触发传输请求,主机发送同步包,然后节点再传输数据给主机。

tankooo 发表于 2023-10-24 11:03:03

还是不太明白“节点先触发传输请求”是怎么实现的。 我感觉节点就是一个傻傻的从机,只要把要交互的数据排列在0x2000的字典里就可以了。要主动上传的数据就配置TPDO里。 非同步模式。节点上传的内容也没有变化锕,因为TPDO的映射表没有变化。难道要节点自己配合主机的同步码时不时的修改映射表,虽然都是TPDO1发出的数据,不过里面代表的内容不同了,主机分的清吗。

eric2013 发表于 2023-10-24 11:31:40

tankooo 发表于 2023-10-24 11:03
还是不太明白“节点先触发传输请求”是怎么实现的。 我感觉节点就是一个傻傻的从机,只要把要交互的数据排 ...

PDO同步模式是主机一直有同步包发送出来的。
TPDO的同步非周期方式:你的从节点数据有变化了,告诉主机数据有变化了,主机发送同步包后,此时从机会反馈数据,你的节点不触发请求,同步包来了不回复数据。

比你SDO定时轮询修改方便。具体数据区分,自己定义即可。

chengyurongdeBB 发表于 2023-10-24 14:06:08

软汉,能顺便把基于CAN的ISO15765多帧数据的收发和ISO14229 UDS诊断分别弄出来吗,这是CAN最重要的技术。

eric2013 发表于 2023-10-24 14:49:45

chengyurongdeBB 发表于 2023-10-24 14:06
软汉,能顺便把基于CAN的ISO15765多帧数据的收发和ISO14229 UDS诊断分别弄出来吗,这是CAN最重要的技术。
ISO15765支持,前几年就已经发布了




chengyurongdeBB 发表于 2023-10-27 09:06:55

eric2013 发表于 2023-10-24 14:49
ISO15765支持,前几年就已经发布了

可以,能在加入UDS诊断吗?ISO14229,很多网友需要这个诊断,你看看我的协议整一个

chengyurongdeBB 发表于 2023-10-27 09:10:43

硬汉,配合iso15765把ISO14229的UDS诊断协议也弄一下,搞汽车开发的都在用这套协议啊,造福所有汽车开发者

eric2013 发表于 2023-10-27 09:10:56

chengyurongdeBB 发表于 2023-10-27 09:06
可以,能在加入UDS诊断吗?ISO14229,很多网友需要这个诊断,你看看我的协议整一个
必须有啊。

下一步有基于CAN的BMS,J1939, OBD-II,UDS,CANISO TP等陆续支持了,史称CAN全家桶。

chengyurongdeBB 发表于 2023-10-27 09:14:53

eric2013 发表于 2023-10-27 09:10
必须有啊。

下一步有基于CAN的BMS,J1939, OBD-II,UDS,CANISO TP等陆续支持了,史称CAN全家桶。

我把协议udsISO14229发给你了,原版PDF,帮忙搞出来造福广大汽车研发工程师啊,让所有爱好者都能通过CAN工具刷写更新自己的汽车OTA固件

chengyurongdeBB 发表于 2023-10-27 09:21:58

eric2013 发表于 2023-10-27 09:10
必须有啊。

下一步有基于CAN的BMS,J1939, OBD-II,UDS,CANISO TP等陆续支持了,史称CAN全家桶。

你搞了这个,这个H7 TOOL会卖的更火,很多4S店会向你采购的,因为现在汽车出现故障码,都需要UDS CAN来分析故障来源,这些专业的工具都很贵,5千起步,你这个做完善了,就相当于低价垄断了专业设备的市场,你的H7 TOOLS会卖的更多的,现在汽车产业这么火爆,你难道没有这方面的觉悟?市场的嗅觉

eric2013 发表于 2023-10-27 09:27:04

chengyurongdeBB 发表于 2023-10-27 09:21
你搞了这个,这个H7 TOOL会卖的更火,很多4S店会向你采购的,因为现在汽车出现故障码,都需要UDS CAN来分 ...

加油,奥里给。

eric2013 发表于 2023-10-27 09:29:41

chengyurongdeBB 发表于 2023-10-27 09:14
我把协议udsISO14229发给你了,原版PDF,帮忙搞出来造福广大汽车研发工程师啊,让所有爱好者都能通过CAN ...
你有时间的话,可以把下面这些资料整理打包给大家分享下,我觉得很有意义。

      ISO 4092:1988/Cor.1:1991, Road vehicles — Diagnostic systems for motor vehicles — Vocabulary — Technical Corrigendum 1
      ISO/IEC 7498-1, Information technology — Open Systems Interconnection — Basic Reference Model: The Basic Model
      ISO/IEC 7618-8:2006, Identification cards — Integrated circuit cards
      ISO/TR 8509:1987, Information processing systems — Open Systems Interconnection — Service conventions
      ISO/IEC 9798-2, IT Security techniques — Entity authentication — Part 2: Mechanisms using authenticated encryption
      ISO/IEC 9798-3, IT Security techniques — Entity authentication — Part 3: Mechanisms using digital signature techniques
      ISO/IEC 9798-4, Information technology — Security techniques — Entity authentication — Part 4: Mechanisms using a cryptographic check function
      ISO/IEC 10731, Information technology — Open Systems Interconnection — Basic Reference Model — Conventions for the definition of OSI services
      ISO 11992-4, Road vehicles — Interchange of digital information on electrical connections between towing and towed vehicles — Part 4: Diagnostics
      ISO 14229-3, Road vehicles — Unified diagnostic services (UDS) — Part 3: Unified diagnostic services on CAN implementation (UDSonCAN)
      ISO 14229-4, Road vehicles — Unified diagnostic services (UDS) — Part 4: Unified diagnostic services on FlexRay implementation (UDSonFR)
      ISO 14229-5, Road vehicles — Unified diagnostic services (UDS) — Part 5: Unified diagnostic services on Internet Protocol implementation (UDSonIP)
      ISO 14229-6, Road vehicles — Unified diagnostic services (UDS) — Part 6: Unified diagnostic services on K-Line implementation (UDSonK-Line)
      ISO 14229-7, Road vehicles — Unified diagnostic services (UDS) — Part 7: UDS on local interconnect network (UDSonLIN)
      ISO 14229-8, Road vehicles — Unified diagnostic services (UDS) — Part 8: Unified diagnostic services on clock extension peripheral interface implementation (UDSonCXPI)
      ISO 15031-2, Road vehicles — Communication between vehicle and external equipment for emissions-related diagnostics — Part 2: Guidance on terms, definitions, abbreviations and acronyms
      ISO 15031-6, Road vehicles — Communication between vehicle and external equipment for emissions-related diagnostics — Part 6: Diagnostic trouble code definitions
      ISO 15765-4, Road vehicles — Diagnostic communication over Controller Area Network (DoCAN) — Part 4: Requirements for emissions-related systems
      ISO 22901-1, Road vehicles — Open diagnostic data exchange (ODX) — Part 1: Data model specification
      ISO 26021-2, Road vehicles — End-of-life activation of on-board pyrotechnic devices — Part 2: Communication requirements
      ISO 27145-2, Road vehicles — Implementation of World-Wide Harmonized On-Board Diagnostics (VOBD) communication requirements — Part 2: Common data dictionary
      ISO 27145-3, Road vehicles — Implementation of World-Wide Harmonized On-Board Diagnostics (VOBD) communication requirements — Part 3: Common message dictionary
      SAE J1939:2011, Serial Control and Communications Heavy Duty Vehicle Network — Top Level Document
      SAE J1939-73:2010, Application Layer — Diagnostics
      ISO 10681-2, Road vehicles — Communication on FlexRay — Part 2: Communication layer services
      ISO 11898-1, Road vehicles — Controller area network (CAN) — Part 1: Data link layer and physical signalling
      ISO 11898-2, Road vehicles — Controller area network (CAN) — Part 2: High-speed medium access unit
      ISO 13400-2, Road vehicles — Diagnostic communication over Internet Protocol (DoIP) — Part 2: Transport protocol and network layer services
      ISO 13400-3, Road vehicles — Diagnostic communication over Internet Protocol (DoIP) — Part 3: Wired vehicle interface based on IEEE 802.3
      ISO 14230-1, Road vehicles — Diagnostic communication over K-Line (DoK-Line) — Part 1: Physical layer
      ISO 14230-2, Road vehicles — Diagnostic communication over K-Line (DoK-Line) — Part 2: Data link layer
      ISO 15031-4, Road vehicles — Communication between vehicle and external equipment for emissions-related diagnostics — Part 4: External test equipment
      ISO 15031-5, Road vehicles — Communication between vehicle and external equipment for emissions-related diagnostics — Part 5: Emissions-related diagnostic services
      ISO 15765-2, Road vehicles — Diagnostic communication over Controller Area Network (DoCAN) — Part 2: Transport protocol and network layer services
      ISO 16844-7, Road vehicles — Tachograph systems — Part 7: Parameters
      ISO 17458-2, Road vehicles — FlexRay communications system — Part 2: Data link layer specification
      ISO 17458-4, Road vehicles — FlexRay communications system — Part 4: Electrical physical layer specification
      ISO 17987-2, Road vehicles — Local Interconnect Network (LIN) — Part 2: Transport protocol and network layer services
      ISO 17987-3, Road vehicles — Local Interconnect Network (LIN) — Part 3: Protocol specification
      ISO 17987-4, Road vehicles — Local Interconnect Network (LIN) — Part 4: Electrical physical layer (EPL) specification 12 V/24 V
      ISO 20794-3, Road vehicles — Clock extension peripheral interface (CXPI) — Part 3: Transport and network layer
      ISO 20794-4, Road vehicles — Clock extension peripheral interface (CXPI) — Part 4: Data link layer and physical layer
      ISO 26021-2, Road vehicles — End-of-life activation of on-board pyrotechnic devices — Part 2: Communication requirements
      ISO 27145-4, Road vehicles — Implementation of World-Wide Harmonized On-Board Diagnostics (WWH-OBD) communication requirements — Part 4: Connection between vehicle and test equipment
      IEEE 802.3, IEEE Standard for Ethernet
      SAE J1978, OBD II Scan Tool — Equivalent to ISO/DIS 15031-4:December 14, 2001
      SAE J1979, E/E Diagnostic Test Modes
      SAE J1979-2, Compliant OBDII Scan Tool
      SAE J1979-DA, Digital Annex of E/E Diagnostic Test Modes
      SAE J2012, Diagnostic Trouble Code Definitions
      SAE J2534, Recommended Practice for Pass-Thru Vehicle Programming (STABILIZED Jul 2019)
      ISO 15765-5, Road vehicles — Diagnostic communication over Controller Area Network (DoCAN) — Part 5: Specification for an in-vehicle network connected to the diagnostic link connector

chengyurongdeBB 发表于 2023-10-27 09:38:37

eric2013 发表于 2023-10-27 09:29
你有时间的话,可以把下面这些资料整理打包给大家分享下,我觉得很有意义。

      ISO 4092:1988 ...

我们需要你把ISO16765 ISO14229 J1939基于CAN的一整套完整的组包解包还有故障诊断搞出来,发布在论坛里,这样才能造福广大电子软件工作者,我的编码能力不够,你可以的

eric2013 发表于 2023-10-27 10:10:38

chengyurongdeBB 发表于 2023-10-27 09:38
我们需要你把ISO16765 ISO14229 J1939基于CAN的一整套完整的组包解包还有故障诊断搞出来,发布在论坛里, ...

你有时间的话,把这些文档整理下,人多力量大,方便查阅。

chengyurongdeBB 发表于 2023-10-27 11:05:58

eric2013 发表于 2023-10-27 10:10
你有时间的话,把这些文档整理下,人多力量大,方便查阅。

硬汉快点把这一套集成到H7 TOOLS上,商机啊,隔壁的正点原子现在还没有涉足这个领域,你先把CAN的UDS诊断固件弄出来发到论坛上,很多汽车工程师会向你购买的,因为有个方便携带的车载诊断仪是很多汽车电子工程师的好工具,现在新能源汽车这么火,车厂都用的CANoe动辄上10万,或者买PCAN或者Kavaser动辄5千以上专业分析仪器,你要是把这一套实现在HT TOOLS上,绝对会非常有市场的大卖,趁正点原子还没有嗅到这个领域,赶快弄出来,做成第一个吃螃蟹的人啊

eric2013 发表于 2023-10-27 11:24:15

chengyurongdeBB 发表于 2023-10-27 11:05
硬汉快点把这一套集成到H7 TOOLS上,商机啊,隔壁的正点原子现在还没有涉足这个领域,你先把CAN的UDS诊断 ...

还第1个吃螃蟹,现在吃已经很晚了,论坛好几个搞这个的坛友。

这个NXP就有S32K系列就有开源UDS的简易版,大家想抄,直接抄就行。。。

https://www.nxp.com/products/processors-and-microcontrollers/s32-automotive-platform/s32k-auto-general-purpose-mcus/s32k1-microcontrollers-for-automotive-general-purpose:S32K1#design-resources




chengyurongdeBB 发表于 2023-10-27 11:34:57

eric2013 发表于 2023-10-27 11:24
还第1个吃螃蟹,现在吃已经很晚了,论坛好几个搞这个的坛友。

这个NXP就有S32K系列就有开源UDS的简 ...

这不对,虽然有但是坛友没有任何人作出像H7 TOOLs这样的工具,集成UDS诊断,你的H7 TOOLS上集成这一套诊断协议你把价格多卖500元我都愿意大量购买,坛友只是实现了C代码但是没有作出诊断仪这种成品,你的成品HT TOOLS集成了更有销量市场

eric2013 发表于 2023-10-27 11:49:50

chengyurongdeBB 发表于 2023-10-27 11:34
这不对,虽然有但是坛友没有任何人作出像H7 TOOLs这样的工具,集成UDS诊断,你的H7 TOOLS上集成这一套诊 ...

我认为你的理解有偏差,国内这些新能源汽车开发厂家还在乎这几万块的CAN分析仪。稍好点的示波器都是几十万。那个公司还没几套专业设备。

所以说你要搞UDS, 就要找准定位。方向问题就讨论这么多,不再聊了。



BZU2020 发表于 2023-10-28 21:09:55

这个协议栈怎么移植呢网上CANFestival的资料已经非常多了CANOpenNode协议栈还真没有呢做这个真的是全网独家啊

eric2013 发表于 2023-10-29 01:21:31

BZU2020 发表于 2023-10-28 21:09
这个协议栈怎么移植呢网上CANFestival的资料已经非常多了CANOpenNode协议栈还真没有呢做这个真的是全 ...

这个驱动都已经提供了好了,自己简单配置个Init后,就可以使用了。下期视频教程我说下这个问题。

xuhenry09 发表于 2024-1-29 09:10:47

非常给力,很全面。

张帆无敌帅 发表于 2024-2-7 14:50:25

本帖最后由 张帆无敌帅 于 2024-2-7 16:39 编辑

我在自己板子上试着移植了一下,但是会出现TPDO和RPDO不能成功发送的情况。SDO和心跳报文都是可以正常发送的。心跳报文发送05,操作状态。请问应该从哪方面去分析解决这个问题。
所用环境:
keil 5.32
STM32F103TBU6硬件

eric2013 发表于 2024-2-13 14:57:15

张帆无敌帅 发表于 2024-2-7 14:50
我在自己板子上试着移植了一下,但是会出现TPDO和RPDO不能成功发送的情况。SDO和心跳报文都是可以正常发送 ...

PDO要进入正常操作模式才可以使用。

zbq 发表于 2024-4-2 11:39:20

eric2013 发表于 2023-10-27 09:10
必须有啊。

下一步有基于CAN的BMS,J1939, OBD-II,UDS,CANISO TP等陆续支持了,史称CAN全家桶。

硬汉你好,我现在遇到一个问题想请教下,
我一个CAN总线里面有1个主控18个节点,每个节点每一个周期要发送30帧数据,目前做法是主控没一个周期发送一个同步到总线,所有从机收到后,根据自己(节点地址-1)*30Ms定时,时间到发送数据,主机中断中把数据解析放到对应节点数据变量中,同步帧500ms后开始处理数据。这样整个CAN网络就变成顺序的了,变成大号485了,有些浪费CAN自身的仲裁机制了。我现在想改成从机采集完数据就发送,主机接受,但是这样我处理数据时机不好控制,有可能要处理数据时候又收到数据了,想请教下您,这种应用场景,有没有一个种现成的成熟的协议(比如canopen,j1939(考虑一次把数据传完))

eric2013 发表于 2024-4-2 14:48:02

zbq 发表于 2024-4-2 11:39
硬汉你好,我现在遇到一个问题想请教下,
我一个CAN总线里面有1个主控18个节点,每个节点每一个周期要发 ...

发送同步帧后,让所有节点立即返回数据即可,因为你的节点ID都不同,CAN硬件可以方便的仲裁控制。

canopen的同步周期通信就是这么用的。

zbq 发表于 2024-4-2 14:53:10

eric2013 发表于 2024-4-2 14:48
发送同步帧后,让所有节点立即返回数据即可,因为你的节点ID都不同,CAN硬件可以方便的仲裁控制。

can ...

这样的话,我是不是,每一个节点发送数据帧与帧之间要加一定间隔,如果连续发送18个节点会不会把总线干死了
页: [1] 2
查看完整版本: BSP视频教程第27期:CANopen协议栈专题,实战方式系统了解NMT,PDO,SDO,时间戳,同步报文,紧急报文等(2023-10-17)