基于UDS的CAN Bootloader软件设计与实现

UDS-based CAN Bootloader software design and implementation

  • 摘要: 为了满足APP程序在实际应用中便捷升级下载需求,针对S32K144单片机,参考UDS(unified diagnostic services)协议规范要求,设计了一种CAN Bootloader升级下载系统。上位机以Visual Studio为开发环境,以SREC作为刷写文件并通过Kvaser USB2CAN硬件设备与下位机进行CAN通信,下载流程基于ISO 14229协议框架实现了服务命令封装,传输过程基于ISO 15765-2设计实现了网络层通讯机制和错误处理策略。微控制器端将Flash分为Bootloader、APP程序和模拟EEPROM(electrically erasable programmable read-only memory)标志位3部分,下载触发方式采用标志位加短延时的方式,整个升级过程严格遵从UDS协议规范。经过数十次实际测试,验证了该系统可完整下载APP程序的结论。结果表明,该CAN Bootloader在线下载系统实现了UDS协议规范下的程序下载升级,整个升级过程稳定高效,并具有可移植性和可拓展性,证明了该系统的可靠性和稳定性。

     

    Abstract: To satisfy the requirements for convenient upgrades and downloads of APP programs in practical applications, a CAN Bootloader upgrade and download system for the S32K144 microcontroller has been designed, taking into account the UDS protocol specifications. The host computer, utilizing Visual Studio as the development environment and SREC as the flashing file, communicates with the lower computer through the Kvaser USB2CAN hardware device over CAN, with service command encapsulation based on the ISO 14229 protocol framework being implemented for the download process. The transmission process has been designed in accordance with ISO 15765-2, establishing a network layer communication mechanism and error handling strategy. The microcontroller side has been partitioned into Bootloader, APP program, and simulated EEPROM flag bits. The download trigger method employs a flag bit along with a short delay, and the entire upgrade process adheres strictly to the UDS protocol specifications. Following numerous actual tests, it has been confirmed that the system is capable of achieving the complete download of the APP program. The outcomes demonstrate that the CAN Bootloader online download system accomplishes program downloads and upgrades in accordance with the UDS protocol specifications, featuring a stable and efficient upgrade process, as well as portability and scalability, thereby confirming the system’s reliability and stability.

     

/

返回文章
返回