CN113127043A - Method for upgrading BootLoader on line by using single chip microcomputer APP - Google Patents

Method for upgrading BootLoader on line by using single chip microcomputer APP Download PDF

Info

Publication number
CN113127043A
CN113127043A CN202110294216.3A CN202110294216A CN113127043A CN 113127043 A CN113127043 A CN 113127043A CN 202110294216 A CN202110294216 A CN 202110294216A CN 113127043 A CN113127043 A CN 113127043A
Authority
CN
China
Prior art keywords
bootloader
program
app
area
upgrading
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.)
Pending
Application number
CN202110294216.3A
Other languages
Chinese (zh)
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.)
Ligo Shandong New Energy Technology Co ltd
Original Assignee
Ligo Shandong New Energy Technology 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 Ligo Shandong New Energy Technology Co ltd filed Critical Ligo Shandong New Energy Technology Co ltd
Priority to CN202110294216.3A priority Critical patent/CN113127043A/en
Publication of CN113127043A publication Critical patent/CN113127043A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Abstract

The invention relates to a method for upgrading BootLoader on line by a singlechip APP, which comprises the following steps: 1) adding a jump area at the entry address of the singlechip program, wherein the jump area is internally provided with a BootLoader jump-in address and an APP jump-in address, the BootLoader area is arranged behind the jump area, and the APP area is arranged behind the BootLoader area; 2) and after the single chip microcomputer is electrified, entering a jump area from a program entry address, judging whether the BootLoader program is effective, and directly jumping into the BootLoader program if the BootLoader program is effective. The method for upgrading the BootLoader on line by the single chip microcomputer APP solves the problem of upgrading failure caused by unexpected power failure for some reasons when the BootLoader is upgraded by the APP, the battery management system can still enter the App to execute a battery management function and retry to download the BootLoader program when being electrified again, the battery management system does not need to be taken out by disassembling a battery pack, and the debugging efficiency of the whole vehicle is improved.

Description

