中国半导体行业协会封装分会会刊

中国电子学会电子制造与封装技术分会会刊

导航

电子与封装

• 产品与应用 •    下一篇

基于CAN总线的CKS32远距离在线升级设计与实现

谢金峰1,刘涵2, 3,赵本田2, 3   

  1. 1. 延边大学工学院,吉林 延吉  133002;2. 智能汽车安全技术全国重点实验室,江苏 无锡  214072;3. 中科芯集成电路有限公司,江苏 无锡  214072
  • 收稿日期:2024-11-08 修回日期:2025-01-13 出版日期:2025-01-20 发布日期:2025-01-20
  • 通讯作者: 赵本田

Design and Implementation of CKS32 Remote Online Upgrade Based on CAN Bus

XIE Jinfeng1, Liu Han2,3, ZHAO Bentian2,3   

  1. 1. College of Engineering, Yanbian University, Yanji 133002, China; 2. State Key Laboratory of Intelligent Vehicle Safety Technology, Wuxi 214702, China; 3. China Key System & Integrated Circuit Co., Ltd., Wuxi 214072, China
  • Received:2024-11-08 Revised:2025-01-13 Online:2025-01-20 Published:2025-01-20

摘要: 提出了一种基于CAN总线和IAP技术的远距离在线升级方案,能解决分布式控制系统中固件更新不便的问题,并成功实现了单节点及多节点同步在线升级。其中,该方案中PC上位机采用PyQt5 C++设计,通过USB转CAN接口实现与各个CKS32 CAN从节点通信交互。CKS32 CAN从节点是基于IAP技术特征,将片内Flash四段式划分并分时加载代码。为了避免数据传输时遭遇异常中断、误码等,增加了断点重传、计数和CRC16-MODBUS校验机制,提高升级的安全性和效率。经测试,分布式系统中总升级时间缩短,升级成功率大于95%,即使CAN从节点升级失败仍能上报结果并按照先前状态运行。

关键词: CKS32, CAN总线, IAP, 断点重传, 多节点

Abstract: A remote online upgrade solution based on CAN bus and IAP technology was proposed, which could solve the inconvenience of firmware updates in distributed control systems. The solution successfully achieved synchronous online upgrades for single and multiple nodes. In this solution, the PC host computer was designed using PyQt5 Python, and communication interaction with the various CKS32 CAN slave nodes was realized through a USB-to-CAN interface. The CKS32 CAN slave nodes were based on the IAP technology feature, which divided the on-chip Flash into four segments and loaded code in a time-division manner. To avoid abnormal interruptions and errors during data transmission, the system has been equipped with a mechanism for resuming transmission from the point of interruption, counting, and CRC16-MODBUS verification, thus improving the security and efficiency of the upgrade. After testing, the total upgrade time in the distributed system was shortened, the upgrade success rate was greater than 95%, and even if the CAN slave node upgrade failed, it could report the results and continue to operate according to the previous state.

Key words: CKS32, CAN bus, IAP, breakpoint retransmission, multiple nodes