CN117032811A - Program starting method of embedded equipment - Google Patents

Program starting method of embedded equipment Download PDF

Info

Publication number
CN117032811A
CN117032811A CN202311092101.1A CN202311092101A CN117032811A CN 117032811 A CN117032811 A CN 117032811A CN 202311092101 A CN202311092101 A CN 202311092101A CN 117032811 A CN117032811 A CN 117032811A
Authority
CN
China
Prior art keywords
program
factory
application program
starting
boot loader
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
CN202311092101.1A
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.)
Beijing Institute of Computer Technology and Applications
Original Assignee
Beijing Institute of Computer Technology and Applications
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 Beijing Institute of Computer Technology and Applications filed Critical Beijing Institute of Computer Technology and Applications
Priority to CN202311092101.1A priority Critical patent/CN117032811A/en
Publication of CN117032811A publication Critical patent/CN117032811A/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
    • G06F9/4406Loading of operating system
    • G06F9/4408Boot device selection
    • 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/445Program loading or initiating
    • G06F9/44589Program code verification, e.g. Java bytecode verification, proof-carrying code

Abstract

The invention relates to a program starting method of embedded equipment, belonging to the field of embedded equipment. The embedded device of the present invention stores three programs: boot Loader program, factory program, and application program. After the device is started from the Boot Loader program, judging whether the program is guided to a factory program or an application program according to the flag bit stored in the Flash, checking the correctness of the program file, and reading the working program or the application program stored in the Flash to the address of the appointed memory space. The invention establishes a mechanism for storing two independent programs by one device. The factory program is responsible for receiving application program files sent by the external equipment and providing equipment information. For devices with smaller memory, the Boot Loader program controls the starting of two sets of programs, so that memory resources are saved.

Description

Program starting method of embedded equipment
Technical Field
The invention belongs to the field of embedded devices, and particularly relates to a program starting method of an embedded device.
Background
In the embedded device, the Boot Loader program is a program that is stored in the chip and that is first run during the chip start-up process. The program is used for initializing hardware and loading an operating system and completing loading and starting of the whole equipment. After the device is powered on, the chip starts a hardware Boot Loader program (namely a primary Boot) firstly, and then loads a software Boot Loader program (namely a secondary Boot, and the following Boot Loader programs refer to the software Boot Loader programs) from a 0X00000000 address of the internal memory Flash. Therefore, the program start of the embedded device can be completed by writing the entry of the Boot Loader program on the 0X00000000 address of Flash.
Under the scene that the function requirement is simple, no operating system exists and the application program is not required to be upgraded, a developer can combine the Boot Loader program and the application program into one program to be burnt into the device. When an application program needs to be upgraded, a developer usually stores a Boot Loader program and the application program separately, and the loading and running of the application program are controlled by the Boot Loader program. The specific method is that the Boot Loader program reads the data of the storage address of the application program in Flash, the data is put into the code segment address in the memory, and the end of the Boot Loader program points the program to the first address of the code segment application program, so that the program can continue to run from the application program.
The quantity of the code of the general Boot Loader is relatively small, and the Boot Loader is only used as a guide of an application program. The Boot Loader program and the application program are simultaneously stored in the internal Flash of the device. But in special cases, for safety reasons, the application is not present when the device is first used or is cleared during use, so that the application needs to be imported from an external device when the device is restarted. The amount of program codes interacted with external equipment is large, and the program codes are not suitable to be placed in a Boot Loader program, so that the program occupies excessive memory space. If the device only has Boot Loader programs and application programs, the device cannot meet special condition for use.
Disclosure of Invention
First, the technical problem to be solved
The invention aims to provide a program starting method of embedded equipment so as to solve the problem of starting the embedded equipment when no application program exists.
(II) technical scheme
In order to solve the above technical problems, the present invention provides a program starting method for an embedded device, the method comprising the following steps:
step one: the device is electrified, and after Boot starting, the chip loads a Boot Loader program from a 0X00000000 address of the internal Flash;
step two: hardware initialization, a Boot Loader program reads a program start flag bit from Flash;
step three: if the flag bit is a factory program, reading a factory program file from Flash, and checking the integrity of the factory program; if the verification is passed, the Boot Loader program guides the factory program to the designated address of the RAM, and the factory program is operated; if the verification is not passed, the Boot Loader program exits, and the equipment is failed to start;
step four: if the flag bit is an application program, reading an application program file from Flash, and checking the integrity of the application program; if the verification is passed, the Boot Loader program guides the application program to the designated address which is the same as the designated address in the step three in the RAM, and the application program is operated; and if the verification is not passed, reading the factory program file, and executing according to the step three.
(III) beneficial effects
The invention provides a program starting method of embedded equipment, which stores three programs: boot Loader program, factory program, and application program. After the device is started from the Boot Loader program, judging whether the program is guided to a factory program or an application program according to the flag bit stored in the Flash, checking the correctness of the program file, and reading the working program or the application program stored in the Flash to the address of the appointed memory space.
The technical scheme provided by the invention solves the problem of starting the embedded device when no application program exists, and establishes a mechanism for storing two independent programs by one device. The factory program is responsible for receiving application program files sent by the external equipment and providing equipment information. For devices with smaller memory, the Boot Loader program controls the starting of two sets of programs, so that memory resources are saved.
Drawings
Fig. 1 is a flowchart of a program starting method of an embedded device according to the present invention.
Detailed Description
To make the objects, contents and advantages of the present invention more apparent, the following detailed description of the present invention will be given with reference to the accompanying drawings and examples.
The invention aims to provide an embedded equipment program starting method which not only can save memory space, but also can support application program erasing and importing. The method comprises the steps that a factory program is added on the basis of an original Boot Loader program and an original application program, and when the application program or the application program error does not exist in the device, the Boot Loader program guides the device to start the factory program. The factory program includes a function of communicating with an external device, and receives and downloads an application program from the external device.
The program starting method of the embedded equipment comprises the following steps:
three programs are stored in the embedded device: boot Loader program, factory program and application program;
the Boot Loader program initializes hardware and loads an operating system to finish the loading and starting of the whole equipment; the Boot Loader program reads the program flag bit stored in Flash to control two sets of programs to start, wherein the two sets of programs are an application program and a factory program respectively, and only one set of program is started each time.
Application program: the program for realizing the service function of the equipment has larger code quantity. The general application program is updated continuously along with the development process, and in special cases, the application program is stored in other devices when being used for the first time.
Factory program: the method realizes the program of the receiving application program and has moderate code quantity. When the application program is not stored in Flash, the application program file is received from the external device and stored in Flash, the program start flag bit is changed, and the basic information of the device is stored.
In one embodiment, the program start flag bit is 0 or 1,0 is represented as a factory program, and 1 is represented as an application program.
In one embodiment, a program start flag bit of 0 or 1,1 is denoted as a factory program, and 0 is denoted as an application program.
The process of the program starting method of the embedded equipment of the invention is shown in figure 1, and comprises the following steps:
step one: the device is powered on, and after Boot starting, the chip loads the Boot Loader program from the 0X00000000 address of the internal Flash.
Step two: the hardware is initialized, and a Boot Loader program reads a program start flag bit from Flash.
Step three: if the flag bit is a factory program, a factory program file is read from the Flash, and the integrity of the factory program is checked. If the verification is passed, the Boot Loader program guides the factory program to the designated address of the RAM, and the factory program is operated; if the verification is not passed, the Boot Loader program exits, and the device fails to start.
Step four: if the flag bit is an application program, reading an application program file from the Flash, and checking the integrity of the application program. If the verification is passed, the Boot Loader program guides the application program to the designated address which is the same as the designated address in the step three in the RAM, and the application program is operated; and if the verification is not passed, reading the factory program file, and executing according to the step three.
The embedded device of the present invention stores three programs: boot Loader program, factory program, and application program. After the device is started from the Boot Loader program, judging whether the program is guided to a factory program or an application program according to the flag bit stored in the Flash, checking the correctness of the program file, and reading the working program or the application program stored in the Flash to the address of the appointed memory space.
The technical scheme provided by the invention solves the problem of starting the embedded device when no application program exists, and establishes a mechanism for storing two independent programs by one device. The factory program is responsible for receiving application program files sent by the external equipment and providing equipment information. For devices with smaller memory, the Boot Loader program controls the starting of two sets of programs, so that memory resources are saved.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present invention, and such modifications and variations should also be regarded as being within the scope of the invention.

Claims (10)

