WO2023045440A1 - Ecu program-flashing method and apparatus - Google Patents

Ecu program-flashing method and apparatus Download PDF

Info

Publication number
WO2023045440A1
WO2023045440A1 PCT/CN2022/099857 CN2022099857W WO2023045440A1 WO 2023045440 A1 WO2023045440 A1 WO 2023045440A1 CN 2022099857 W CN2022099857 W CN 2022099857W WO 2023045440 A1 WO2023045440 A1 WO 2023045440A1
Authority
WO
WIPO (PCT)
Prior art keywords
ecu
flashing
program
connection
command
Prior art date
Application number
PCT/CN2022/099857
Other languages
French (fr)
Chinese (zh)
Inventor
贾文伟
原诚寅
Original Assignee
北京国家新能源汽车技术创新中心有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京国家新能源汽车技术创新中心有限公司 filed Critical 北京国家新能源汽车技术创新中心有限公司
Publication of WO2023045440A1 publication Critical patent/WO2023045440A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Definitions

  • the invention relates to the technical field of automobiles, in particular to a method and device for flashing an ECU program.
  • the vehicle-mounted terminal it is usually necessary to realize the data flashing function of the electronic control unit (Electronic Control Unit, ECU), and the data flashing function is used to update the new program package to the ECU.
  • ECU Electronic Control Unit
  • the corresponding program needs to be flashed before the automotive ECU goes offline, which requires a set of methods for flashing the automotive ECU program; and the ECU programs of different hardware versions are different, so this flashing method is required to support flashing Different hardware versions of automotive ECU programs; the usual method is to reconfigure the flashing software to achieve program flashing of different hardware versions of automotive ECUs.
  • the technical problem to be solved by the present invention is to provide an ECU program flashing method and device for flashing multiple different hardware versions of automobile ECU programs by only configuring flashing software once.
  • a method for flashing an ECU program comprising
  • the ECU will actively start the flashing process and feedback the flashing result; if it succeeds, it will disconnect from the ECU.
  • connection failure is greater than or equal to 5 times, then it is considered that the connection is wrong, and an error is reported while confirming whether there is a connection with the ECU;
  • connection fails within 5 times when establishing a communication connection with the ECU, try to re-establish the connection.
  • the flashing result is fed back. If it succeeds, it will prompt success, and if it fails, it will report an error and confirm whether it is connected to the ECU.
  • the ECU flashing process includes
  • the external command is a command to read the hardware version, and if so, the ECU hardware version is read, and the flashing device is returned, waiting for the next command; otherwise, it is judged whether the external command is a flashing command, and if so, it enters the flashing process to realize the program File legality verification, flashing tool legality verification, and correct transmission of control program files, otherwise the reply cannot recognize the command.
  • a kind of ECU program flashing device comprising
  • the first communication interface establishes a communication connection with the ECU
  • the memory stores the programs of the automobile ECU with multiple hardware versions
  • the processor reads the ECU hardware version through the first communication interface, searches for the corresponding APP program file in the storage according to the ECU hardware version, and checks whether the program file meets the requirements; if it meets the requirements, instructs the ECU to start the flashing process, And feed back the flashing result; if successful, disconnect from the ECU.
  • a display part is also included;
  • connection fails more than or equal to 5 times, it will be considered that the connection is wrong, and an error will be reported through the display and at the same time confirm whether there is a connection with the ECU;
  • connection fails within 5 times when establishing a communication connection with the ECU, try to re-establish the connection.
  • the flashing result is fed back. If successful, the display will prompt success, and if it fails, an error will be reported through the display and at the same time confirm whether there is a connection with the ECU.
  • it also includes a second communication interface for receiving flashing software from the host computer and storing it in the memory.
  • the first communication interface and the second communication interface are one or more of CAN, USB, serial port, network port, and GPIO.
  • the beneficial effect of the present invention is: through the method of the present application, it is not necessary to frequently change the configuration of the flashing software to realize the program flashing of different hardware versions of automobile ECUs; the flashing software can be configured only once to realize the flashing of multiple different hardware versions of automobiles
  • the method of ECU program reduce the error rate of off-line brushing program, save work steps, reduce the technical requirements for off-line operators, and improve production efficiency.
  • Fig. 1 is a kind of ECU hardware design drawing of the embodiment of the present invention
  • Fig. 2 is the schematic diagram that a kind of ECU program flashing device of the embodiment of the present invention is connected with ECU hardware design;
  • Fig. 3 is the schematic flow sheet of a kind of ECU program brush writing method of the specific embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of an ECU in a method for flashing an ECU program according to a specific embodiment of the present invention.
  • a kind of ECU program flashing device is used for automobile ECU to carry out program flashing, wherein
  • Flash indicator light (display piece), indicating busy or busy
  • the PC host computer can configure the ECU program corresponding to the hardware version
  • Automotive ECU should have the following functions:
  • the bootloader program has been flashed, and the CAN bus (or other lines) program flashing is supported;
  • the bootloader supports hardware version reading
  • the ECU hardware version circuit is designed for hardware; the hardware version design circuit refers to the automotive ECU hardware design in Figure 1.
  • the ECU program flashing device part includes:
  • the default state of the GPIO input is low level, and it is high level when there is an ECU connection;
  • the flashing process After the flashing process feedbacks that the flashing is successful, the success will be indicated by the indicator light; if the flashing fails in the feedback, an error will be reported through the indicator light;
  • the flashing process realizes the legality verification of the program file, the legality verification of the flashing tool, and controls the correct transmission of the program file;
  • the present invention discloses a method for updating the flashing software configuration once to realize the program flashing of ECUs with different hardware versions
  • the flashing program can be PC host computer software or handheld device software, which needs to be able to perform data communication, such as CAN, USB, serial port, etc.;
  • Automotive ECUs generally have CAN communication links, input and output IO pins;
  • the automotive ECU flashes the ECU application software through the flashing device and flashing software
  • the flashing device can supply power to the ECU and detect that the ECU is online;
  • the flashing device has a CAN communication interface for communicating with the automotive ECU;
  • the flashing software can be in the flashing device or on the PC host computer;
  • the flashing device needs to have an interface to communicate with the PC software, such as CAN, USB, serial port, network port, etc.
  • Automotive ECU actively obtains program data, authorizes, verifies and upgrades the boot program.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Library & Information Science (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to the technical field of automobiles, and in particular to an ECU program-flashing method and apparatus. The method comprises: establishing a communication connection with an ECU; reading the hardware version of the ECU, searching for a corresponding application program file according to the hardware version of the ECU, and checking whether the program file meets requirements; if the program file meets the requirements, the ECU actively starting a flashing process, and feeding back a flashing result; and if program flashing succeeds, disconnecting from the ECU. By means of the present invention, there is no need to frequently change the configuration of flashing software, and the program flashing of an automobile ECU with different hardware versions is realized; the flashing software can be configured only once to implement a method for flashing a plurality of automobile ECU programs with different hardware versions; and the error rate of an offline flashing program, the working steps, and the technical requirements for offline operators are reduced, such that the production efficiency is improved.

Description

一种ECU程序刷写方法以及装置A method and device for flashing an ECU program 技术领域technical field
本发明涉及汽车技术领域,具体涉及一种ECU程序刷写方法以及装置。The invention relates to the technical field of automobiles, in particular to a method and device for flashing an ECU program.
背景技术Background technique
在车载终端中,通常需要实现电子控制单元(Electronic Control Unit,ECU)的数据刷写功能,该数据刷写功能用于将新的程序包更新至ECU中。目前,汽车ECU下线前需要刷写相应的程序,这就需要一套刷写汽车ECU程序的方法;而不同的硬件版本的ECU的程序是不同的,就需要这套刷写方法支持刷写不同硬件版本的汽车ECU程序;通常方法是通过重新配置刷写软件实现不同硬件版本汽车ECU的程序刷写。In the vehicle-mounted terminal, it is usually necessary to realize the data flashing function of the electronic control unit (Electronic Control Unit, ECU), and the data flashing function is used to update the new program package to the ECU. At present, the corresponding program needs to be flashed before the automotive ECU goes offline, which requires a set of methods for flashing the automotive ECU program; and the ECU programs of different hardware versions are different, so this flashing method is required to support flashing Different hardware versions of automotive ECU programs; the usual method is to reconfigure the flashing software to achieve program flashing of different hardware versions of automotive ECUs.
但是在增加新车型的数据刷写逻辑时,需要考虑各功能模块之间的依赖性以及融合处理,需要修改大量的代码,甚至修改软件架构,开发人员改动难度高、工作量大,后期也不便于维护。每次更改刷写软件的配置都会带来配置错误的风险,而使ECU刷写错误程序的风险很高,效率低。However, when adding the data flashing logic of a new model, it is necessary to consider the dependencies between functional modules and the fusion processing. It is necessary to modify a large number of codes and even modify the software architecture. It is difficult for developers to make changes, and the workload is heavy. Easy maintenance. Changing the configuration of the flashing software every time will bring the risk of configuration errors, and the risk of flashing the wrong program for the ECU is high and the efficiency is low.
发明内容Contents of the invention
本发明所要解决的技术问题是:提供一种只配置一次刷写软件实现刷写多种不同硬件版本汽车ECU程序的ECU程序刷写方法以及装置。The technical problem to be solved by the present invention is to provide an ECU program flashing method and device for flashing multiple different hardware versions of automobile ECU programs by only configuring flashing software once.
为了解决上述技术问题,本发明采用的技术方案为:In order to solve the problems of the technologies described above, the technical solution adopted in the present invention is:
一种ECU程序刷写方法,包括A method for flashing an ECU program, comprising
与ECU建立通讯连接;Establish a communication connection with the ECU;
读取ECU硬件版本,依据ECU硬件版本查找对应的APP程序文件,并校验该程序文件是否符合要求;Read the ECU hardware version, find the corresponding APP program file according to the ECU hardware version, and verify whether the program file meets the requirements;
若符合要求,则ECU主动启动刷写流程,并反馈刷写结果;若成功则与ECU断开连接。If the requirements are met, the ECU will actively start the flashing process and feedback the flashing result; if it succeeds, it will disconnect from the ECU.
优选地,与ECU建立通讯连接时,若连接失败大于等于5次,则认为连接 出错,并报错同时确认是否有与ECU连接;Preferably, when establishing a communication connection with the ECU, if the connection failure is greater than or equal to 5 times, then it is considered that the connection is wrong, and an error is reported while confirming whether there is a connection with the ECU;
若与ECU建立通讯连接时,连接次数在5次之内失败,则尝试重新建立连接。If the connection fails within 5 times when establishing a communication connection with the ECU, try to re-establish the connection.
优选地,反馈刷写结果,若成功则提示成功,若失败则报错同时确认是否有与ECU连接。Preferably, the flashing result is fed back. If it succeeds, it will prompt success, and if it fails, it will report an error and confirm whether it is connected to the ECU.
优选地,所述ECU刷写流程包括Preferably, the ECU flashing process includes
读取ECU的刷写标志位,若ECU中无APP程序,则标志位内容为1;若有APP程序,则标志位内容为0;Read the flashing flag of the ECU. If there is no APP program in the ECU, the content of the flag is 1; if there is an APP program, the content of the flag is 0;
判断标志位内容,若为1则等待刷写装置指令;若为10,则无需刷写启动APP程序;Judging the content of the flag bit, if it is 1, wait for the command to flash the device; if it is 10, there is no need to flash and start the APP program;
判断外部指令是否为读硬件版本命令,是则读取ECU硬件版本,并回复刷写装置,等待下一个命令;Determine whether the external command is a command to read the hardware version, if so, read the ECU hardware version, and reply to the flashing device, waiting for the next command;
判断外部指令是否为刷写指令,是则进入刷写流程实现程序文件合法性验证、刷写工具合法性验证以及控制程序文件的正确传输;Judging whether the external command is a flashing command, if it is, enter the flashing process to realize the legality verification of the program file, the legality verification of the flashing tool, and the correct transmission of the control program file;
程序刷写成功后,清除刷写标志位,并跳转至刷写后的APP运行。After the program is successfully flashed, clear the flashing flag and jump to the running of the APP after flashing.
优选地,判断外部指令是否为读硬件版本命令,是则读取ECU硬件版本,并回复刷写装置,等待下一个命令;否则判断外部指令是否为刷写指令,是则进入刷写流程实现程序文件合法性验证、刷写工具合法性验证以及控制程序文件的正确传输,否则回复无法识别该指令。Preferably, it is judged whether the external command is a command to read the hardware version, and if so, the ECU hardware version is read, and the flashing device is returned, waiting for the next command; otherwise, it is judged whether the external command is a flashing command, and if so, it enters the flashing process to realize the program File legality verification, flashing tool legality verification, and correct transmission of control program files, otherwise the reply cannot recognize the command.
为了解决上述技术问题,本发明采用的另一技术方案为:In order to solve the above technical problems, another technical solution adopted by the present invention is:
一种ECU程序刷写装置,包括A kind of ECU program flashing device, comprising
第一通讯接口,与ECU建立通讯连接;The first communication interface establishes a communication connection with the ECU;
储存器,存储有多个硬件版本汽车ECU的程序;The memory stores the programs of the automobile ECU with multiple hardware versions;
处理器,通过第一通讯接口读取ECU硬件版本,依据ECU硬件版本查找储存器内对应的APP程序文件,并校验该程序文件是否符合要求;若符合要求,则指令ECU启动刷写流程,并反馈刷写结果;若成功则与ECU断开连接。The processor reads the ECU hardware version through the first communication interface, searches for the corresponding APP program file in the storage according to the ECU hardware version, and checks whether the program file meets the requirements; if it meets the requirements, instructs the ECU to start the flashing process, And feed back the flashing result; if successful, disconnect from the ECU.
优选地,还包括显示件;Preferably, a display part is also included;
与ECU建立通讯连接时,若连接失败大于等于5次,则认为连接出错,并 通过显示件报错同时确认是否有与ECU连接;When establishing a communication connection with the ECU, if the connection fails more than or equal to 5 times, it will be considered that the connection is wrong, and an error will be reported through the display and at the same time confirm whether there is a connection with the ECU;
若与ECU建立通讯连接时,连接次数在5次之内失败,则尝试重新建立连接。If the connection fails within 5 times when establishing a communication connection with the ECU, try to re-establish the connection.
优选地,反馈刷写结果,若成功则通过显示件提示成功,若失败则通过显示件报错同时确认是否有与ECU连接。Preferably, the flashing result is fed back. If successful, the display will prompt success, and if it fails, an error will be reported through the display and at the same time confirm whether there is a connection with the ECU.
优选地,还包括第二通讯接口,接收来自上位机的刷写软件,并存入存储器内。Preferably, it also includes a second communication interface for receiving flashing software from the host computer and storing it in the memory.
优选地,所述第一通讯接口、第二通讯接口为CAN、USB、串口、网口、GPIO中的一种或多种。Preferably, the first communication interface and the second communication interface are one or more of CAN, USB, serial port, network port, and GPIO.
本发明的有益效果在于:通过本申请的方法,不用频繁更改刷写软件的配置,实现不同硬件版本汽车ECU的程序刷写;可以只配置一次刷写软件,实现刷写多种不同硬件版本汽车ECU程序的方法;降低下线刷写程序的出错率,节省工作步骤,降低对下线操作人员的技术要求,提高生产效率。The beneficial effect of the present invention is: through the method of the present application, it is not necessary to frequently change the configuration of the flashing software to realize the program flashing of different hardware versions of automobile ECUs; the flashing software can be configured only once to realize the flashing of multiple different hardware versions of automobiles The method of ECU program; reduce the error rate of off-line brushing program, save work steps, reduce the technical requirements for off-line operators, and improve production efficiency.
附图说明Description of drawings
图1为本发明具体实施方式的一种ECU硬件设计图;Fig. 1 is a kind of ECU hardware design drawing of the embodiment of the present invention;
图2为本发明具体实施方式的一种ECU程序刷写装置与ECU硬件设计连接的示意图;Fig. 2 is the schematic diagram that a kind of ECU program flashing device of the embodiment of the present invention is connected with ECU hardware design;
图3为本发明具体实施方式的一种ECU程序刷写方法的流程示意图;Fig. 3 is the schematic flow sheet of a kind of ECU program brush writing method of the specific embodiment of the present invention;
图4为本发明具体实施方式的一种ECU程序刷写方法的ECU的流程示意图。FIG. 4 is a schematic flowchart of an ECU in a method for flashing an ECU program according to a specific embodiment of the present invention.
具体实施方式Detailed ways
为详细说明本发明的技术内容、所实现目的及效果,以下结合实施方式并配合附图予以说明。In order to describe the technical content, achieved goals and effects of the present invention in detail, the following descriptions will be made in conjunction with the embodiments and accompanying drawings.
实施例一Embodiment one
一种ECU程序刷写装置,用于汽车ECU进行程序刷写,其中A kind of ECU program flashing device, is used for automobile ECU to carry out program flashing, wherein
ECU程序刷写装置的功能:Functions of the ECU program flashing device:
输出电源给汽车ECU;Output power to automotive ECU;
与汽车ECU的CAN通讯;CAN communication with automotive ECU;
检测ECU上线;Detect ECU online;
刷写指示灯(显示件),指示忙闲;Flash indicator light (display piece), indicating busy or busy;
存储多个硬件版本汽车ECU的程序;Store programs for multiple hardware versions of automotive ECUs;
根据ECU不同硬件版本刷写相应程序;Write corresponding programs according to different hardware versions of ECU;
PC上位机可以配置硬件版本对应的ECU程序;The PC host computer can configure the ECU program corresponding to the hardware version;
汽车ECU应具备功能:Automotive ECU should have the following functions:
已刷写有bootloader程序,支持CAN总线(或者其他线路)程序刷写;The bootloader program has been flashed, and the CAN bus (or other lines) program flashing is supported;
bootloader支持硬件版本读取;The bootloader supports hardware version reading;
硬件设计了ECU硬件版本电路;硬件版本设计电路参考图1的汽车ECU硬件设计。The ECU hardware version circuit is designed for hardware; the hardware version design circuit refers to the automotive ECU hardware design in Figure 1.
以图1为例,可以对其中的硬件版本进行进行定义;定义内容如下表:Taking Figure 1 as an example, the hardware version can be defined; the definition is as follows:
Figure PCTCN2022099857-appb-000001
Figure PCTCN2022099857-appb-000001
使用时ECU程序刷写装置与ECU的物理连接图可以参照图2。Refer to Figure 2 for the physical connection diagram between the ECU program flashing device and the ECU during use.
实施例二Embodiment two
一种实施例一的ECU程序刷写装置的ECU程序刷写方法,An ECU program brushing method of the ECU program brushing device of Embodiment 1,
参照图3,其中ECU程序刷写装置部分包括:Referring to Fig. 3, wherein the ECU program flashing device part includes:
上电启动,程序初始化;Power on and start, program initialization;
通过GPIO输入电路检测是否有ECU连接,GPIO输入默认状态为低电平,当有ECU连接时为高电平;Detect whether there is an ECU connection through the GPIO input circuit. The default state of the GPIO input is low level, and it is high level when there is an ECU connection;
检测有ECU连接后,通过CAN总线与ECU建立通讯连接;主动建立通讯连接失败5次,则认为出错,通过指示灯(显示件)报错;After detecting that there is an ECU connection, establish a communication connection with the ECU through the CAN bus; if the initiative to establish a communication connection fails 5 times, it will be considered an error, and an error will be reported through the indicator light (display);
建立连接成功后,读取汽车ECU硬件版本,并依据硬件版本查找该版本对应的APP程序文件,并校验该程序文件的完整性及有效性;After the connection is successfully established, read the hardware version of the car ECU, and search for the APP program file corresponding to the version according to the hardware version, and verify the integrity and validity of the program file;
确定好升级文件之后,启动ECU刷写流程,该流程实现文件正确的传输给汽车ECU,并控制汽车ECU刷写成功,并反馈刷写结果。After confirming the upgrade file, start the ECU flashing process. This process realizes the correct transmission of the file to the car ECU, and controls the success of the car ECU flashing, and feedbacks the flashing result.
刷写流程反馈刷写成功后,通过指示灯指示成功;如反馈刷写失败,则通过指示灯报错;After the flashing process feedbacks that the flashing is successful, the success will be indicated by the indicator light; if the flashing fails in the feedback, an error will be reported through the indicator light;
刷写成功,指示灯指示成功后,则断开刷写装置与汽车ECU连接,更换下一个汽车ECU进行刷写;After the flashing is successful and the indicator light indicates success, disconnect the flashing device from the car ECU, and replace the next car ECU to flash;
等待另一个汽车ECU连接,重复以上刷写过程。Wait for another car ECU to connect, and repeat the above flashing process.
参照图4,其中汽车ECU Bootloader程序流程:Referring to Figure 4, the program flow of the automotive ECU Bootloader:
上电启动,程序初始化;Power on and start, program initialization;
读ECU的刷写标志位,如果ECU中无APP程序,该位置1;如果有APP程序,但该位也可被APP的刷写流程置位;Read the flashing flag of the ECU, if there is no APP program in the ECU, this bit is 1; if there is an APP program, but this bit can also be set by the flashing process of the APP;
判断该刷写标志位如为1,则等待刷写装置指令;如果该位为零,无需刷写启动APP程序;Judging that if the flashing flag is 1, wait for the flashing device command; if the bit is zero, there is no need to flash to start the APP program;
判断外部指令是读硬件版本命令,则读取GPIO输入的硬件版本,并回复刷写装置,等待下一个命令;Judging that the external command is a command to read the hardware version, then read the hardware version input by the GPIO, and reply to the flashing device, waiting for the next command;
判断外部指令是刷写指令,则进入刷写流程;该刷写流程实现程序文件合法性验证,刷写工具合法性验证,控制程序文件的正确传输;Judging that the external command is a flashing command, enter the flashing process; the flashing process realizes the legality verification of the program file, the legality verification of the flashing tool, and controls the correct transmission of the program file;
程序刷写成功后,清除刷写标志位,并跳转至刷写后的APP运行。After the program is successfully flashed, clear the flashing flag and jump to the running of the APP after flashing.
综上,本发明公开了一种方法,更新一次刷写软件配置,实现不同硬件版本ECU的程序刷写;To sum up, the present invention discloses a method for updating the flashing software configuration once to realize the program flashing of ECUs with different hardware versions;
刷写程序可以是PC上位机软件,也可以是手持设备软件,需要能够进行数据通讯,如CAN,USB,串口等;The flashing program can be PC host computer software or handheld device software, which needs to be able to perform data communication, such as CAN, USB, serial port, etc.;
汽车ECU一般都会存在CAN通讯链路,输入输出IO管脚;Automotive ECUs generally have CAN communication links, input and output IO pins;
汽车ECU硬件设计时,需要通过MCU的多路GPIO的上下拉电阻实现不同硬件版本定义,MCU程序识别并可以输出自身硬件版本。When designing automotive ECU hardware, it is necessary to implement different hardware version definitions through the pull-down resistors of the multi-channel GPIO of the MCU, and the MCU program can recognize and output its own hardware version.
汽车ECU通过刷写装置和刷写软件进行ECU应用软件的刷写;The automotive ECU flashes the ECU application software through the flashing device and flashing software;
刷写装置能够给ECU供电,并能检测到ECU在线;The flashing device can supply power to the ECU and detect that the ECU is online;
刷写装置具有与汽车ECU通讯的CAN通讯接口;The flashing device has a CAN communication interface for communicating with the automotive ECU;
刷写软件可以在刷写装置中,也可以在PC上位机;The flashing software can be in the flashing device or on the PC host computer;
但如果在PC上位机,刷写装置需要有与PC软件通讯的接口,如CAN,USB,串口,网口等。But if it is on the PC host computer, the flashing device needs to have an interface to communicate with the PC software, such as CAN, USB, serial port, network port, etc.
汽车ECU主动获取程序数据,授权,校验并升级的boot程序。Automotive ECU actively obtains program data, authorizes, verifies and upgrades the boot program.
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等同变换,或直接或间接运用在相关的技术领域,均同理包括在本发明的专利保护范围内。The above description is only an embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent transformations made by using the description of the present invention and the contents of the accompanying drawings, or directly or indirectly used in related technical fields, are all included in the same principle. Within the scope of patent protection of the present invention.

Claims (10)

  1. 一种ECU程序刷写方法,其特征在于,包括:A method for flashing an ECU program, comprising:
    与ECU建立通讯连接;Establish a communication connection with the ECU;
    读取ECU硬件版本,依据所述ECU硬件版本查找对应的APP程序文件,并校验该程序文件是否符合要求;Read the ECU hardware version, search for the corresponding APP program file according to the ECU hardware version, and check whether the program file meets the requirements;
    若所述程序文件符合要求,则ECU主动启动刷写流程,并反馈刷写结果;若刷写成功则与ECU断开连接。If the program file meets the requirements, the ECU actively starts the flashing process and feeds back the flashing result; if the flashing is successful, it disconnects from the ECU.
  2. 根据权利要求1所述的ECU程序刷写方法,其特征在于,与ECU建立通讯连接时,若连接失败大于或等于5次,则认为连接出错,并报错同时确认是否有与ECU连接;The ECU program flashing method according to claim 1, wherein when establishing a communication connection with the ECU, if the connection failure is greater than or equal to 5 times, it is considered that the connection is wrong, and an error is reported while confirming whether there is a connection with the ECU;
    若与ECU建立通讯连接时,连接次数在5次之内失败,则尝试重新建立连接。If the connection fails within 5 times when establishing a communication connection with the ECU, try to re-establish the connection.
  3. 根据权利要求1所述的ECU程序刷写方法,其特征在于,反馈刷写结果,若刷写成功则提示成功,若刷写失败则报错同时确认是否有与ECU连接。The method for flashing an ECU program according to claim 1, wherein the flashing result is fed back, and if the flashing is successful, it prompts success, and if the flashing fails, an error is reported and at the same time, it is confirmed whether there is a connection with the ECU.
  4. 根据权利要求1所述的ECU程序刷写方法,其特征在于,所述ECU刷写流程包括:The ECU program flashing method according to claim 1, wherein the ECU flashing process comprises:
    读取ECU的刷写标志位,若ECU中无APP程序,则标志位内容为1;若有APP程序,则标志位内容为0;Read the flashing flag of the ECU. If there is no APP program in the ECU, the content of the flag is 1; if there is an APP program, the content of the flag is 0;
    判断所述标志位内容,若为1则等待刷写装置指令;若为10,则无需刷写并启动APP程序;Judging the content of the flag bit, if it is 1, then wait for the flashing device instruction; if it is 10, then there is no need to flash and start the APP program;
    判断外部指令是否为读硬件版本命令,是则读取ECU硬件版本,并回复刷写装置,等待下一个命令;Determine whether the external command is a command to read the hardware version, if so, read the ECU hardware version, and reply to the flashing device, waiting for the next command;
    判断外部指令是否为刷写指令,是则进入刷写流程实现程序文件合法性验证、刷写工具合法性验证以及控制程序文件的正确传输;Judging whether the external command is a flashing command, if it is, enter the flashing process to realize the legality verification of the program file, the legality verification of the flashing tool, and the correct transmission of the control program file;
    程序刷写成功后,清除所述刷写标志位,并跳转至刷写后的APP程序运行。After the program is successfully flashed, clear the flash flag, and jump to the running of the APP program after flashing.
  5. 根据权利要求4所述的ECU程序刷写方法,其特征在于,判断外部指令是否为读硬件版本命令,是则读取ECU硬件版本,并回复刷写装置,等待下一个命令;否则判断外部指令是否为刷写指令,是则进入刷写流程实现程序文件合法性验证、刷写工具合法性验证以及控制程序文件的正确传输,否则回复 无法识别该指令。The ECU program flashing method according to claim 4, characterized in that, it is judged whether the external command is a command to read the hardware version, if so, the ECU hardware version is read, and the flashing device is returned, waiting for the next command; otherwise, the external command is judged Whether it is a flashing command, if it is, enter the flashing process to realize the legality verification of the program file, the legality verification of the flashing tool and the correct transmission of the control program file, otherwise the reply cannot recognize the command.
  6. 一种ECU程序刷写装置,其特征在于,包括:A device for flashing an ECU program, characterized in that it comprises:
    第一通讯接口,与ECU建立通讯连接;The first communication interface establishes a communication connection with the ECU;
    储存器,存储有多个硬件版本汽车ECU的APP程序文件;The memory stores the APP program files of the automobile ECU with multiple hardware versions;
    处理器,通过所述第一通讯接口读取ECU硬件版本,依据ECU硬件版本查找储存器内对应的APP程序文件,并校验该程序文件是否符合要求;若符合要求,则指令ECU启动刷写流程,并反馈刷写结果;若刷写成功则与ECU断开连接。The processor reads the ECU hardware version through the first communication interface, searches for the corresponding APP program file in the storage according to the ECU hardware version, and checks whether the program file meets the requirements; if it meets the requirements, then instructs the ECU to start flashing process, and feedback the flashing result; if the flashing is successful, it will be disconnected from the ECU.
  7. 根据权利要求6所述的ECU程序刷写装置,其特征在于,还包括显示件;The ECU program flashing device according to claim 6, further comprising a display part;
    与ECU建立通讯连接时,若连接失败大于或等于5次,则认为连接出错,并通过所述显示件报错同时确认是否有与ECU连接;When establishing a communication connection with the ECU, if the connection failure is greater than or equal to 5 times, it is considered that the connection is wrong, and an error is reported through the display and at the same time, it is confirmed whether there is a connection with the ECU;
    若与ECU建立通讯连接时,连接次数在5次之内失败,则尝试重新建立连接。If the connection fails within 5 times when establishing a communication connection with the ECU, try to re-establish the connection.
  8. 根据权利要求7所述的ECU程序刷写装置,其特征在于,反馈刷写结果,若刷写成功则通过所述显示件提示成功,若刷写失败则通过所述显示件报错同时确认是否有与ECU连接。The ECU program flashing device according to claim 7, wherein the flashing result is fed back, and if the flashing is successful, the display part prompts success, and if the flashing fails, the display part reports an error and confirms whether there is Connect with ECU.
  9. 根据权利要求6所述的ECU程序刷写装置,其特征在于,还包括第二通讯接口,接收来自上位机的刷写软件,并存入存储器内。The ECU program flashing device according to claim 6, further comprising a second communication interface for receiving the flashing software from the host computer and storing it in the memory.
  10. 根据权利要求9所述的ECU程序刷写装置,其特征在于,所述第一通讯接口、第二通讯接口为CAN、USB、串口、网口、GPIO中的一种或多种。The ECU program flashing device according to claim 9, wherein the first communication interface and the second communication interface are one or more of CAN, USB, serial port, network port, and GPIO.
PCT/CN2022/099857 2021-09-27 2022-06-20 Ecu program-flashing method and apparatus WO2023045440A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111135228.8 2021-09-27
CN202111135228.8A CN113760334A (en) 2021-09-27 2021-09-27 ECU program flashing method and device

Publications (1)

Publication Number Publication Date
WO2023045440A1 true WO2023045440A1 (en) 2023-03-30

Family

ID=78797691

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099857 WO2023045440A1 (en) 2021-09-27 2022-06-20 Ecu program-flashing method and apparatus

Country Status (2)

Country Link
CN (1) CN113760334A (en)
WO (1) WO2023045440A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117744389A (en) * 2023-12-25 2024-03-22 广州虹科电子科技有限公司 ECU simulation method

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760334A (en) * 2021-09-27 2021-12-07 北京国家新能源汽车技术创新中心有限公司 ECU program flashing method and device
CN114281065A (en) * 2021-12-28 2022-04-05 深圳市元征科技股份有限公司 Electronic control unit flashing method and device for vehicle and diagnostic equipment
CN114488997B (en) * 2021-12-28 2024-05-10 深圳市元征科技股份有限公司 ECU (electronic control Unit) refreshing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874055A (en) * 2017-03-07 2017-06-20 上海怿星电子科技有限公司 A kind of method and apparatus for writing with a brush dipped in Chinese ink test automatically for automobile ECU program
CN110806894A (en) * 2019-10-31 2020-02-18 安徽江淮汽车集团股份有限公司 Automobile part software version management method, equipment, storage medium and device
US20200272448A1 (en) * 2017-09-25 2020-08-27 Thyssenkrupp Presta Ag Method for remote online software update in motor vehicles
CN113010200A (en) * 2021-03-23 2021-06-22 深圳市元征科技股份有限公司 Flash method, flash system, flash device and server
CN113760334A (en) * 2021-09-27 2021-12-07 北京国家新能源汽车技术创新中心有限公司 ECU program flashing method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103412561B (en) * 2013-08-08 2016-12-28 奇瑞汽车股份有限公司 A kind of method for refreshing of automobile controller
CN107450953B (en) * 2017-08-01 2020-08-04 合肥联宝信息技术有限公司 Method and device for updating BIOS
CN107577220A (en) * 2017-09-01 2018-01-12 潍柴动力股份有限公司 A kind of restorative procedure of program, device and electronic equipment
CN109189422A (en) * 2018-08-13 2019-01-11 北京新能源汽车股份有限公司 Remote upgrading method and device for electronic control unit
CN111538511B (en) * 2020-04-02 2022-07-05 国电南瑞南京控制***有限公司 Battery pack BMS software automatic flashing system and method
CN112506535B (en) * 2020-05-22 2023-06-27 上海擎度汽车科技有限公司 Method for updating and upgrading Bootloader software of automobile ECU controller
CN113031974A (en) * 2021-03-18 2021-06-25 重庆青山工业有限责任公司 Software flashing method for transmission control unit
CN113010191A (en) * 2021-03-31 2021-06-22 东风商用车有限公司 Integrated vehicle ECU flashing method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874055A (en) * 2017-03-07 2017-06-20 上海怿星电子科技有限公司 A kind of method and apparatus for writing with a brush dipped in Chinese ink test automatically for automobile ECU program
US20200272448A1 (en) * 2017-09-25 2020-08-27 Thyssenkrupp Presta Ag Method for remote online software update in motor vehicles
CN110806894A (en) * 2019-10-31 2020-02-18 安徽江淮汽车集团股份有限公司 Automobile part software version management method, equipment, storage medium and device
CN113010200A (en) * 2021-03-23 2021-06-22 深圳市元征科技股份有限公司 Flash method, flash system, flash device and server
CN113760334A (en) * 2021-09-27 2021-12-07 北京国家新能源汽车技术创新中心有限公司 ECU program flashing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117744389A (en) * 2023-12-25 2024-03-22 广州虹科电子科技有限公司 ECU simulation method

Also Published As

Publication number Publication date
CN113760334A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
WO2023045440A1 (en) Ecu program-flashing method and apparatus
US9563442B2 (en) Baseboard management controller and method of loading firmware
WO2021212948A1 (en) Storage system boot method and apparatus, and computer-readable storage medium
CN100383737C (en) SCM online loading and updating method and system
CN102426531A (en) Intelligent terminal and application program updating system and method
CN106201563A (en) The method and apparatus that the collocation method of start-up parameter and device, mainboard start
CN106897088A (en) Software update system and method for upgrading software
CN114860279B (en) Rapid empty-chip upgrading method
WO2023077826A1 (en) System repair method for all-in-one machine, system, device and storage medium
CN104133743B (en) A kind of by burning file to the method for EMMC chip and device
US6904484B1 (en) Low pin count (LPC) firmware hub recovery
CN117519749A (en) STM32 online upgrading function solving method
US20190286544A1 (en) Method, device and server for checking a defective function
CN112306536B (en) Main board, chip thereof and chip upgrading method
CN1427338A (en) System starting up self examination device and method
CN115437668A (en) Development and design method and system for tool for batch production of SSD
CN113377425B (en) BMC firmware generation method and device, BMC starting method and device and storage medium
CN112181526B (en) Equipment starting method and device
CN113590148A (en) Method for upgrading secondary system program on line
CN111459406B (en) Method and system for identifying NVME hard disk under storage unloading card
CN205750768U (en) A kind of EMMC update device and terminal
CN112748943A (en) Upgrading method and upgrading system for non-intelligent interactive electronic whiteboard
CN111522573B (en) Txt file-based online servo program upgrading method
CN113411416B (en) Writing method and writing system for MAC address of control network chip
US8656227B2 (en) On-line client service method for storage apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22871501

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE