CN-121979537-A - Embedded system burning method, embedded system starting method, device and system
Abstract
The application discloses an embedded system burning method, an embedded system starting device and an embedded system starting system, and belongs to the technical field of embedded systems. The method comprises the steps of running a boot ROM program to download firmware from an external device, pre-reconstructing the boot ROM program by the firmware download middle layer, running a function of taking over the boot ROM program by the firmware download middle layer to download a secondary program loader from the external device and write the secondary program loader into a target storage medium of an embedded system, running a secondary program loader to download a starting file, writing the starting file into the target storage medium to complete burning, wherein the starting file is a file required to be loaded at different stages in the starting process of the embedded system. The application improves the adaptability of the embedded system to different types of secondary program loaders in the burning process of the embedded system, and improves the reliability and stability of the burning of the embedded system.
Inventors
- WANG ZHAOLONG
- LI DEJIAN
- ZHANG HONGZHI
- GAN JIE
- MA YAN
- NIU BIN
- Liu Gengshuo
Assignees
- 北京智芯微电子科技有限公司
- 国网河北省电力有限公司雄安新区供电公司
- 国家电网有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251201
Claims (14)
- 1. The method for burning the embedded system is characterized by comprising the following steps of: Running a boot ROM program to download a firmware download middle layer from an external device, wherein the firmware download middle layer is a program obtained by reconstructing the boot ROM program in advance; Running a firmware download middle layer to take over the function of guiding the read-only memory program so as to download a secondary program loader from external equipment and write the secondary program loader into a target storage medium of an embedded system; And running the secondary program loader to download a starting file, and writing the starting file into the target storage medium to complete burning, wherein the starting file is a file required to be loaded at different stages in the starting process of the embedded system.
- 2. The embedded system programming method as claimed in claim 1, wherein said reconstructing said boot rom program comprises: Modifying the boot ROM program to integrate multiple communication drivers based on the same download logic as the boot ROM program to replace a default communication driver of the boot ROM program; modifying fixed buffer space parameters corresponding to the boot ROM program based on an allocable buffer space of an on-chip memory of an operating firmware download middle layer to support downloading of data files larger than the fixed buffer space; The data file includes the secondary program loader and the startup file.
- 3. The embedded system burning method of claim 2 wherein the running firmware download middle layer takes over the function of the boot rom program to download a secondary program loader from an external device, comprising: Selecting a target communication drive matched with the external hardware configuration from a plurality of communication drives by the firmware download middle layer according to the external hardware configuration of the embedded system; downloading the secondary program loader through the communication interface corresponding to the target communication driver, and caching the secondary program loader by utilizing the allocable cache space of the on-chip memory until the downloading of the secondary program loader is completed.
- 4. The embedded system programming method as claimed in claim 1, wherein said reconstructing said boot rom program further comprises: and modifying the fixed buffer space parameters corresponding to the boot ROM program based on the allocable buffer space of the on-chip memory of the running firmware download middle layer and the size of the secondary program loader.
- 5. The embedded system burning method according to claim 2 or 3, wherein the plurality of communication drivers includes at least one of a universal serial bus driver, a universal asynchronous receiver transmitter driver, and a serial peripheral interface driver.
- 6. The embedded system burning method according to any one of claims 2-4, wherein the on-chip memory is a static random access memory of the embedded system.
- 7. The embedded system burning method according to any one of claim 1, wherein the target storage medium of the embedded system includes at least one of a nand-type flash memory, a nor-type flash memory, an embedded multimedia card, and a secure digital card.
- 8. An embedded system starting method is characterized by comprising the following steps: Running a boot read-only memory program to initialize storage drives corresponding to a plurality of storage media of the embedded system according to a preset sequence; Under the condition that the initialization of the storage drive is successful, a storage medium corresponding to the storage drive which is successful in initialization is determined to be a target storage medium, and a secondary program loader is copied from the target storage medium, wherein the target storage medium is stored with the secondary program loader and a starting file which are downloaded from an external device by taking over the function of the boot ROM program by a firmware download intermediate layer, and the firmware download intermediate layer is downloaded from the external device by the boot ROM program; and the secondary program loader is operated to copy and load a starting file from the target storage medium so as to finish the starting of the embedded system.
- 9. The method for starting up an embedded system according to claim 8, wherein the running boot rom program to initialize storage drives corresponding to a plurality of storage media of the embedded system in a preset order comprises: Sequentially calling storage drivers corresponding to the storage media according to a preset sequence, and configuring the storage drivers to establish a data access channel corresponding to the storage media; And under the condition that the data access channel is detected to be in a ready state and at least one effective read operation is successfully completed through the data access channel, determining that the initialization of the storage drive is successful.
- 10. The embedded system boot method of claim 8, further comprising: And recording the information of the storage drive corresponding to the target storage medium, and taking the storage medium corresponding to the storage drive as the target storage medium in the next starting process of the embedded system.
- 11. An embedded system burning device, comprising: The first operation module is used for operating the boot ROM program to download a firmware download middle layer from the external equipment, wherein the firmware download middle layer is a program obtained by reconstructing the boot ROM program in advance; The second operation module is used for operating the firmware download middle layer to take over the function of guiding the read-only memory program so as to download a secondary program loader from external equipment and write the secondary program loader into a target storage medium of the embedded system; And the third operation module is used for operating the secondary program loader to download a starting file, writing the starting file into the target storage medium to complete burning, wherein the starting file is a file required to be loaded at different stages in the starting process of the embedded system.
- 12. An embedded system start-up device, comprising: a fourth operation module, configured to operate the boot rom program, so as to initialize storage drives corresponding to a plurality of storage media of the embedded system according to a preset sequence; The fifth operation module is used for determining a storage medium corresponding to the storage drive with successful initialization as a target storage medium and copying a secondary program loader from the target storage medium under the condition that the storage drive with successful initialization exists, wherein the target storage medium is stored with the secondary program loader and a starting file which are downloaded from an external device by taking over the function of the boot ROM program by a firmware download intermediate layer, and the firmware download intermediate layer is downloaded from the external device by the boot ROM program; And the sixth operation module is used for operating the secondary program loader to copy and load a starting file from the target storage medium so as to finish the starting of the embedded system.
- 13. An embedded system comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the embedded system burning method according to any one of claims 1-7 or the embedded system starting method according to any one of claims 8-10 when executing the program.
- 14. A chip comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions, implement the embedded system burning method according to any one of claims 1 to 7, or implement the embedded system starting method according to any one of claims 8 to 10.
Description
Embedded system burning method, embedded system starting method, device and system Technical Field The application belongs to the technical field of embedded systems, and particularly relates to an embedded system burning method, an embedded system starting device and an embedded system starting system. Background In the development and application of an embedded system, the burning and starting process is a core link for ensuring the initialization and operation of the system. However, in the related art, a boot read only memory (Boot Read Only Memory, bootROM) program is solidified in the chip, and its downloading function is limited by the buffer size and the supported communication protocol. As the service expands, the secondary program loader image may increase, and once the boot rom buffer space limit is exceeded, it cannot be downloaded, affecting system burning and starting. Disclosure of Invention The present application is directed to solving at least one of the technical problems existing in the related art. Therefore, the application provides an embedded system programming method, an embedded system starting device and an embedded system, which improve the adaptability to different types of SPLs in the embedded system programming process, avoid failure in loading the SPLs due to overlarge SPLs and improve the reliability and stability of embedded system programming. In a first aspect, the present application provides a method for burning an embedded system, where the method includes: Running a boot ROM program to download a firmware download middle layer from an external device, wherein the firmware download middle layer is a program obtained by reconstructing the boot ROM program in advance; Running a firmware download middle layer to take over the function of guiding the read-only memory program so as to download a secondary program loader from external equipment and write the secondary program loader into a target storage medium of an embedded system; And running the secondary program loader to download a starting file, and writing the starting file into the target storage medium to complete burning, wherein the starting file is a file required to be loaded at different stages in the starting process of the embedded system. In the technical scheme, the firmware download middle layer is obtained by running the boot ROM program, the firmware download middle layer is a program obtained by reconstructing the boot ROM program in advance, on the basis of the boot ROM program, the firmware download middle layer can carry out targeted modification on a secondary program loader needing to be downloaded so as to load a larger secondary program loader or process more complex hardware configuration and initialization tasks, the firmware download middle layer is not written into a target storage medium of the embedded system, hardware resources of the embedded system are saved, the function of taking over the boot ROM program by the firmware download middle layer is carried out so as to download the secondary program loader, further, the secondary program loader is run to download subsequent starting files and write the files into the target storage medium, the burning of the embedded system is completed, the adaptability of the secondary program loader of different types in the burning process of the embedded system is improved, the risk of failure of the secondary program loader due to overlarge secondary program loader and the reason of the non-symbol of the boot ROM program is reduced, and the reliability and the stability of the embedded system are improved. According to one embodiment of the present application, the reconstructing the boot ROM program includes: Modifying the boot ROM program to integrate multiple communication drivers based on the same download logic as the boot ROM program to replace a default communication driver of the boot ROM program; modifying fixed buffer space parameters corresponding to the boot ROM program based on an allocable buffer space of an on-chip memory of an operating firmware download middle layer to support downloading of data files larger than the fixed buffer space; The data file includes the secondary program loader and the startup file. According to one embodiment of the present application, the running firmware download middle layer takes over the function of the boot rom program to download a secondary program loader from an external device, comprising: Selecting a target communication drive matched with the external hardware configuration from a plurality of communication drives by the firmware download middle layer according to the external hardware configuration of the embedded system; downloading the secondary program loader through the communication interface corresponding to the target communication drive, and caching the secondary program loader by using the allocable cache space of the on-chip memory until the downloading of the secondary program l