Movatterモバイル変換


[0]ホーム

URL:


CN113176891B - Bootloader-based ECU (electronic control Unit) program programming method with backup function - Google Patents

Bootloader-based ECU (electronic control Unit) program programming method with backup function
Download PDF

Info

Publication number
CN113176891B
CN113176891BCN202110503902.7ACN202110503902ACN113176891BCN 113176891 BCN113176891 BCN 113176891BCN 202110503902 ACN202110503902 ACN 202110503902ACN 113176891 BCN113176891 BCN 113176891B
Authority
CN
China
Prior art keywords
program
programming
partition
bootloader
ecu
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110503902.7A
Other languages
Chinese (zh)
Other versions
CN113176891A (en
Inventor
刘略
穆林
孙磊磊
李中
方成
郝守刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changzhou Yikong Automotive Electronics Co ltd
Original Assignee
Changzhou Yikong Automotive Electronics Co ltd
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 Changzhou Yikong Automotive Electronics Co ltdfiledCriticalChangzhou Yikong Automotive Electronics Co ltd
Priority to CN202110503902.7ApriorityCriticalpatent/CN113176891B/en
Publication of CN113176891ApublicationCriticalpatent/CN113176891A/en
Application grantedgrantedCritical
Publication of CN113176891BpublicationCriticalpatent/CN113176891B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention provides a program programming method of an ECU with a backup function based on Bootloader, which comprises the following steps: step A1: the singlechip divides a program use area of FLASH in the singlechip into A, B sections; step A2: the Bootloader judges whether programs in the A, B area are complete after receiving the programming request, erases the area to be used as a programming area when the programs are incomplete, and takes the current inactive area as the programming area when the programs are complete; step A3, the ECU writes the program received from the outside into the programming partition, and sets the programming partition as an active partition; step A4: the ECU starts, and the Bootloader executes the currently active program; when an abnormality occurs, the Bootloader records the number of abnormalities, and when the number exceeds the limit value, the Bootloader turns to execute another program. The invention can automatically run the backup area program after the programming fails, and ensure the normal execution of the ECU function. After successful programming, the ECU may execute the previous version of the program.

Description

Bootloader-based ECU (electronic control Unit) program programming method with backup function
Technical Field
The invention relates to the field of automobile electronics, in particular to a program programming method of an ECU (electronic control Unit) with a backup function based on Bootloader.
Background
Bootlaoder is an indispensable software module in an electronic control unit (hereinafter referred to as ECU) of the automobile, and is responsible for guiding software start when the ECU is powered on. After the ECU leaves the controller supplier, the whole vehicle factory or the system integrator often needs to upgrade the software of the ECU in the development process, so the Bootloader generally has the function of upgrading the firmware of the ECU. When receiving the upgrade request, the ECU receives data from outside to upgrade the software.
After the ECU receives the software update request, flash data in the controller can be wiped out to be written. The upgrade data is typically transmitted to the ECU via LIN, CAN bus, ethernet, or the like. In the upgrading process, the transmission data may be lost, or even the upgrading process is interrupted accidentally, because the automobile is in some special working conditions or the user is operated improperly. When the situation occurs, the Bootloader needs to have a protection mechanism to ensure that the Bootloader can still continuously update the software of the controller after the upgrade fails. However, when the update is requested, the original program in the controller is erased, and the controller is in a state where normal functions cannot be executed and cannot be restored to a state before the update before the successful programming.
Disclosure of Invention
The invention aims to solve the problem that the original function cannot be normally executed after the software update of the prior art is failed and the problem that the prior art cannot roll back to the previous version after the software update is completed.
The invention realizes the above purpose through the following technical scheme:
a program programming method of an ECU with a backup function based on Bootloader comprises the following steps:
Step A1: the singlechip divides a program use area of FLASH in the singlechip into A, B sections;
Step A2: after receiving the programming request, the Bootloader firstly judges whether programs in the A, B partition are complete according to the check mark, and if the incomplete programs exist, the partition is erased to be used as the programming partition; when the programs are complete, selecting the current inactive partition as the current programming partition, and executing the step A3;
Step A3: after program erasure, the ECU writes the program received from the outside into the current programming partition, verifies the integrity of the program and the function after programming, records a time stamp after verification, and sets the current programming partition as an active partition to execute the step A4;
Step A4: when the ECU is normally started, the Bootloader guides the currently active program to execute; when the controller is abnormally reset during program execution, the Bootloader records the abnormal times, and when the times exceed the limit value, the Bootloader sets another partition as an active partition and executes a program before the new program is programmed into the singlechip.
The singlechip is a chip used for storing a new programming program in the controller.
The A, B partitions are two partitions which are completely consistent in size and structure and store programs, the two partitions are provided with two active partitions and inactive partitions, the addresses of the two partitions have a complete mapping relation, the two partitions can be used as backups, and the programs in the two partitions are provided with a time stamp and a check mark respectively.
The verification mark is placed in the program when the program is written, and the verification mark and the time stamp are used as the guiding basis of the Bootloader.
The programming partition is a partition storing a new programming program in the A, B partition.
The calculation formula of the limit value is n=rounded (2.5×p+1.6×q+3), where N is the limit value, P is the number of times that "if there is an incomplete program, erasing the partition as the current programming area", and Q is the number of times that "when the program is complete, the current inactive partition is selected as the current programming area".
Compared with the prior art, the invention has the following advantages:
1) The method can realize double backup of the ECU program, and ensure that the ECU can still execute the program before updating when programming or program execution is abnormal.
2) The method can enable the ECU program to be restored to the state before programming at any time.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a schematic diagram of a conventional Bootloader programming flow with a backup function;
FIG. 3 is a schematic diagram of a Bootloader with backup function, which can execute an original program after a programming failure.
Detailed Description
The present invention will now be described in detail with reference to the drawings and specific embodiments thereof, wherein it is apparent that the embodiments described are only some, but not all, of the embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, a program programming method of ECU with backup function based on Bootloader includes the following steps:
Step A1: the singlechip divides a program use area of FLASH in the singlechip into A, B sections;
When A, B is carried out, the A, B partition is partitioned into two partitions with completely consistent sizes and structures and storing programs, the two partitions are provided with two active partitions and inactive partitions, the addresses of the two partitions have a set of complete mapping relation, the two partitions can be used as backup, the programs stored in the two partitions are stored with a time stamp and a check mark, and the check mark and the time stamp are used as the guiding basis of the Bootloader together.
Step A2: after receiving the programming request, the Bootloader firstly judges whether programs in the A, B partition are complete according to the check mark, and if the incomplete programs exist, the partition is erased to be used as the programming partition; and when the programs are complete, selecting the current inactive partition as the current programming partition, and executing the step A3.
Step A3: after the program is erased, the ECU writes the program received from the outside into the current programming partition, after programming is completed, the program and the functional integrity are checked, a time stamp is recorded after the program passes the check, the current programming partition is set as an active partition to execute the step A4, and when the check is out of the specification, a warning is given, and a programming person checks the problem and rewrites the program.
Step A4: after the programming is normal, the ECU is started normally, and the Bootloader guides the currently active program to execute; when the controller is abnormally reset during program execution, the Bootloader records the abnormal times, when the times exceed the limit value, the Bootloader sets another partition as an active partition, executes a program before writing a new program into the singlechip, wherein the calculation formula of the limit value is n=round (2.5×p+1.6×q+3), wherein N is the limit value, P is the times when an incomplete program exists, the partition is erased as a current writing area, Q is the times when the program is complete, and the current inactive partition is selected as the current writing area.
When the ECU receives a rollback request, the Bootloader sets the other partition as an active partition to realize program rollback.
The invention provides a program programming method of an ECU with a backup function based on Bootloader, which has the beneficial effects that:
The dual-backup of the ECU program can be realized, and the ECU can still execute the program before updating when programming or program execution is abnormal. And can be restored to the state before programming at any time.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.