1. A program starting method for an embedded device, the method comprising the steps of:
step one: the device is electrified, and after Boot starting, the chip loads a Boot Loader program from a 0X00000000 address of the internal Flash;
step two: hardware initialization, a Boot Loader program reads a program start flag bit from Flash;
step three: if the flag bit is a factory program, reading a factory program file from Flash, and checking the integrity of the factory program; if the verification is passed, the Boot Loader program guides the factory program to the designated address of the RAM, and the factory program is operated; if the verification is not passed, the Boot Loader program exits, and the equipment is failed to start;
step four: if the flag bit is an application program, reading an application program file from Flash, and checking the integrity of the application program; if the verification is passed, the Boot Loader program guides the application program to the designated address which is the same as the designated address in the step three in the RAM, and the application program is operated; and if the verification is not passed, reading the factory program file, and executing according to the step three.
2. The program starting method of an embedded device according to claim 1, wherein three programs are stored in the embedded device: boot Loader program, factory program, and application program.
3. The method for starting program of embedded device according to claim 2, wherein Boot Loader program initializes hardware and loads operating system to complete loading start of whole device.
4. The method for starting program of embedded device according to claim 2, wherein the Boot Loader program reads a program flag bit stored in Flash to control two sets of program starting, wherein the two sets of program are respectively an application program and a factory program, and only one set of program is started each time.
5. The method for starting program of embedded device according to claim 2, wherein the application program is a program for realizing service functions of the device, the application program is updated continuously along with development process, and in some cases, the application program is stored in other devices when being used for the first time.
6. The program starting method of the embedded device according to claim 2, wherein the factory program is used for realizing the program for receiving the application program, and when the application program is not stored in Flash, the program starting method is responsible for receiving the application program file from the external device and storing the application program file in Flash, and changing the program starting flag bit.
7. The program starting method of an embedded device of claim 6, wherein the factory program further stores basic information of the device.
8. The program starting method of an embedded device according to claim 6, wherein the factory program includes a function of communicating with an external device, and the application program is received and downloaded from the external device.
9. The method for starting program of embedded device according to claim 6, wherein the program start flag bit is 0 or 1,0 is represented as a factory program, and 1 is represented as an application program.
10. The method for starting program of embedded device according to claim 6, wherein a program start flag bit of 0 or 1,1 is expressed as a factory program, and 0 is expressed as an application program.
CN202311092101.1A 2023-08-29 2023-08-29 Program starting method of embedded equipment Pending CN117032811A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311092101.1A CN117032811A (en) 2023-08-29 2023-08-29 Program starting method of embedded equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311092101.1A CN117032811A (en) 2023-08-29 2023-08-29 Program starting method of embedded equipment

Publications (1)

Publication Number Publication Date
CN117032811A true CN117032811A (en) 2023-11-10

Family

ID=88637255

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311092101.1A Pending CN117032811A (en) 2023-08-29 2023-08-29 Program starting method of embedded equipment

Country Status (1)

Country Link
CN (1) CN117032811A (en)

Similar Documents

Publication Publication Date Title
CN101751273B (en) Safety guide device and method for embedded system
CN103970557B (en) The method and storage device of storage device activation system
CN111857776B (en) On-line upgrading method for application program of DSP board card
CN109358887B (en) On-line upgrading method, device and system for single chip microcomputer program
CN111796848A (en) Bootloader software updating method and device, embedded controller and storage medium
CN101021797A (en) Repairing and staging method for software of embedded system
CN111813428A (en) Method and device for upgrading terminal firmware, electronic equipment and storage medium
CN112988183A (en) Program upgrading method and device, electronic equipment and storage medium
CN108182078B (en) Optimized missile-borne device non-dismantling software online upgrading method
CN112631625B (en) System upgrading method and device for embedded equipment and embedded equipment
CN110597533A (en) FPGA board card program updating system and method
CN102520957A (en) Method for software separation design of embedded system
CN108874422B (en) Software online upgrading method for refrigerator electric control board, refrigerator electric control board and refrigerator
CN111078255B (en) Software upgrading method and software upgrading system
CN112346770A (en) Embedded program online updating method
CN117032811A (en) Program starting method of embedded equipment
CN100363893C (en) Loading system and method
CN116028267A (en) Dual-system secure mobile phone resetting method and device, server and storage medium
CN114996717A (en) Upgrade program design method for preventing error erasure
CN112667444A (en) System upgrading method, storage medium and terminal equipment
US9081727B2 (en) Method, apparatus and computer program for loading files during a boot-up process
CN114625389A (en) Embedded equipment upgrading method, embedded equipment and storage device
CN117093247A (en) Firmware upgrading method and device of embedded device, chip and computing device
CN115437674B (en) Firmware upgrading method, device, medium and electronic equipment
CN112463240B (en) Method for restarting access to WinPE

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