Chip starting method and device, equipment and medium
By updating the startup parameters after the chip firmware upgrade and selecting the appropriate chip media as the startup media, the problem of not being able to flexibly specify the startup media in traditional chip firmware upgrades is solved, and higher media utilization and design simplification is achieved.
Patent Information
- Application Number
- CN202510198972.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-02-21
AI Technical Summary
When a traditional chip firmware is upgraded, the boot media cannot be flexibly specified, resulting in a long-term idleness of another storage media, increasing design complexity and cost.
Flexible media switching is achieved by updating the startup parameters in the target storage area of all chip media after the chip firmware is upgraded, and selecting the corresponding chip media as the startup media based on these parameters after the chip is re-powered.
It avoids long-term idleness of chip media, improves the utilization rate of media, simplifies the design of chips and external circuits, and reduces design complexity and cost.
Smart Images

Figure CN119987881A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a chip startup method, device, equipment and medium. Background Art
[0002] In the field of chip technology, chip firmware is usually stored in an electrically erasable programmable ROM (EEPROM) or FLASH (flash memory) chip. To ensure stable operation of the chip, users can use a specific refresh program to write the new firmware program into the EEPROM or FLASH chip to complete the firmware upgrade. To prevent the chip from being unable to start due to damage to a certain storage medium, the chip usually uses dual Flash or dual EEPROM to perform redundant backup of the firmware.
[0003] In traditional technology, when the chip firmware is upgraded, the new firmware program needs to be written into two Flash or EEPROMs. In addition, since most chips are designed to simplify, they are usually fixed to start from a certain Flash or EEPROM, and the startup medium cannot be flexibly specified, which makes the other storage medium idle for a long time. Although some chips can be started from a specified medium by means of external pins, this method not only requires the chip to lead out additional pins to indicate the startup medium, but also requires the design of external circuits to record the chip firmware upgrade status and input it to the chip through pins, which undoubtedly increases the design complexity and cost of the chip and external circuits. For this reason, the above technical problems urgently need to be solved by those skilled in the art. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a chip startup method, device, equipment and medium. The present application avoids the situation where a chip medium is idle for a long time, improves the utilization rate of the chip medium, simplifies the design of the chip and external circuits, and reduces the design complexity and cost. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a chip startup method, comprising:
[0006] After the chip firmware is upgraded, the startup parameters in the target storage area of all chip media are updated; wherein the startup parameters in the target storage area represent the designated startup state of the corresponding chip medium, and the designated startup state represents whether to start from the corresponding chip medium;
[0007] After the chip is powered on again, the startup parameters in the target storage area of all chip media are read, so as to select a corresponding chip medium from all chip media as the startup medium based on the read startup parameters, and read a new firmware program obtained after the chip firmware is upgraded from the startup medium;
[0008] Execute the new firmware program to start the chip.
[0009] Optionally, the chip firmware startup method further includes:
[0010] The medium type is determined by reading the level state of the first chip pin, the redundancy mode is determined by reading the level state of the second chip pin, and all chip media are determined as the first chip medium and the second chip medium based on the redundancy mode; the redundancy mode includes dual-media redundancy or dual-partition redundancy;
[0011] Accordingly, updating the startup parameters in the target storage areas of all chip media, and reading the startup parameters in the target storage areas of all chip media, so as to select a corresponding chip medium from all chip media as the startup medium based on the read startup parameters, includes:
[0012] Updating the startup parameters in the target storage areas of the first chip medium and the second chip medium, and reading the startup parameters in the target storage areas of the first chip medium and the second chip medium, so as to select a corresponding chip medium from the first chip medium and the second chip medium as the startup medium based on the read startup parameters;
[0013] Accordingly, execute the new firmware program to start the chip, including:
[0014] The first firmware program in the new firmware program is migrated to the static random access memory, and it is determined whether the first firmware program is safe and reliable. If the first firmware program is safe and reliable, the first firmware program is executed, and the second firmware program in the new firmware program is migrated to the static random access memory, and then the second firmware program is executed to realize chip startup.
[0015] Optionally, the chip firmware startup method further includes:
[0016] If the redundancy mode is dual medium redundancy, the first storage area of the first chip medium is determined as the target storage area of the first chip medium, and the first storage area of the second chip medium is determined as the target storage area of the second chip medium;
[0017] If the redundancy mode is dual partition redundancy, the first storage area of the first chip medium is determined as the target storage area of the first chip medium, and the second storage area of the second chip medium is determined as the target storage area of the second chip medium.
[0018] Optionally, after executing the new firmware program to enable the chip to start up, the following steps are also included:
[0019] Determine whether the chip startup is successful;
[0020] If the chip is successfully started, the new firmware program is copied to other chip media other than the startup medium to achieve backup of the new firmware program.
[0021] Optionally, after executing the new firmware program to enable the chip to start up, the following steps are also included:
[0022] Trigger the start time timing operation;
[0023] If the chip starts successfully, the startup time timing operation is turned off;
[0024] If the chip fails to start, when the startup time is longer than the preset time threshold, a new firmware program obtained after the chip firmware upgrade is read from other chip media other than the startup medium, and the new firmware program is executed to realize chip startup.
[0025] Optionally, after reading a new firmware program obtained after the chip firmware is upgraded from other chip media other than the boot medium and executing the new firmware program to start the chip, the method further includes:
[0026] If the chip fails to start, the process jumps to the step of reading a new firmware program obtained after the chip firmware is upgraded from the startup medium until the chip starts successfully or the number of jumps meets a preset threshold.
[0027] Optionally, after updating the startup parameters in the target storage area of all chip media, the method further includes:
[0028] Verify the integrity and security of the updated startup parameters;
[0029] If the verification passes, the historical startup parameter erasing operation in the target storage area is triggered.
[0030] In a second aspect, the present application discloses a chip startup device, comprising:
[0031] A startup parameter update module is used to update the startup parameters in the target storage area of all chip media after the chip firmware is upgraded; wherein the startup parameters in the target storage area represent the specified startup state of the corresponding chip medium, and the specified startup state represents whether to start from the corresponding chip medium;
[0032] A boot medium selection module is used to read the boot parameters in the target storage area of all chip media after the chip is powered on again, so as to select the corresponding chip medium from all chip media as the boot medium based on the read boot parameters, and read the new firmware program obtained after the chip firmware is upgraded from the boot medium;
[0033] The chip startup module is used to execute the new firmware program to realize chip startup.
[0034] In a third aspect, the present application discloses an electronic device, comprising:
[0035] Memory, used to store computer programs;
[0036] The processor is used to execute a computer program to implement the aforementioned disclosed chip startup method.
[0037] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned chip startup method disclosed above is implemented.
[0038] It can be seen that the present application proposes a chip startup method, including: after the chip firmware is upgraded, updating the startup parameters in the target storage area of all chip media; wherein the startup parameters in the target storage area represent the designated startup state of the corresponding chip medium, and the designated startup state represents whether to start from the corresponding chip medium; after the chip is powered on again, reading the startup parameters in the target storage area of all chip media, so as to select the corresponding chip medium from all chip media as the startup medium based on the read startup parameters, and read the new firmware program obtained after the chip firmware is upgraded from the startup medium; executing the new firmware program to realize chip startup. In summary, it can be seen that after the chip firmware is upgraded, the system will update the startup parameters in the target storage area of the chip medium, and these parameters are used to mark whether the corresponding chip medium is used as the startup medium. After the chip is powered on again, the startup medium will be selected from all chip media according to the startup parameters, and the upgraded new firmware program will be read from it and then executed, and finally the startup process of the chip will be completed. By updating the startup parameters, the present application enables the chip to select the corresponding chip medium as the startup medium from all chip media according to the startup parameters when it is powered on again. In this way, it is no longer fixed to start from a certain chip medium, but can be switched flexibly, avoiding the situation where a certain chip medium is idle for a long time, and improving the utilization rate of the chip medium. Furthermore, the present application selects the boot medium by reading the boot parameters, without the need to lead out additional pins, and without the need to design a special external circuit to record and transmit firmware upgrade status information, which simplifies the design of the chip and external circuit, and reduces the design complexity and cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0040] Figure 1 A flow chart of a chip startup method disclosed in this application;
[0041] Figure 2 A schematic diagram of a single NOR Flash dual-mirror address space division disclosed in this application;
[0042] Figure 3 A schematic diagram of dual NOR Flash address space division disclosed in this application;
[0043] Figure 4 A schematic diagram of a secure startup process disclosed in this application;
[0044] Figure 5 A schematic diagram of a multi-bit default upgrade from flash0 disclosed in this application;
[0045] Figure 6 A schematic diagram of Flash0 and Flash1 address space division and startup process is disclosed;
[0046] Figure 7 This is a schematic diagram of the structure of a chip startup device disclosed in this application;
[0047] Figure 8 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] In traditional technology, when the chip firmware is upgraded, the new firmware program needs to be written into two Flash or EEPROMs. In addition, since most chips are designed to simplify, they are usually fixed to start from a certain Flash or EEPROM, and the startup medium cannot be flexibly specified, which makes the other storage medium idle for a long time. Although some chips can be started from a specified medium by means of external pins, this method not only requires the chip to lead out additional pins to indicate the startup medium, but also requires the design of external circuits to record the chip firmware upgrade status and input it to the chip through pins, which undoubtedly increases the design complexity and cost of the chip and external circuits. For this reason, the above technical problems urgently need to be solved by those skilled in the art.
[0050] To this end, the embodiment of the present application proposes a chip startup solution, which can avoid the situation where a chip medium is idle for a long time, improve the utilization rate of the chip medium, simplify the design of the chip and external circuits, and reduce the design complexity and cost.
[0051] The present application embodiment discloses a chip startup method, see Figure 1 As shown, the method includes:
[0052] Step S11: after the chip firmware is upgraded, the startup parameters in the target storage area of all chip media are updated; wherein the startup parameters in the target storage area represent the designated startup state of the corresponding chip medium, and the designated startup state represents whether to start from the corresponding chip medium.
[0053] In this embodiment, after the chip firmware is upgraded, the startup parameters in the target storage area of all chip media are updated; wherein the startup parameters in the target storage area represent the designated startup state of the corresponding chip medium, and the designated startup state represents whether to start from the corresponding chip medium.
[0054] In this embodiment, the medium type is determined by reading the level state of the first chip pin, the redundancy mode is determined by reading the level state of the second chip pin, and all chip media are determined as the first chip medium and the second chip medium based on the redundancy mode. Among them, the redundancy mode includes dual-media redundancy or dual-partition redundancy. If the redundancy mode is dual-media redundancy, the first storage area of the first chip medium is determined as the target storage area of the first chip medium, and the first storage area of the second chip medium is determined as the target storage area of the second chip medium; if the redundancy mode is dual-partition redundancy, the first storage area of the first chip medium is determined as the target storage area of the first chip medium, and the second storage area of the second chip medium is determined as the target storage area of the second chip medium. In this way, the working mode and storage area are determined by simply reading the chip pin level state, without the need for complex hardware circuits or additional sensors, simplifying the hardware design, and reducing hardware costs and system complexity.
[0055] Exemplarily, the media include Flash (flash memory), EEPROM (Electrically ErasableProgrammable Read-Only Memory) and SD card, dual media redundancy is dual Flash (Flash0, Flash1), dual EEPROM (EEPROM0, EEPROM1), etc., dual partition redundancy is single Flash dual partition (upper half, lower half), etc. For dual Flash, Flash0 is the first chip medium, Flash1 is the second chip medium, for dual EEPROM, EEPROM0 is the first chip medium, EEPROM1 is the second chip medium. For single Flash dual partition, the upper half is the first chip medium, and the lower half is the second chip medium. Furthermore, the chip pin design remains unchanged, and a redundant chip is usually used, and 3 chip pins are designed to indicate the current chip working environment. 2 chip pins (i.e., the first chip pin, boot_mode) are used to indicate which boot medium is currently used. For example, boot_mode=0x00 means Flash boot; boot_mode=0x01 means EEPROM boot; boot_mode=0x10 means SD card boot. One chip pin (i.e., the second chip pin, boot_num) can be used to indicate the redundancy mode. For example, boot_num=0x0 means dual Flash / EEPROM / SD card redundancy; boot_num=0x1 means single and dual Flash / EEPROM / SD card dual partition redundancy. For further information, see Figure 2 and Figure 3 As shown, Figure 2 This is a schematic diagram of the dual-mirror address space division of a single NOR Flash. Figure 3 This is a diagram of the division of the dual NOR Flash address space. The first storage area (Paramter_ROM_P0) is used to store the startup parameters of the upper half (single flash startup) or flash (dual flash), which is read by the ROM program and stored in a fixed position of the NOR Flash; the second storage area (Paramter_ROM_P1) is used to store the startup parameters of the lower half (single flash startup), which is read by the ROM program and stored in a fixed position of the NOR Flash. That is, the P0 and P1 areas are used in the single Flash dual-image startup, and only the P0 area is used in the dual Flash startup. The new firmware program includes SPL, UBoot and Kernel: it is the normal firmware program of the chip. It should be pointed out that dual media redundancy and dual partition redundancy are both used for redundant backup. Each medium can be used as a separate startup medium to store data separately.
[0056] Based on this, in this embodiment, updating the startup parameters in the target storage areas of all chip media includes: updating the startup parameters in the target storage areas of the first chip medium and the second chip medium.
[0057] Step S12: After the chip is powered on again, the startup parameters in the target storage area of all chip media are read, so as to select the corresponding chip medium from all chip media as the startup medium based on the read startup parameters, and read the new firmware program obtained after the chip firmware is upgraded from the startup medium.
[0058] It can be seen that after each firmware upgrade is completed, the startup parameters need to be updated at the same time to determine which chip medium to boot from next time. Furthermore, after the chip is powered on again, the startup parameters in the target storage area of all chip media are read, so that the corresponding chip medium is selected as the startup medium from all chip media based on the read startup parameters, so as to achieve the specified media startup. Specifically, this embodiment reads the startup parameters in the target storage area of the first chip medium and the second chip medium, so that the corresponding chip medium is selected as the startup medium from the first chip medium and the second chip medium based on the read startup parameters. In this way, the present application is no longer fixed to start from a certain chip medium, but can flexibly switch chip media, avoiding the situation where a certain chip medium is idle for a long time, and improving the utilization rate of the chip medium.
[0059] For example, taking dual Flash boot as an example, As shown in Table 1, valid indicates the specified startup state corresponding to the startup parameter. To start the effective state, Invalid startup state, except and All others are in error status.
[0060] Table 1
[0061]
[0062] Step S13: Execute the new firmware program to start the chip.
[0063] In this embodiment, the first firmware program (SPL program) in the new firmware program is migrated to the static random access memory (SRAM), and it is determined whether the first firmware program is safe and reliable. If the first firmware program is safe and reliable, the first firmware program is executed, and the second firmware program (UBoot and Kernel) in the new firmware program is migrated to the static random access memory, and then the second firmware program is executed to realize chip startup.
[0064] Further, it is determined whether the chip startup is successful; if the chip startup is successful, the new firmware program is copied to other chip media other than the startup medium to achieve backup of the new firmware program.
[0065] Furthermore, the startup duration timing operation is triggered. If the chip starts successfully, the startup duration timing operation is turned off; if the chip fails to start, when the startup duration is greater than the preset duration threshold, the new firmware program obtained after the chip firmware upgrade is read from other chip media other than the startup medium, and the new firmware program is executed to realize chip startup; if the chip fails to start, jump to the step of reading the new firmware program obtained after the chip firmware upgrade from the startup medium until the chip starts successfully or the number of jumps meets the preset threshold. For example, after the chip is powered on, it will first read the startup parameters from medium 1, and then read the startup parameters from medium 2. By comparing the startup parameters in the two media, it is decided which medium to start from. Assuming that it is decided to start from medium 0, the firmware program will be moved from medium 0 to start execution, and WDT (Watch-dog Timer) will be started at the same time. If the startup is successful, the WDT will be turned off. If the startup fails, the WDT cannot be turned off. After the WDT times out, the program will be moved from medium 1 to start execution, and the WDT will be restarted at the same time. If the startup is successful, the WDT will be turned off. If the startup fails, the WDT cannot be turned off. After the WDT times out, it will jump to medium 0 to execute the startup process. In some embodiments, the jump is up to 3 times. If the startup fails, it is considered that there is a problem with the firmware and the chip cannot be started. In this way, by setting a switching mechanism when the startup fails, multiple attempts to start from different media are made, which increases the probability of successful startup of the chip and reduces the situation where the startup cannot be caused by a single medium failure.
[0066] Furthermore, the integrity and security of the updated startup parameters are verified; if the verification passes, the historical startup parameter erasure operation in the target storage area is triggered. In this way, it is ensured that the startup will not fail due to update failure, and the reliability and stability of chip startup are improved.
[0067] Figure 4A schematic diagram of a secure boot process is disclosed, including: (1) powering on the chip; (2) reading the chip pin status and accessing the read-only memory; (3) reading the startup parameters of the first chip medium; (4) resetting the chip and configuring the serial peripheral interface controller; (5) reading the startup parameters of the second chip medium; (6) judging whether to boot from the first chip medium. If yes, reset the chip again and configure the serial peripheral interface controller; if no, proceed to the next step; (7) regardless of whether booting from the first chip medium, judging whether the SPL is safe and reliable to achieve secure boot, if not, stop booting, if reliable, execute SPL (Secondary Program Loader) and migrate the Uboot (Universal Boot Loader) program to In the Synchronous Dynamic Random Access Memory (SDRAM), the CPU (Central Processing Unit) The UBoot program starts to execute at the specified address; further, Uboot initializes related hardware, obtains the storage location information and size information of the Kernel program (kernel program), and migrates the Kernel to SDRAM. The CPU starts to execute the Kernel program from the specified address of SDRAM, and finally completes the chip startup.
[0068] Figure 5 A schematic diagram of multi-bit default upgrade from flash0 is disclosed. Assuming that Flash1 needs to be upgraded first, The parameters of the area tell to boot from Flash1 and then upgrade Flash0. The parameters of the area tell to boot from Flash0. The entire process realizes the startup of the specified chip medium through the change of the startup parameter valid, and then realizes the upgrade of Flash1 and Flash0 in sequence.
[0069] Figure 6 A schematic diagram of Flash0 and Flash1 address space division and startup process is disclosed, including the first startup process, Web remote upgrade process, and non-first startup process. First startup process: The chip is powered on, and the ROM program reads the chip pin status and the Flash0 , configure the SOC (System on Chip), reset the QSPI (Quad Serial Peripheral Interface) controller, and then read the Flash1 . Determine the boot medium, if it is unsafe, stop booting, if it is safe, execute Program, read Get the number of boot times and other information, migrate and execute SPL and other boot programs, then migrate and execute U-boot, etc., to complete the Flash0 boot. Web remote upgrade process: remotely upgrade Flash through the Web, including PRE, SPL, U-boot, Kernel, etc. After the upgrade is completed, update Flash1 and Flash0 in turn. , The valid flag is 0xA5. Non-first boot process: The chip is powered on, and the ROM program reads the pin status and Flash0 , then read Flash1 , determine the boot media and security. If it is safe, execute program, obtain the boot times and other information, migrate and execute the SPL program, and then migrate and execute the U-boot program to complete the Flash boot.
[0070] This application implements the designated medium startup after the chip firmware upgrade is completed without using additional chip pins and peripheral update circuits. That is, without the need for additional chip pins and peripheral circuits, the chip can be specified to start from Flash0 or Flash1, reducing the complexity of chip design and the complexity of peripheral circuit design. At the same time, after writing new firmware to a certain Flash, it can be specified to start from this new firmware Flash. After the startup is completed, the new firmware will be automatically backed up to another Flash for redundant backup.
[0071] Furthermore, during the operation of the chip, the status of each chip medium and partition is monitored in real time. For example, the integrity of the stored data is checked. If the data checksum of a chip medium or partition is found to be inconsistent with the pre-calculated data, it is determined that the area may have a fault. At the same time, the read and write operation response time of the chip medium is monitored. If the read and write response time of a chip medium exceeds the preset threshold, it is considered that the chip medium may have performance degradation or failure. Further, when a chip medium or partition is detected to have a fault, the chip control module will decide whether to perform redundant switching based on the current redundancy mode and fault condition. If the dual-media redundancy mode is currently used and a fault is detected in the first chip medium, it will automatically switch to the second chip medium for data read and write operations. At the same time, the fault information is recorded in the chip log to facilitate subsequent troubleshooting and maintenance.
[0072] It can be seen that the present application proposes a chip startup method, including: after the chip firmware is upgraded, updating the startup parameters in the target storage area of all chip media; wherein the startup parameters in the target storage area represent the designated startup state of the corresponding chip medium, and the designated startup state represents whether to start from the corresponding chip medium; after the chip is powered on again, reading the startup parameters in the target storage area of all chip media, so as to select the corresponding chip medium from all chip media as the startup medium based on the read startup parameters, and read the new firmware program obtained after the chip firmware is upgraded from the startup medium; executing the new firmware program to realize chip startup. In summary, it can be seen that after the chip firmware is upgraded, the system will update the startup parameters in the target storage area of the chip medium, and these parameters are used to mark whether the corresponding chip medium is used as the startup medium. After the chip is powered on again, the startup medium will be selected from all chip media according to the startup parameters, and the upgraded new firmware program will be read from it and then executed, and finally the startup process of the chip will be completed. By updating the startup parameters, the present application enables the chip to select the corresponding chip medium as the startup medium from all chip media according to the startup parameters when it is powered on again. In this way, it is no longer fixed to start from a certain chip medium, but can be switched flexibly, avoiding the situation where a certain chip medium is idle for a long time, and improving the utilization rate of the chip medium. Furthermore, the present application selects the boot medium by reading the boot parameters, without the need to lead out additional pins, and without the need to design a special external circuit to record and transmit firmware upgrade status information, which simplifies the design of the chip and external circuit, and reduces the design complexity and cost.
[0073] Correspondingly, the present application also discloses a chip startup device, see Figure 7 As shown, the device comprises:
[0074] The startup parameter update module 11 is used to update the startup parameters in the target storage area of all chip media after the chip firmware is upgraded; wherein the startup parameters in the target storage area represent the designated startup state of the corresponding chip medium, and the designated startup state represents whether to start from the corresponding chip medium;
[0075] The boot medium selection module 12 is used to read the boot parameters in the target storage area of all chip media after the chip is powered on again, so as to select the corresponding chip medium from all chip media as the boot medium based on the read boot parameters, and read the new firmware program obtained after the chip firmware is upgraded from the boot medium;
[0076] The chip startup module 13 is used to execute the new firmware program to realize chip startup.
[0077] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0078] It can be seen that the present application proposes a chip startup method, including: after the chip firmware is upgraded, updating the startup parameters in the target storage area of all chip media; wherein the startup parameters in the target storage area represent the designated startup state of the corresponding chip medium, and the designated startup state represents whether to start from the corresponding chip medium; after the chip is powered on again, reading the startup parameters in the target storage area of all chip media, so as to select the corresponding chip medium from all chip media as the startup medium based on the read startup parameters, and read the new firmware program obtained after the chip firmware is upgraded from the startup medium; executing the new firmware program to realize chip startup. In summary, it can be seen that after the chip firmware is upgraded, the system will update the startup parameters in the target storage area of the chip medium, and these parameters are used to mark whether the corresponding chip medium is used as the startup medium. After the chip is powered on again, the startup medium will be selected from all chip media according to the startup parameters, and the upgraded new firmware program will be read from it and then executed, and finally the startup process of the chip will be completed. By updating the startup parameters, the present application enables the chip to select the corresponding chip medium as the startup medium from all chip media according to the startup parameters when it is powered on again. In this way, it is no longer fixed to start from a certain chip medium, but can be switched flexibly, avoiding the situation where a certain chip medium is idle for a long time, and improving the utilization rate of the chip medium. Furthermore, the present application selects the boot medium by reading the boot parameters, without the need to lead out additional pins, and without the need to design a special external circuit to record and transmit firmware upgrade status information, which simplifies the design of the chip and external circuit, and reduces the design complexity and cost.
[0079] Furthermore, an embodiment of the present application also provides an electronic device. Figure 8 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0080] Figure 8 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the chip startup method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0081] In this embodiment, the power supply 26 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 24 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0082] In addition, the memory 22, as a carrier for storing resources, may be a read-only memory, a random access memory, a disk or an optical disk, etc., and the resources stored thereon may include a computer program 221, and the storage method may be temporary storage or permanent storage. In addition to including a computer program that can be used to complete the chip startup method executed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 221 may further include a computer program that can be used to complete other specific tasks.
[0083] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned chip startup method disclosed above is implemented.
[0084] For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.
[0085] The various embodiments in this application are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0086] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0087] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0088] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0089] The above is a detailed introduction to a chip startup method, device, equipment, and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A chip startup method, characterized in that: include: After the chip firmware is upgraded, the startup parameters in the target storage area of all chip media are updated; wherein the startup parameters in the target storage area represent the designated startup state of the corresponding chip medium, and the designated startup state represents whether to start from the corresponding chip medium; After the chip is powered on again, the startup parameters in the target storage area of all the chip media are read, so as to select the corresponding chip medium from all the chip media as the startup medium based on the read startup parameters, and read the new firmware program obtained after the chip firmware is upgraded from the startup medium; The new firmware program is executed to start the chip.
2. The chip firmware startup method according to claim 1, characterized in that: Also includes: Determine the medium type by reading the level state of the first chip pin, determine the redundancy mode by reading the level state of the second chip pin, and determine all the chip media as the first chip media and the second chip media based on the redundancy mode; the redundancy mode includes dual-media redundancy or dual-partition redundancy; Accordingly, updating the startup parameters in the target storage areas of all chip media, and reading the startup parameters in the target storage areas of all chip media, so as to select the corresponding chip medium from all chip media as the startup medium based on the read startup parameters, includes: updating the startup parameters in the target storage areas of the first chip medium and the second chip medium, and reading the startup parameters in the target storage areas of the first chip medium and the second chip medium, so as to select the corresponding chip medium from the first chip medium and the second chip medium as the startup medium based on the read startup parameters; Accordingly, the executing of the new firmware program to start the chip includes: Migrate the first firmware program in the new firmware program to the static random access memory, and determine whether the first firmware program is safe and reliable. If the first firmware program is safe and reliable, execute the first firmware program, and migrate the second firmware program in the new firmware program to the static random access memory, and then execute the second firmware program to achieve chip startup.
3. The chip firmware startup method according to claim 2, characterized in that: Also includes: If the redundancy mode is dual medium redundancy, the first storage area of the first chip medium is determined as the target storage area of the first chip medium, and the first storage area of the second chip medium is determined as the target storage area of the second chip medium; If the redundancy mode is dual partition redundancy, the first storage area of the first chip medium is determined as the target storage area of the first chip medium, and the second storage area of the second chip medium is determined as the target storage area of the second chip medium.
4. The chip firmware startup method according to claim 1, characterized in that: After the new firmware program is executed to start the chip, the method further includes: Determine whether the chip startup is successful; If the chip is successfully started, the new firmware program is copied to other chip media other than the startup medium to achieve backup of the new firmware program.
5. The chip firmware startup method according to claim 1, characterized in that: After executing the new firmware program to start the chip, the method further includes: Trigger the start time timing operation; If the chip starts successfully, the startup time timing operation is turned off; If the chip fails to start, when the startup time is longer than a preset time threshold, the new firmware program obtained after the chip firmware upgrade is read from other chip media other than the startup medium, and the new firmware program is executed to realize chip startup.
6. The chip firmware startup method according to claim 5, characterized in that: After reading the new firmware program obtained after the chip firmware upgrade from the chip medium other than the boot medium and executing the new firmware program to start the chip, the method further includes: If the chip fails to start, the process jumps to the step of reading the new firmware program obtained after the chip firmware is upgraded from the startup medium until the chip starts successfully or the number of jumps meets a preset threshold.
7. The chip firmware startup method according to any one of claims 1 to 6, characterized in that: After the startup parameters in the target storage area of all chip media are updated, the method further includes: Verifying the integrity and security of the updated startup parameters; If the verification passes, an operation of erasing the historical startup parameters in the target storage area is triggered.
8. A chip startup device, characterized in that: include: A startup parameter update module, used for updating the startup parameters in the target storage area of all chip media after the chip firmware is upgraded; wherein the startup parameters in the target storage area represent the designated startup state of the corresponding chip medium, and the designated startup state represents whether to start from the corresponding chip medium; A boot medium selection module, used for reading the boot parameters in the target storage area of all the chip media after the chip is powered on again, so as to select the corresponding chip medium from all the chip media as the boot medium based on the read boot parameters, and read the new firmware program obtained after the chip firmware is upgraded from the boot medium; The chip startup module is used to execute the new firmware program to realize chip startup.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the chip startup method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the chip startup method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Starting method applied to multi-mode IoT device, multi-mode IoT device and storage medium
CN107911816A
Method and device for starting Linux system, equipment and storage medium
CN112612524A
Bootloader updating method and device, equipment and medium
CN115993985A
Firmware upgrading method of graphics processor, terminal equipment and storage medium
CN117971283A
Communication adapter and program update method for communication adapter
US20180367378A1