Method for upgrading BootLoader on line by using single chip microcomputer APP
Technical Field
The invention belongs to the field of electric vehicle battery management systems, and particularly relates to a method for upgrading BootLoader on line by using a single chip microcomputer APP.
Background
The battery management system is arranged in a battery pack of the electric vehicle, an external interface of the battery pack is a CAN communication interface, and the APP program needs to be upgraded by CAN communication, so that software of the battery management system comprises two software components, one is a BootLoader program (used for upgrading the APP on line) with a UDS protocol (CAN communication), and the other is an App program (used for realizing the function of the battery management system); under a normal condition, a BootLoader program is distributed in a Flash area of an inlet address of a single chip microcomputer and needs to be downloaded by using a tool PE or JTAG, and an App program is distributed behind the BootLoader area and needs to be downloaded or upgraded by the BootLoader.
Because all electronic parts in the field of electric vehicles need to develop a BootLoader program according to a UDS protocol of a whole vehicle factory, specific upgrading processes of different whole vehicle factories or vehicle types are different, and a battery management system needs to develop the BootLoader program according to requirements respectively. The battery management system is arranged in the battery pack, and once the Bootloader program has a BUG in the whole vehicle debugging stage, the battery pack needs to be disassembled and the Bootloader program needs to be updated again through PE or JTAG, so that the efficiency is extremely low, and the debugging speed is influenced. At present, only one starting address of a single chip microcomputer is usually provided, a bootloader program is just in an entrance address area, if the bootloader is simply upgraded through an APP, once the upgrade fails due to unexpected power failure for some reasons, an effective program of the entrance address cannot be found when a battery management system is powered on again, the whole power system is paralyzed, and the refreshing cannot be attempted again.
Disclosure of Invention
The invention aims to solve the problems and provide a method for upgrading a BootLoader on line by a single chip microcomputer APP.
The invention realizes the purpose through the following technical scheme:
a method for upgrading BootLoaders on line by a single chip microcomputer APP is characterized in that the single chip microcomputer is applied to a battery management system, contains a BootLoader program and an APP program which have a UDS protocol and CAN communication and are respectively distributed in a BootLoader area and an APP area, and comprises the following steps:
1) adding a jump area at the entry address of the singlechip program, wherein the jump area is internally provided with a BootLoader jump-in address and an APP jump-in address, the BootLoader area is arranged behind the jump area, and the APP area is arranged behind the BootLoader area;
2) and after the single chip microcomputer is electrified, entering a jump area from a program entry address, and judging whether the BootLoader program is effective or not, if the BootLoader program is effective, directly jumping into the BootLoader program, and if the BootLoader program is ineffective, jumping into the APP program and upgrading the BootLoader program through the APP program.
As a further optimization scheme of the present invention, the process of upgrading the BootLoader program by the APP program specifically includes the following steps:
s1, receiving an upgrading command from CAN communication;
and S2, erasing a BootLoader program in the BootLoader area, and downloading BootLoader codes again through CAN communication to write the BootLoader codes into the BootLoader area.
As a further optimization scheme of the present invention, after the BootLoader program is determined to be valid in step 2) and the BootLoader program is skipped, the BootLoader program is used to determine whether the APP program needs to be updated, if so, the APP program in the APP area is erased according to the UDS protocol, then the updated APP program is downloaded again through the CAN communication and written into the APP area, otherwise, the BootLoader program is determined to be valid, if so, the APP program is skipped to, otherwise, the APP program is erased, and the APP program is downloaded again through the CAN communication and written into the APP area.
The invention has the beneficial effects that:
1) the method can update and upgrade the BootLoader through the APP, when the BootLoader program has problems, the battery pack does not need to be dismounted, and the BootLoader program is updated through the PE or JTAG, so that the BootLoader program can be updated and upgraded more efficiently, and the debugging speed is higher and the debugging is safer;
2) the method and the device solve the problem of upgrading failure caused by unexpected power failure of some reasons when the BootLoader is upgraded by the APP, the battery management system can still enter the App to execute a battery management function and retry to download the BootLoader program when being electrified again, a battery pack does not need to be disassembled to take out the battery management system, and the debugging efficiency of the whole vehicle is improved.
Drawings
FIG. 1 is a schematic view of a Flah partition of a single chip microcomputer of the invention;
FIG. 2 is a flowchart of the APP upgrading BootLoader of the present invention;
fig. 3 is a flowchart of BootLoader upgrade APP in the prior art.
Detailed Description
The present application will now be described in further detail with reference to the drawings, it should be noted that the following detailed description is given for illustrative purposes only and is not to be construed as limiting the scope of the present application, as those skilled in the art will be able to make numerous insubstantial modifications and adaptations to the present application based on the above disclosure.
Example 1
As shown in fig. 3, the single chip microcomputer is applied to the battery management system, and the single chip microcomputer includes a BootLoader program and an APP program having a UDS protocol and CAN communication and respectively distributed in a BootLoader area and an APP area, where the BootLoader program is used for online upgrading the APP program, and the APP program is used for implementing the function of the battery management system, and in general, the BootLoader program is distributed in a Flash area of an entry address of the single chip microcomputer, and needs to be downloaded using a tool PE or JTAG, and the APP program is distributed behind the BootLoader area and needs to be downloaded or upgraded through the BootLoader.
Because the single-chip microcomputer starting address is only one usually, after the battery management system is powered on, the BootLoader program is firstly entered, then whether the App needs to be upgraded or not is judged, if the App program is not needed, whether the App program is effective or not is checked, and then the App program is entered according to the effectiveness to execute the functions of the battery management system; if the App needs to be upgraded, the APP area code is erased and then the upgrading is carried out according to the UDS protocol.
The BootLoader code has a single function, but is difficult to avoid causing problems, once the problems are found according to the existing scheme, the battery pack needs to be dismantled, the battery management system is taken out, and the BootLoader code is updated through PE or JTAG, so that the efficiency is extremely low, and the debugging speed of the whole vehicle is influenced.
As shown in fig. 1-2, a method for upgrading BootLoader online by a single chip microcomputer APP includes the following steps:
1) adding a jump area at the entry address of the singlechip program, wherein the jump area is internally provided with a BootLoader jump-in address and an APP jump-in address, the BootLoader area is arranged behind the jump area, and the APP area is arranged behind the BootLoader area; the jump area is distributed at the program entrance of the single chip microcomputer and singly occupies a sector by adding the jump area at the starting address of the single chip microcomputer, so that the function that the single chip microcomputer has a plurality of entrance addresses is realized;
2) and after the single chip microcomputer is electrified, entering a jump area from a program entry address, and judging whether the BootLoader program is effective or not, if the BootLoader program is effective, directly jumping into the BootLoader program, and if the BootLoader program is ineffective, jumping into the APP program and upgrading the BootLoader program through the APP program.
The process of upgrading the BootLoader program through the APP program specifically comprises the following steps:
s1, receiving an upgrading command from CAN communication;
and S2, erasing a BootLoader program in the BootLoader area, and downloading BootLoader codes again through CAN communication to write the BootLoader codes into the BootLoader area.
After the BootLoader program is judged to be effective in the step 2) and is jumped into the BootLoader program, whether the APP program needs to be upgraded is judged through the BootLoader program, if yes, the APP program in the APP area is erased according to a UDS protocol, then the upgraded APP program is downloaded again through CAN communication and is written into the APP area, otherwise, whether the APP program is effective is judged, if yes, the APP program is jumped to, and if not, the APP program is erased, and the APP program is downloaded again through CAN communication and is written into the APP area.
Can update the upgrading to BootLoader through APP, when BootLoader program goes wrong, need not to tear down the battery package and update BootLoader program through PE or JTAG, can update the upgrading to BootLoader program more efficiently, debug speed is faster and safer, and because of some reasons like the unexpected failure problem that falls electric and lead to when having solved APP upgrading BootLoader, still can get into the App when battery management system is electrified again and carry out the battery management function and retry and download BootLoader program, need not to unpack the battery package apart and take out the battery management system, whole car debugging efficiency has been improved.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention.

