《電子技術(shù)應(yīng)用》
您所在的位置:首頁 > 嵌入式技术 > 设计应用 > 基于UDSonCAN协议的车载ECU Bootloader开发
基于UDSonCAN协议的车载ECU Bootloader开发
电子技术应用
邹敏捷,刘帅,马闻铎,唐天宇,张佳淼,杨博,刘兵
摘要: 针对车载ECU软件规模激增与漏洞频发的现状,以及传统刷写依赖物理拆卸及私有协议导致的效率低下、成本高等问题,基于UDS相关协议(ISO 14229-1, ISO 15765-2)在NXP S32K144微控制器上设计并开发了CAN总线下标准化的Bootloader程序。系统整合了UDS应用层关键服务与传输层多帧分包机制,构建了包含预编程、编程和后编程三阶段的完整刷写流程。采用严格的Flash分区策略及硬件保护机制,并结合程序CRC校验,确保启动可靠性与更新安全性。在此基础上,自主开发了基于Delphi的客户端工具,并进行了一系列Bootloader刷写测试。测试结果表明,该方案实现了高效、稳定的ECU软件的更新升级功能,并在ECU掉电、CAN通信中断等异常情况下展现出良好的鲁棒性与可靠恢复能力。本方案为汽车关键ECU提供了标准化、高可靠的软件的更新及升级能力,为未来ECU软件开发、优化、标定、升级奠定基础,也为同类ECU的软件升级开发提供了一个详实的工程参考。
關(guān)鍵詞: UDS协议 Bootloader CAN总线 S32K144 ECU
中圖分類號:U463.6 文獻(xiàn)標(biāo)志碼:A DOI: 10.16157/j.issn.0258-7998.257259
中文引用格式: 鄒敏捷,劉帥,馬聞鐸,等. 基于UDSonCAN協(xié)議的車載ECU Bootloader開發(fā)[J]. 電子技術(shù)應(yīng)用,2026,52(3):98-105.
英文引用格式: Zou Minjie,Liu Shuai,Ma Wenduo,et al. Development of ECU Bootloader based on UDSonCAN protocol[J]. Application of Electronic Technique,2026,52(3):98-105.
Development of ECU Bootloader based on UDSonCAN protocol
Zou Minjie,Liu Shuai,Ma Wenduo,Tang Tianyu,Zhang Jiamiao,Yang Bo,Liu Bing
School of Energy and Power Engineering, Xi’an Jiaotong University
Abstract: In response to the challenges of exponential growth in software complexity and frequent vulnerability in vehicle electronic control units (ECUs), coupled with the inefficiencies and cost challenges associated with traditional physical disassembly-dependent flashing methods utilizing proprietary protocols, this study proposes a standardized CAN bus based Bootloader solution which is implemented on the NXP S32K144 microcontroller with adherence to UDS protocol specifications (ISO 14229-1 and ISO 15765-2). The developed framework incorporates critical UDS application layer services and transport layer packet segmentation mechanisms to establish a comprehensive three-phase firmware update process encompassing pre-programming, programming, and post-programming phases. Through rigorous Flash partitioning architecture, hardware-based protection mechanisms, and cyclic redundancy check (CRC) verification protocols, the system ensures robust boot reliability and secure update operations. Based on this, a self-developed Delphi-based client tool was designed and extensive Bootloader programming testing was conducted. Experimental results demonstrate the solution's capacity for efficient and reliable ECU software updates, exhibiting exceptional robustness and reliable recovery capabilities even under adverse conditions including power interruptions and CAN communication failures. This implementation establishes a standardized and highly reliable software update and upgrade framework for automotive critical ECUs, providing fundamental technical bases for future ECU software development, optimization, calibration, and upgrade. The proposed methodology also offers a comprehensive engineering reference for software upgrade development of similar ECUs.
Key words : UDS protocol;Bootloader;CAN bus;S32K144;ECU

引言

