A method and apparatus for operating a system on chip, electronic equipment and storage medium
By storing the target executable file in the secondary memory, the problem of insufficient BootROM storage space is solved, enabling fast system startup and flexible operation, and reducing the operating pressure on the BootROM.
Patent Information
- Application Number
- CN202510208228.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2026-08-25
AI Technical Summary
The limited storage space of the BootROM results in an excessively large space usage after integrating all functions, affecting normal operation.
The target executable file is stored in the second storage, causing the first-level downloaded firmware to stop running and instead the target executable file to perform the operation.
This avoids excessive BootROM space usage, ensures its normal operation, simplifies system development and debugging, and improves the speed and flexibility of system startup.
Smart Images

Figure CN122633255A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of system-on-a-chip operation, and in particular to a method for operating a system-on-a-chip, a device for operating a system-on-a-chip, an electronic device, and a computer-readable storage medium. Background Technology
[0002] System-on-Chip (SoC) upgrades or testing are typically performed in the BootROM (Boot Read-Only Memory). However, the BootROM's storage space is usually relatively small. Integrating all functions into the BootROM would result in excessive ROM space usage, thus affecting the normal operation of the BootROM. Summary of the Invention
[0003] In view of the above problems, a method for operating a system-on-a-chip, a device for operating a system-on-a-chip, an electronic device, and a computer-readable storage medium are proposed to overcome or at least partially solve the above problems, comprising:
[0004] A method for operating a system-on-a-chip, wherein the system-on-a-chip is equipped with a first memory and a second memory, and the first memory contains first-level download firmware, the method comprising:
[0005] In response to the target download command, download the target executable file;
[0006] After storing the target executable file in the second memory, the first-level downloaded firmware stops running, and the target executable file is run.
[0007] Optionally, after downloading the target executable file, the method further includes:
[0008] Verify the target executable file;
[0009] When the target executable file passes the verification, the step of storing the target executable file in the second memory and running it by the first-level downloaded firmware is executed, and the process jumps to running the target executable file.
[0010] Optionally, the verification of the target executable file includes:
[0011] The integrity of the target executable file is verified.
[0012] Optionally, the target executable file is a second-level download firmware. When the second-level download firmware is run, it is used to download the target boot image and store the target boot image in a third memory.
[0013] Optionally, during the second-level firmware download runtime, it is also used to establish a connection with the download tool and download the target boot image from the download tool.
[0014] Optionally, the second-level download firmware is used to download the target boot image from the download tool and store it in a third memory.
[0015] Optionally, the target runtime file is a debug image file, which runs when the first-level downloaded firmware stops running.
[0016] This invention also provides a system-on-a-chip (SoC) operating device, wherein the SoC is equipped with a first memory and a second memory, and the first memory contains first-level download firmware. The device includes:
[0017] The file download module, in response to a target download command, downloads the target executable file;
[0018] The jump-run module is used to store the target runtime file in the second memory, then stop the first-level downloaded firmware from running and run the target runtime file.
[0019] Optionally, the device further includes:
[0020] The verification module is used to verify the target executable file after it has been downloaded.
[0021] The jump-run module is used to store the target running file in the second memory when the target running file passes the verification, and then run it by the first-level downloaded firmware, and jump to run it by the target running file.
[0022] Optionally, the verification module is used to verify the integrity of the target executable file.
[0023] Optionally, the target executable file is a second-level download firmware. When the second-level download firmware is run, it is used to download the target boot image and store the target boot image in a third memory.
[0024] Optionally, when the second-level firmware download is running, it is also used to establish a connection with the download tool and download the target boot image from the download tool.
[0025] Optionally, the second-level download firmware is used to download the target boot image from the download tool and store it in a third memory.
[0026] Optionally, the target runtime file is a debug image file, which runs when the first-level downloaded firmware stops running.
[0027] This invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the above-described system-on-a-chip operation method.
[0028] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described on-chip system operation method.
[0029] The embodiments of the present invention have the following advantages:
[0030] In this embodiment of the invention, in response to a target download command, a target executable file is downloaded; after storing the target executable file in the second memory, the first-level downloaded firmware stops running, and the target executable file is executed. This embodiment of the invention avoids the problem of excessive ROM space usage due to integrating all functions into the BootROM, which could affect the normal operation of the BootROM. Attached Figure Description
[0031] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a flowchart illustrating the steps of an on-chip system operation method according to an embodiment of the present invention;
[0033] Figure 2 This is a flowchart of another method for operating an on-chip system according to an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram illustrating the interaction between multiple modules according to an embodiment of the present invention;
[0035] Figure 4 This is another schematic diagram illustrating the interaction between multiple modules according to an embodiment of the present invention;
[0036] Figure 5 This is a schematic diagram of the structure of an operating device for a system-on-a-chip according to an embodiment of the present invention. Detailed Implementation
[0037] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0038] To avoid the BootROM being responsible for software upgrades or testing, which could disrupt its normal operation, this invention provides a method for operating a system-on-a-chip. This method reduces the load on the BootROM by storing the runtime files used for upgrades and testing in other memory locations.
[0039] For specific details, please refer to Figure 1 , Figure 1 A flowchart illustrating the steps of an on-chip system operation method according to an embodiment of the present invention is shown. Figure 1 As shown, the method may include the following steps:
[0040] Step 101: In response to the target download command, download the target executable file.
[0041] The on-chip system can be equipped with a first memory and a second memory; the first memory can be a BootROM; and the second memory can be SRAM (Static Random-Access Memory).
[0042] The first memory may contain the first-level download firmware. The first-level download firmware refers to the firmware loaded first when the device boots up. Its main tasks are to initialize the hardware, load the second-stage bootloader or operating system kernel, and ensure the device can boot normally. For example, when the first-level download firmware is running, it can perform hardware initialization, load the second-stage bootloader, system startup, debugging and error handling, security and protection, update mechanisms, performance optimization, specific functions, and logging.
[0043] In practical applications, upon system startup, the first-level download firmware stored in the first memory can run and, in response to a target download command issued by the host computer, download the target executable file corresponding to the target download command. For example, upon receiving the target download command, the first-level download firmware causes the first memory to enter download mode. At this time, the first-level download firmware can run to receive the target executable file issued by the PC (Personal Computer) terminal tool.
[0044] Step 102: After storing the target executable file in the second storage, stop the first-level downloaded firmware from running and run the target executable file.
[0045] After the target executable file is downloaded, it can be stored in the second memory for execution. Compared with the first memory, which is used to deploy and run the target executable file, this avoids the problem of excessive ROM space being occupied due to integrating all functions into the BootROM, which would affect the normal operation of the BootROM.
[0046] After storing the target executable file in the second memory, the system can switch from running the first-level downloaded firmware to running the target executable file. During the execution of the target executable file, operations such as downloading, updating, and debugging can be performed; this embodiment of the invention does not impose limitations on these operations. Specifically, after storing the target executable file in the second memory, the first-level downloaded firmware can stop running; at this time, it can switch to running the target executable file.
[0047] In this embodiment of the invention, in response to a target download command, a target executable file is downloaded; after storing the target executable file in the second memory, the first-level downloaded firmware stops running, and the target executable file is executed. This embodiment of the invention avoids the problem of excessive ROM space usage due to integrating all functions into the BootROM, which could affect the normal operation of the BootROM.
[0048] Reference Figure 2 The diagram illustrates a flowchart of another method for operating an on-chip system according to an embodiment of the present invention, which may include the following steps:
[0049] Step 201: In response to the target download command, download the target executable file.
[0050] In practical applications, when the system starts up, the first-level download firmware stored in the first memory can run and respond to the target download command issued by the host computer to download the target executable file corresponding to the target download command.
[0051] For example, if it's an upgrade command, the target executable file could be the Second Download Stage (DA2) firmware. The Second Download Stage (DA2) refers to a more complex bootloader loaded after the First Download Stage firmware completes hardware initialization and basic system setup. DA2's main task is to further initialize the system, load the operating system kernel or applications, and ensure the system can enter a normal operating state.
[0052] As another example, if the command is for debugging, the target executable file can be a debug image file (i.e., a debug image). Debug image files are special image files used for debugging and testing. These files typically contain additional debugging information, symbol tables, debug interface configurations, etc., so that developers can more effectively diagnose and fix problems during the development and testing phases.
[0053] Step 202: Verify the target executable file.
[0054] In some feasible embodiments, when the first-level downloaded firmware in the first memory is running, the target executable file can be verified after it has been downloaded.
[0055] If the target executable file passes verification, step 203 can be executed; otherwise, if the target executable file fails verification, it indicates that the signature verification has failed and the download should be terminated.
[0056] In one embodiment of the present invention, the target executable file can be verified through the following sub-steps:
[0057] Sub-step 11: Verify the integrity of the target executable file.
[0058] In some feasible embodiments, when verifying the target executable file, the integrity of the target executable file can be verified; if the integrity of the target executable file passes the verification, the target executable file can be determined to have passed the verification. Conversely, if the integrity of the target executable file fails the verification, the target executable file can be determined to have failed the verification.
[0059] Step 203: When the target executable file passes the verification, the target executable file is stored in the second storage, and the first-level downloaded firmware stops running and the target executable file is run.
[0060] When the target executable file passes the verification, the first-level downloaded firmware can run to store the target executable file in the second storage.
[0061] After storing the target executable file in the second memory, the system can switch from running the first-level downloaded firmware to running the target executable file, so that the target executable file can perform the corresponding upgrade or debugging operations. This embodiment of the invention does not limit this.
[0062] In one embodiment of the present invention, the target executable file is a second-level download firmware. When the second-level download firmware is run, it is used to download the target boot image and store the target boot image in a third memory.
[0063] In some feasible embodiments, if the target executable file is a second-level download firmware, then after jumping from the first-level download firmware to the second-level download firmware, the second-level download firmware can download the target boot image from the download tool on the PC and store the target boot image in a third storage; thus, the upgrade operation is completed.
[0064] In one embodiment of the present invention, when the second-level firmware is running, it is also used to establish a connection with the download tool and download the target boot image from the download tool.
[0065] In some feasible embodiments, when the second-level download firmware runs, it can first establish a connection with the download tool on the PC. Based on this connection, the second-level download firmware can download the target boot image from the download tool. The target boot image can be the upgrade data required for the software to be upgraded.
[0066] In one embodiment of the present invention, the second-level download firmware is used to download the target boot image from the download tool and store it in the third memory.
[0067] In some feasible embodiments, after the second-level download firmware downloads the target boot image from the download tool, it can store the target boot image in a third memory to await system calls.
[0068] In one embodiment of the present invention, the target runtime file is a debug image file, which runs when the first-level firmware download stops.
[0069] In some feasible embodiments, the target runtime file can also be a debug image file; when the target runtime file is a debug image file, after the debug image file is verified, it can be run by the first-level downloaded firmware and then jump to run by the debug image file, so that the system can debug and test the system based on the debug image file. This embodiment of the invention does not limit this.
[0070] The third memory can refer to a storage medium other than the first and second memories, and this embodiment of the invention does not limit this.
[0071] For example, such as Figure 3 As shown, the BootROM contains the DA1 firmware (i.e., the first-level download firmware); when the BootROM enters download mode, it receives the DA2 firmware (i.e., the second-level download firmware) sent by the PC-side tool (Download Tool) and saves DA2 to SRAM.
[0072] After DA2 is downloaded, an integrity check is performed on DA2. If the check passes, the system jumps from DA1 in the BootROM to DA2 to run; otherwise, the Download Tool is notified of a signature verification failure, and the download ends.
[0073] After running DA2, DA2 reinitializes peripherals such as USB, re-establishes a connection with Download Tool, and downloads the target boot image from Download Tool to the storage medium based on the preset download protocol.
[0074] like Figure 4 As shown, the BootROM enters download mode and uses the Download Tool to download the debug image to SRAM.
[0075] After the Debug image is downloaded, its integrity is verified. If the verification is successful, the system will switch to the Debug image from DA1 and execute the relevant functions. If the verification fails, the Download Tool will be notified of the signature failure, and the download will end.
[0076] In this embodiment of the invention, dividing the download process into multiple stages helps simplify system development and debugging. Furthermore, the BootROM is typically located in the hardware's read-only memory; its code is small and relatively stable, making debugging easier. The development cycle of the secondary download firmware can be relatively independent of the BootROM, and it can be modified and optimized more frequently. Through this embodiment of the invention, the system can be quickly started with minimal configuration after a reset, reducing the complexity and potential failures during system startup.
[0077] Furthermore, because the secondary download firmware resides in the erasable memory, system updates and maintenance become much easier. Users or system administrators can update the secondary download firmware to fix vulnerabilities or add new features without modifying the BootROM.
[0078] Furthermore, BootROMs are typically small and basic to quickly boot the system and minimize hardware resource usage. Secondary download firmware, on the other hand, can be more complex, offering richer functionality such as advanced hardware initialization, system diagnostics and recovery, network booting, or booting from multiple storage devices. Therefore, through this embodiment of the invention, the BootROM can be designed to be very simple and efficient to execute the boot process as quickly as possible. And since the PLL (Phase-Locked Loop) frequency is usually not configured very high for safety reasons, this embodiment of the invention allows the PLL frequency to be configured to its highest value to run the download code using secondary download firmware.
[0079] Furthermore, employing a two-stage download process can reduce the size of the BootROM code, thereby reducing the complexity of the BootROM design and code. The two-stage download process can also evolve into different software functions, making the software functionality more flexible.
[0080] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0081] Reference Figure 5 The diagram illustrates a structural schematic of an on-chip system operating device according to an embodiment of the present invention. The on-chip system is equipped with a first memory and a second memory. The first memory contains first-level download firmware. The operating device of the on-chip system may include the following modules:
[0082] File download module 501, in response to the target download command, downloads the target executable file;
[0083] The jump-run module 502 is used to store the target runtime file in the second memory, stop the first-level downloaded firmware from running, and run the target runtime file.
[0084] In an optional embodiment of the present invention, the apparatus further includes:
[0085] The verification module is used to verify the target executable file after it has been downloaded.
[0086] The jump execution module 502 is used to store the target execution file in the second memory when the target execution file passes the verification, and then execute it by the first-level downloaded firmware, and jump to the execution of the target execution file.
[0087] In an optional embodiment of the present invention, a verification module is used to verify the integrity of the target executable file.
[0088] In an optional embodiment of the present invention, the target executable file is a second-level download firmware. When the second-level download firmware is run, it is used to download the target boot image and store the target boot image in a third memory.
[0089] In an optional embodiment of the present invention, when the second-level download firmware is running, it is also used to establish a connection with the download tool and download the target boot image from the download tool.
[0090] In an optional embodiment of the present invention, the second-level download firmware is used to download the target boot image from the download tool and store it in a third memory.
[0091] In an optional embodiment of the present invention, the target runtime file is a debug image file, which runs when the first-level firmware download stops.
[0092] In this embodiment of the invention, in response to a target download command, a target executable file is downloaded; after storing the target executable file in the second memory, the first-level downloaded firmware stops running, and the target executable file is executed. This embodiment of the invention avoids the problem of excessive ROM space usage due to integrating all functions into the BootROM, which could affect the normal operation of the BootROM.
[0093] This invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the above-described on-chip system operation method.
[0094] This invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the above-described on-chip system operation method.
[0095] As the apparatus embodiment is basically similar to the method embodiment, it is described in a relatively simple manner. For relevant details, please refer to the description of the method embodiment.
[0096] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0097] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0098] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0099] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0100] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0101] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0102] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0103] The above provides a detailed description of a system-on-a-chip (SoC) operation method, a SoC operation device, an electronic device, and a computer-readable storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for operating an on-chip system, characterized in that, The on-chip system is equipped with a first memory and a second memory, wherein the first memory contains first-level download firmware, and the method includes: In response to the target download command, download the target executable file; After storing the target executable file in the second memory, the first-level downloaded firmware stops running, and the target executable file is run.
2. The method according to claim 1, characterized in that, After downloading the target executable file, the method further includes: Verify the target executable file; When the target executable file passes the verification, the step of storing the target executable file in the second memory, stopping the first-level downloaded firmware, and running the target executable file is executed.
3. The method according to claim 2, characterized in that, The verification of the target executable file includes: The integrity of the target executable file is verified.
4. The method according to any one of claims 1-3, characterized in that, The target executable file is a second-level download firmware. When the second-level download firmware is run, it is used to download the target boot image and store the target boot image in a third memory.
5. The method according to claim 4, characterized in that, When the second-level firmware download is running, it is also used to establish a connection with the download tool and download the target boot image from the download tool.
6. The method according to claim 5, characterized in that, The second-level firmware download is used to download the target boot image from the download tool and store it in the third memory.
7. The method according to any one of claims 1-6, characterized in that, The target runtime file is a debug image file, which runs when the first-level downloaded firmware stops running.
8. A system-on-a-chip operating device, characterized in that, The system-on-a-chip is equipped with a first memory and a second memory, wherein the first memory contains first-level download firmware, and the device includes: The file download module, in response to a target download command, downloads the target executable file; The jump-run module is used to store the target runtime file in the second memory, then stop the first-level downloaded firmware from running and run the target runtime file.
9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the operating method of the system-on-chip as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the method of operating the system-on-chip as described in any one of claims 1 to 7.