Claims (3)

1. A method for upgrading BootLoaders on line by a single chip microcomputer APP is characterized in that the single chip microcomputer is applied to a battery management system, contains a BootLoader program and an APP program which have a UDS protocol and CAN communication and are respectively distributed in a BootLoader area and an APP area, and comprises the following steps:
1) adding a jump area at the entry address of the singlechip program, wherein the jump area is internally provided with a BootLoader jump-in address and an APP jump-in address, the BootLoader area is arranged behind the jump area, and the APP area is arranged behind the BootLoader area;
2) and after the single chip microcomputer is electrified, entering a jump area from a program entry address, and judging whether the BootLoader program is effective or not, if the BootLoader program is effective, directly jumping into the BootLoader program, and if the BootLoader program is ineffective, jumping into the APP program and upgrading the BootLoader program through the APP program.
2. The method for upgrading the BootLoader on line by the single chip microcomputer APP as claimed in claim 1, wherein the process of upgrading the BootLoader program by the APP program specifically includes the following steps:
s1, receiving an upgrading command from CAN communication;
and S2, erasing a BootLoader program in the BootLoader area, and downloading BootLoader codes again through CAN communication to write the BootLoader codes into the BootLoader area.
3. The method for the on-line upgrading of the BootLoader by the single chip microcomputer APP as claimed in claim 1, wherein: and 2) after judging that the BootLoader program is effective and jumping into the BootLoader program in the step 2), judging whether the APP program needs to be upgraded through the BootLoader program, if so, erasing the APP program in the APP area according to a UDS protocol, then downloading the upgraded APP program again through CAN communication and writing the APP area, otherwise, judging whether the APP program is effective, if so, jumping to the APP program, otherwise, erasing the APP program, downloading the APP program again through CAN communication and writing the APP area.
CN202110294216.3A 2021-03-19 2021-03-19 Method for upgrading BootLoader on line by using single chip microcomputer APP Pending CN113127043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110294216.3A CN113127043A (en) 2021-03-19 2021-03-19 Method for upgrading BootLoader on line by using single chip microcomputer APP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110294216.3A CN113127043A (en) 2021-03-19 2021-03-19 Method for upgrading BootLoader on line by using single chip microcomputer APP

Publications (1)

Publication Number Publication Date
CN113127043A true CN113127043A (en) 2021-07-16

Family

ID=76773443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110294216.3A Pending CN113127043A (en) 2021-03-19 2021-03-19 Method for upgrading BootLoader on line by using single chip microcomputer APP

Country Status (1)

Country Link
CN (1) CN113127043A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116560696A (en) * 2023-06-20 2023-08-08 广东保伦电子股份有限公司 Singlechip partition with high application data duty ratio and firmware upgrading method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102053879A (en) * 2010-12-16 2011-05-11 国网电力科学研究院 Self-recovery real-time file system based on FLASH
WO2017186089A1 (en) * 2016-04-25 2017-11-02 广州路派电子科技有限公司 Method for upgrading files by vehicle-mounted decoder software
CN108664256A (en) * 2017-03-28 2018-10-16 宁德时代新能源科技股份有限公司 Firmware updating method and device of system and battery management system
CN110780910A (en) * 2019-10-29 2020-02-11 苏州长光华医生物医学工程有限公司 Method and system for updating software of lower computer and computer readable storage medium
CN111679839A (en) * 2020-06-09 2020-09-18 电子科技大学 On-line programming method of MCU FLASH
CN112506535A (en) * 2020-05-22 2021-03-16 上海擎度汽车科技有限公司 Method for updating Bootloader software by automobile ECU controller

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102053879A (en) * 2010-12-16 2011-05-11 国网电力科学研究院 Self-recovery real-time file system based on FLASH
WO2017186089A1 (en) * 2016-04-25 2017-11-02 广州路派电子科技有限公司 Method for upgrading files by vehicle-mounted decoder software
CN108664256A (en) * 2017-03-28 2018-10-16 宁德时代新能源科技股份有限公司 Firmware updating method and device of system and battery management system
CN110780910A (en) * 2019-10-29 2020-02-11 苏州长光华医生物医学工程有限公司 Method and system for updating software of lower computer and computer readable storage medium
CN112506535A (en) * 2020-05-22 2021-03-16 上海擎度汽车科技有限公司 Method for updating Bootloader software by automobile ECU controller
CN111679839A (en) * 2020-06-09 2020-09-18 电子科技大学 On-line programming method of MCU FLASH

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116560696A (en) * 2023-06-20 2023-08-08 广东保伦电子股份有限公司 Singlechip partition with high application data duty ratio and firmware upgrading method

Similar Documents

Publication Publication Date Title
CN103257880B (en) A kind of remote application online updating method based on DSP
CN103688268B (en) Vehicle unit and the method for operating vehicle unit
CN104102518B (en) double-CPU system and program upgrading method thereof
CN101615128B (en) Online upgrade method and device of singlechip
CN105573807A (en) ECU online program upgrading system and method based on CAN bus
CN103761112A (en) Vehicle-mounted multimedia device and control method thereof
CN106250196A (en) The method updating vehicle-mounted boot loader by CAN communication
CN107632862A (en) A kind of multistage start-up loading method of vehicle electronic control unit ECU
CN110825403A (en) Method and system for flashing ECU (electronic control Unit) of automobile
CN106020882A (en) Application upgrading method, intelligent terminal and upgrading system
CN104407878A (en) On-line upgrading method of C6000 digital signal processor
CN112698857A (en) Data flashing method and device
CN112540780A (en) System and method for realizing batch firmware upgrade of formation unmanned aerial vehicles
CN113127043A (en) Method for upgrading BootLoader on line by using single chip microcomputer APP
CN111459508B (en) BootLoader self-upgrading method and system
CN111414182B (en) SPI-based FPGA remote upgrading method
CN113190250A (en) Cabin software upgrading method, electronic equipment and readable storage medium
CN110908690A (en) CAN bus-based online upgrading method for multiple BMU application programs
CN111090443A (en) Method, equipment and storage medium for guaranteeing safe upgrade of linux system
CN105549965A (en) Method for integrating driver to different Linux kernel versions
CN202870806U (en) Remote update control system
CN113377404B (en) New energy vehicle domain controller safety monitoring chip program updating method and system
CN114996717A (en) Upgrade program design method for preventing error erasure
CN110609691A (en) Method for remotely updating DSP program
CN109947576A (en) A kind of method of virtual machine internal broker program management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination