CN111309350A - Bootload updating method - Google Patents

Bootload updating method Download PDF

Info

Publication number
CN111309350A
CN111309350A CN201911413541.6A CN201911413541A CN111309350A CN 111309350 A CN111309350 A CN 111309350A CN 201911413541 A CN201911413541 A CN 201911413541A CN 111309350 A CN111309350 A CN 111309350A
Authority
CN
China
Prior art keywords
bootload
app
updating
program file
bootload2
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
CN201911413541.6A
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.)
Zhejiang Leapmotor Technology Co Ltd
Original Assignee
Zhejiang Leapmotor 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 Zhejiang Leapmotor Technology Co Ltd filed Critical Zhejiang Leapmotor Technology Co Ltd
Priority to CN201911413541.6A priority Critical patent/CN111309350A/en
Publication of CN111309350A publication Critical patent/CN111309350A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

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

Abstract

The invention discloses a method for updating bootload, which is suitable for a singlechip with a bootload program file stored therein, and comprises the following steps: loading the new bootload2 to the APP project to generate an APP _ bootload program file; writing the APP _ bootload program file into the single chip microcomputer and operating; the APP _ bootload program file erases the old bootload of the boot area, and then writes the data of bootload2 to complete the update of bootload. The bootload2 data are completely upgraded to the app area directly, and then the updating is carried out in the app, so that the time consumption of the updating process is short, the risk of 'changing bricks' in the process of direct updating is greatly reduced, and the risk of failure in upgrading is low. The substantial effects of the invention include: according to a standard upgrading mode, the app is upgraded on line firstly, and then bootload is updated in the app in an off-line mode, so that bootload updating becomes safer and more reliable, universality is strong, FLASH is used for replacing RAM (random access memory) to serve as an updating exchange area, a single chip microcomputer with small RAM is not limited, in addition, upgrading failure risk is low, and the upgrading is more flexible.

Description

Bootload updating method
Technical Field
The invention relates to the field of firmware upgrading of single-chip microcomputers, in particular to a bootload updating method.
Background
The program in the single chip microcomputer is divided into two parts, namely bootload and app, after the single chip microcomputer is powered on, the single chip microcomputer starts to execute from the bootload first, then jumps to the app, the bootload is written by a programmer, the app is written by an IAP technology, the IAP is programmed in the application, a special programmer interface is converted into a mode such as a serial port and a CAN to update the program, the bootload update app is a typical application, the program CAN only start to execute from the bootload due to the mechanism of the single chip microcomputer, and if the mechanism of the app is updated according to the general bootload, the bootload cannot be updated in the bootload. In some specific cases, bootload may need to be updated, and a programmer is needed to write the bootload, which is particularly inconvenient, and particularly, the disassembly of a certain single chip microcomputer is more troublesome when the single chip microcomputer is arranged in a sealed shell.
The prior art makes some improvements, for example, using RAM as a swap area, i.e. moving a bootload program into RAM for running, releasing a FLASH area storing the bootload, and then performing bootload update, but this approach has great limitations: the universality is poor, and the RAM of the single chip microcomputer has smaller space compared with the FLASH, so that some single chip microcomputers cannot be applied; the risk is large in the upgrading process, the upgrading process is a mode of online upgrading, the upgrading process is longer, the probability of power failure in the upgrading process is correspondingly increased, if the power failure occurs, the bootload of the single chip microcomputer is lost, the system cannot operate, and the updating can not be carried out in an IAP mode; the upgrading mode is not flexible enough, and the app part is not erased, so that the FLASH space in the whole single chip microcomputer cannot be divided again.
Also disclosed is a remote embedded firmware online upgrade method, as disclosed in publication No. CN 108958781A. However, in general, the prior art cannot meet the requirements of reliability and convenience in bootload update.
Disclosure of Invention
Aiming at the problems of unsatisfactory reliability and convenience in bootload updating in the prior art, the invention provides a bootload updating method.
The technical scheme of the invention is as follows.
A method for updating bootload is suitable for a single chip microcomputer storing bootload program files, and comprises the following steps: loading the new bootload2 to the APP project to generate an APP _ bootload program file; writing the APP _ bootload program file into the single chip microcomputer and operating; the APP _ bootload program file erases the old bootload of the boot area, and then writes the data of bootload2 to complete the update of bootload. The bootload2 data are completely upgraded to the app area directly, and then the updating is carried out in the app, so that the time consumption of the updating process is short, the risk of 'changing bricks' in the process of direct updating is greatly reduced, and the risk of failure in upgrading is low.
Preferably, the program file of bootload2 includes a bin, hex or mot format. These are all commonly used formats.
Preferably, the generation process of the APP _ bootload program file includes: converting the program file of bootload2 into a source code array form through a tool, loading the source code array form to the APP project, and compiling by a compiler to generate an APP _ bootload program file. The APP _ bootload program file is directly generated by the compiler, and compared with the direct program combination mode, the method can be uniformly applied to different single-chip microcomputers, and special APP and bootload operation is required to be combined when the addresses are inconsistent.
Preferably, the method further comprises erasing the data of the APP area after completing the updating of the bootload. Generally speaking, bootload needs to be updated rarely, once updating is usually accompanied with large requirement change, the whole FLASH storage area in the single chip microcomputer may need to be re-divided, and the upgrading mode can more flexibly re-divide the FLASH storage area by erasing the APP area, so that the upgrading mode is more flexible.
Preferably, the APP _ bootload program file is written by an IAP technique. The IAP Programming is to program the FLASH memory in the running process of the program of a user during application Programming, and aims to conveniently upgrade the firmware program of the product through a reserved communication interface after the product is released.
Preferably, the boot area and the APP area both exist in the FLASH, and the address of the boot area is located before the address of the APP area.
The substantial effects of the invention include: according to a standard upgrading mode, the app is upgraded on line firstly, and then bootload is updated in the app in an off-line mode, so that bootload updating becomes safer and more reliable, universality is strong, FLASH is used for replacing RAM (random access memory) to serve as an updating exchange area, a single chip microcomputer with small RAM is not limited, in addition, upgrading failure risk is low, and the upgrading is more flexible.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the details in the embodiments of the present application. In addition, numerous specific details are set forth below in order to provide a better understanding of the present invention. It will be understood by those skilled in the art that the present invention may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present invention.
Example (b):
a method for updating bootload is suitable for a single chip microcomputer storing bootload program files, and comprises the following steps: loading the new bootload2 to the APP project to generate an APP _ bootload program file; writing the APP _ bootload program file into the single chip microcomputer and operating; the APP _ bootload program file erases the old bootload of the boot area, and then writes the data of bootload2 to complete the update of bootload.
The embodiment specifically relates to: bootload 1: and the bootload needing to be updated is stored in the boot area in the singlechip. Bootload 2: the new bootload, exists in the form of firmware. APP _ bootload: the compiled output program is configured based on the firmware of the app, and Bootload2 firmware data is contained inside.
The bootload2 data are completely upgraded to the app area directly, and then the updating is carried out in the app, so that the time consumption of the updating process is short, the risk of 'changing bricks' in the process of direct updating is greatly reduced, and the risk of failure in upgrading is low.
Wherein the program file of bootload2 includes bin, hex or mot formats. These are all commonly used formats.
The generation process of the APP _ bootload program file comprises the following steps: converting the program file of bootload2 into a source code array form through a tool, loading the source code array form to the APP project, and compiling by a compiler to generate an APP _ bootload program file. The APP _ bootload program file is directly generated by the compiler, and compared with the direct program combination mode, the method can be uniformly applied to different single-chip microcomputers, and special APP and bootload operation is required to be combined when the addresses are inconsistent.
The embodiment further includes erasing the data in the APP area after completing updating of bootload. Generally speaking, bootload needs to be updated rarely, once updating is usually accompanied with large requirement change, the whole FLASH storage area in the single chip microcomputer may need to be re-divided, and the upgrading mode can more flexibly re-divide the FLASH storage area by erasing the APP area, so that the upgrading mode is more flexible.
The APP _ bootload program file is written by the IAP technology. In application programming, a user program writes a FLASH memory In the running process, and the aim is to conveniently upgrade a product firmware program through a reserved communication interface after a product is released.
The boot area and the APP area are both arranged in the FLASH, and the address of the boot area is positioned in front of the address of the APP area.
The embodiment is implemented in the form of a software functional unit and can be stored in a readable storage medium when being sold or used as a stand-alone product. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (6)

1. A method for updating bootload is suitable for a singlechip in which bootload program files are stored, and is characterized by comprising the following steps:
loading the new bootload2 to the APP project to generate an APP _ bootload program file;
writing the APP _ bootload program file into the single chip microcomputer and operating;
the APP _ bootload program file erases the old bootload of the boot area, and then writes the data of bootload2 to complete the update of bootload.
2. The method of claim 1, wherein the program file of bootload2 comprises bin, hex or mot format.
3. The method for updating bootload according to claim 1, wherein the generating process of the APP bootload program file includes: converting the program file of bootload2 into a source code array form through a tool, loading the source code array form to the APP project, and compiling by a compiler to generate an APP _ bootload program file.
4. A method for updating bootload according to claim 1, 2 or 3, further comprising erasing the data of the APP area after completing the updating of bootload.
5. A method for updating bootload according to claim 1, 2 or 3, wherein said APP _ bootload program file is written by IAP technique.
6. The method of claim 4, wherein the boot area and the APP area both exist in FLASH, and the address of the boot area precedes the address of the APP area.
CN201911413541.6A 2019-12-31 2019-12-31 Bootload updating method Pending CN111309350A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911413541.6A CN111309350A (en) 2019-12-31 2019-12-31 Bootload updating method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911413541.6A CN111309350A (en) 2019-12-31 2019-12-31 Bootload updating method

Publications (1)

Publication Number Publication Date
CN111309350A true CN111309350A (en) 2020-06-19

Family

ID=71148747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911413541.6A Pending CN111309350A (en) 2019-12-31 2019-12-31 Bootload updating method

Country Status (1)

Country Link
CN (1) CN111309350A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346770A (en) * 2020-11-10 2021-02-09 天津津航计算技术研究所 Embedded program online updating method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105204899A (en) * 2015-09-17 2015-12-30 浪潮软件集团有限公司 Realization of network-based singlechip firmware upgrading method
CN109408079A (en) * 2017-09-26 2019-03-01 广东电网有限责任公司江门供电局 A kind of embedded device and its upgrade method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105204899A (en) * 2015-09-17 2015-12-30 浪潮软件集团有限公司 Realization of network-based singlechip firmware upgrading method
CN109408079A (en) * 2017-09-26 2019-03-01 广东电网有限责任公司江门供电局 A kind of embedded device and its upgrade method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
HES_C: "stm32-BootLoader程序和app程序合并烧录", 《HTTPS://BLOG.CSDN.NET/HES_C/ARTICLE/DETAILS/89375283》 *
LEUNG_MANWAH: "NRF52832学习笔记(6)——OTA DFU接口使用", 《HTTPS://BLOG.CSDN.NET/QQ_36347513/ARTICLE/DETAILS/103744653》 *
张宇: ""基于TMS320DM642的Flash头文件烧写法的DSP二级BootLoader开发"", 《机电工程》 *
菜鸟程序员2: ""如何将一个二进制的xxx.bin文件轻松转为C语言数组"", 《HTTPS://WWW.SHUZHIDUO.COM/A/D854GRWPJE/》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346770A (en) * 2020-11-10 2021-02-09 天津津航计算技术研究所 Embedded program online updating method

Similar Documents

Publication Publication Date Title
CN110231952B (en) ECU program backup and cyclic upgrade control method and device
CN112506535B (en) Method for updating and upgrading Bootloader software of automobile ECU controller
EP1548602B1 (en) Non-volatile storage device control method
JP5173818B2 (en) Initializing flash storage via embedded controller
US20090089518A1 (en) Solid state storage reclamation apparatus and method
JP2002351685A (en) Data updating method and controller for nonvolatile memory
JP2010140266A (en) Electronic device system and electronic device
US20110252209A1 (en) Data access method and system, storage medium controller and storage system
CN104793891A (en) Data write-in method, memorizer control circuit unit and memorizer storage device
JP2008504628A (en) Safe flushing
CN114691178B (en) Firmware upgrading method and device based on EtherCAT communication driver
KR100746036B1 (en) Apparatus and method for controlling flash memory
CN111309350A (en) Bootload updating method
US20040049727A1 (en) Method and apparatus for allocating CRC codes in a flash ROM
CN110471675B (en) Program burning method, system, device and computer readable storage medium
CN110955442B (en) Bootloader suitable for PCI-E password card
CN112346770A (en) Embedded program online updating method
US10877743B2 (en) Control apparatus for updating stored program and method for updating program stored in control apparatus
CN102650971B (en) Memory managing method, memory controller and memory storing device
CN112073211B (en) DALI (digital addressable lighting interface) online upgrading method and system, computer equipment and readable storage medium
JP2001117766A (en) Information processor with patch function of mask rom
JP2009276883A (en) Semiconductor auxiliary storage device
US20060156297A1 (en) Method and device for modifying software in a control unit and corresponding control unit
JP4910402B2 (en) Nonvolatile memory rewriting device and rewriting method
US20050068842A1 (en) Electronic device, nonvolatile memory and method of overwriting data in nonvolatile memory

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
CB02 Change of applicant information

Address after: 310051 1st and 6th floors, no.451 Internet of things street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Zhejiang Zero run Technology Co.,Ltd.

Address before: 310051 1st and 6th floors, no.451 Internet of things street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: ZHEJIANG LEAPMOTOR TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20200619

RJ01 Rejection of invention patent application after publication