隨著“軟件定義汽車”(Software Defined Vehicle, SDV)理念成為行業(yè)共識,汽車功能的迭代、性能優(yōu)化及安全漏洞修復(fù)日益依賴于高效、可靠的軟件在線升級能力[1]。在此背景下,電子控制單元(Electronic Control Unit, ECU)軟件規(guī)模與復(fù)雜度呈爆發(fā)式增長,當(dāng)前高端車型代碼量已達(dá)數(shù)億行,各類漏洞(如協(xié)議缺陷、加密漏洞、邏輯錯誤)難以避免[2-3]。因此,構(gòu)建支持安全、高效的軟件更新的底層機(jī)制,特別是標(biāo)準(zhǔn)化、魯棒的Bootloader,已成為實現(xiàn)SDV愿景的關(guān)鍵基石。

傳統(tǒng)的ECU軟件更新依賴物理拆卸與專用設(shè)備進(jìn)行離線燒錄,存在耗時長、成本高昂、操作繁瑣且對人員專業(yè)性要求高等顯著弊端[4]。早期廠商ECU軟件更新采用的私有化協(xié)議雖部分解決了專用設(shè)備依賴,卻導(dǎo)致不同ECU需配套獨立的客戶端工具,大幅增加了整車廠供應(yīng)鏈管理復(fù)雜度與工具開發(fā)成本。

為系統(tǒng)化解決上述痛點,基于統(tǒng)一診斷服務(wù)(Unified Diagnostic Services, UDS)協(xié)議的Bootloader應(yīng)運而生。UDS作為汽車電子領(lǐng)域廣泛應(yīng)用的標(biāo)準(zhǔn)診斷協(xié)議,其定義的安全訪問(Security Access)、數(shù)據(jù)傳輸(Data Transfer)、例程控制(Routine Control)等服務(wù),為Bootloader提供了跨平臺、跨供應(yīng)商的標(biāo)準(zhǔn)化安全校驗與數(shù)據(jù)寫入機(jī)制。這不僅顯著降低了開發(fā)與維護(hù)成本,也為后續(xù)遠(yuǎn)程升級奠定了基礎(chǔ)[5-6]。

而隨著汽車智能化與網(wǎng)聯(lián)化的飛速發(fā)展,空中下載(Over The Air, OTA)技術(shù)已成為信息娛樂系統(tǒng)(In-Vehicle Infotainment, IVI)及高級駕駛輔助系統(tǒng)(Advanced Driving Assistance System, ADAS)軟件更新的重要手段[7-8]。然而,對于實時性、安全性要求極高的動力系統(tǒng)、底盤系統(tǒng)等關(guān)鍵ECU,控制器局域網(wǎng)絡(luò)(Controller Area Network, CAN)總線仍是主流通信方式[9],其底層Bootloader的安全性與可靠性是支撐更高層級OTA功能的核心前提。盡管UDS Bootloader的理念已較為成熟,但在主流微控制器(MCU)平臺(如廣泛應(yīng)用的ARM Cortex-M系列)上,實現(xiàn)兼顧嚴(yán)格安全要求、強(qiáng)魯棒性與資源高效利用的詳細(xì)工程方案,公開文獻(xiàn)或開源參考數(shù)量仍顯不足。

因此,本研究選擇基于ARM Cortex-M4內(nèi)核的NXP S32K144 MCU作為硬件平臺,以S32 Design Studio為集成開發(fā)環(huán)境,依據(jù)ISO 14229-1及ISO 15765-2等協(xié)議標(biāo)準(zhǔn),設(shè)計并實現(xiàn)了一套完整的Bootloader程序。進(jìn)而,在Windows平臺下自主開發(fā)了配套的客戶端刷寫工具,并進(jìn)行了詳盡的刷寫流程驗證,旨在提供一個經(jīng)過充分工程實踐檢驗、可復(fù)用的參考實現(xiàn)。


本文詳細(xì)內(nèi)容請下載:

http://ihrv.cn/resource/share/2000007012


作者信息:

鄒敏捷,劉帥,馬聞鐸,唐天宇,張佳淼,楊博,劉兵

(西安交通大學(xué) 能源與動力工程學(xué)院,陜西 西安 710049)

2.jpg

此內(nèi)容為AET網(wǎng)站原創(chuàng),未經(jīng)授權(quán)禁止轉(zhuǎn)載。