Claims (5)

CN202110503902.7A2021-05-102021-05-10Bootloader-based ECU (electronic control Unit) program programming method with backup functionActiveCN113176891B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110503902.7ACN113176891B (en)2021-05-102021-05-10Bootloader-based ECU (electronic control Unit) program programming method with backup function

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110503902.7ACN113176891B (en)2021-05-102021-05-10Bootloader-based ECU (electronic control Unit) program programming method with backup function

Publications (2)

Publication NumberPublication Date
CN113176891A CN113176891A (en)2021-07-27
CN113176891Btrue CN113176891B (en)2024-06-28

Family

ID=76928813

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110503902.7AActiveCN113176891B (en)2021-05-102021-05-10Bootloader-based ECU (electronic control Unit) program programming method with backup function

Country Status (1)

CountryLink
CN (1)CN113176891B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113986393B (en)*2021-11-012024-07-09北京经纬恒润科技股份有限公司Electronic control unit starting method and device
CN114545895A (en)*2022-01-192022-05-27阿尔特汽车技术股份有限公司Structure and method for preventing ECU software control failure

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102314369A (en)*2011-10-092012-01-11杭州先锋电子技术股份有限公司Self-upgrade method for equipment in remote online monitoring system
CN103744712A (en)*2014-01-282014-04-23北京经纬恒润科技有限公司Method and device for updating application program

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101650662B (en)*2009-08-262013-09-11中兴通讯股份有限公司Memory device of embedded system and staring method and upgrading of firmware
CN108376077A (en)*2018-02-112018-08-07广东美的厨房电器制造有限公司The upgrade method and device of control unit
CN109885322A (en)*2019-01-112019-06-14郑州嘉晨电器有限公司A kind of long-range programming system of intelligence instrument
CN110134415A (en)*2019-04-122019-08-16深圳市致宸信息科技有限公司A kind of controller and its method for upgrading software and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102314369A (en)*2011-10-092012-01-11杭州先锋电子技术股份有限公司Self-upgrade method for equipment in remote online monitoring system
CN103744712A (en)*2014-01-282014-04-23北京经纬恒润科技有限公司Method and device for updating application program

Also Published As

Publication numberPublication date
CN113176891A (en)2021-07-27

Similar Documents

PublicationPublication DateTitle
US7197613B2 (en)Nonvolatile memory
CN103299276B (en) Software Update Process for Embedded Devices
CN101650662B (en)Memory device of embedded system and staring method and upgrading of firmware
US8103403B2 (en)Vehicular memory management apparatus
CN102298545B (en)System startup boot processing method and device
US6430662B1 (en)Method and device for changing memory contents in a control unit, especially of a motor vehicle
US9110842B2 (en)Control device for vehicle and error processing method in control device for vehicle
CN113176891B (en)Bootloader-based ECU (electronic control Unit) program programming method with backup function
US8036786B2 (en)On-vehicle control apparatus
CN112015447B (en)System updating method and device of electronic equipment, electronic equipment and storage medium
CN101770372A (en)Firmware updating system, method and firmware constructing method of firmware updating system
CN114844874B (en)OTA manager, update control method, non-transitory storage medium, and vehicle
CN111506449A (en)Air conditioner parameter storage method and device and storage medium
CN116909611A (en)Electronic device firmware updating method, cleaning device and storage medium
CN117407020A (en)OTA upgrade refreshing method and device, electronic equipment and storage medium
CN106503542B (en) Anti-rewriting method, equipment and air conditioner for equipment parameters
KR101601751B1 (en)Ecu of vehicle and boot software re-programming method thereof
US11169828B2 (en)Electronic control unit and method for verifying control program
JP3805195B2 (en) Program rewriting apparatus and program rewriting method
CN117742763A (en)ECU firmware upgrading method, device, system, automobile and storage medium
JP2006018594A (en) Information processing device
KR20080042502A (en) Vehicle electronic control device and its control program setting method
JP7568572B2 (en) Surveillance equipment
CN117215604A (en)Software updating method and device, vehicle controller and readable storage medium
CN118626122A (en) A vehicle-mounted controller for engineering machinery and a program updating method thereof

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp