基于UDS协议的汽车控制器刷写软件设计
2021-07-11唐恒飞王效金
唐恒飞 王效金



摘 要:基于某整车厂提供的控制器和刷写程序(hex文件),利用实验室研发的汽车诊断仪,设计了一款上位机刷写软件。该软件是利用C#语言中的WinForm界面和基于CAN总线的UDS协议进行编写,并且遵循软件设计V型开发流程,主要内容是刷写方案的设计,以及研究上位机软件与控制器之间信息的交互,最后该软件经过上下位机联调测试,可以很好地体现其正确性以及可靠性。
关键词: 刷写;UDS协议;C#;ECU;V型
文章编号: 2095-2163(2021)01-0102-04 中图分类号:TP26 文献标志码:A
【Abstract】Based on the controller and flash writing program (.hex file) provided by a vehicle factory, a flash writing software for upper computer is designed by using the automobile diagnosis instrument developed in the laboratory. The software is written by WinForm interface in C# language and UDS protocol based on CAN bus, and follows the V-shaped development process of software design. The main content is the design of brush writing scheme and the information interaction between the upper computer software and the controller. Finally, the software has been tested by the upper and lower computers, which can reflect its correctness and reliability.
【Key words】flash and write;UDS protocol; C#; ECU; V type
0 引 言
随着互联网技术的迅猛发展,带动整个汽车行业加速走向了智能化。由此即提升了汽车控制单元的控制策略和功能复杂度,进而使得控制器内部软件更新升级的要求也越来越高。因此国内外有众多的学者和企业都在致力于研究汽车控制器刷写。文献[1]基于UDS协议和MPC5634单片机,设计了一款在线升级软件;文献[2]利用LabView编程语言,基于UDS协议设计了ECU刷写上位机软件;文献[3]提出了一种基于UDS协议的汽车ECU升级方案,详细讨论了汽车ECU的BootLoader刷写软件的实现原理。本文则是利用C#语言,基于UDS协议和CAN通讯机制设计上位机刷写软件。整个上位机软件的设计遵循V型开发流程,首先提出设计需求,接着根据需求写出刷写方案,最后通过上、下位机联调测试,抓取报文,从而验证了本文设计的刷写软件的正确性及可靠性。
1 UDS协议及帧类型介绍
1.1 UDS协议
UDS协议是诊断服务的标准规范,规定了诊断服务的具体命令,UDS协议用于刷写的服务命令[4]见表1。……
