Firmware download method, device, storage medium and computer equipment
By modifying the Bootloader program in a dual-core system device to automatically forward the second system code, the problem of easy failure of firmware upgrades in the prior art is solved, and the success rate and efficiency of firmware upgrades are improved.
Patent Information
- Application Number
- CN202110271718.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-12
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2041-03-12
AI Technical Summary
In dual-core system equipment, the prior art is prone to failure in firmware downloading due to user forgetting to operate or power outage during firmware upgrade, resulting in failure in the upgrade.
By establishing a connection between the first system chip and the code cache device, using the download tool to download the first system code and modify the Bootloader program, the target Bootloader program is obtained, and then the connection between the first system chip and the second system chip is automatically established, and the second system code is automatically forwarded to the second system chip, avoiding manual input of instructions or automatic matching of the version alone triggering the firmware download of the second system chip.
Improve the success rate of firmware upgrades, avoid firmware download failures caused by forgetting or power outage, simplify the firmware upgrade process, and reduce manual operation errors.
Smart Images

Figure CN115080095B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a firmware downloading method, device, storage medium and computer equipment. Background Art
[0002] For dual-core system devices with a large core system and a small core system, when upgrading the system chip firmware, such devices often need to download the large core code to an embedded multimedia card (eMMC, Embedded Multi Media Card) and download the small core code to the internal or external flash of the small core chip.
[0003] At present, the small core code is often written inside the large core code. The specific download method is to run the download tool to download the large core code to the eMMC, then start the small core download thread mcujlink of the large core chip, read the small core code in the eMMC, and finally download the small core code to the internal and external flash of the small core chip through the JLink port. However, the small core download thread mcujlink needs to be started by manually inputting instructions or automatically matching the version. If it is started by manually inputting instructions, the user may forget to upgrade the small core chip because he or she is prone to forgetting the operation. If it is started by automatically matching the version, the motherboard is not equipped with a battery during the production process, which may cause power failure and upgrade failure. Therefore, when upgrading the firmware using the existing method, the firmware upgrade fails. Summary of the invention
[0004] The embodiments of the present application provide a firmware download method, device, storage medium and equipment, which do not need to trigger the firmware download of the second system chip by manually inputting instructions or automatically matching versions, avoid forgetting to download the firmware of the second system chip or the failure of firmware download due to power failure, and improve the success rate of firmware upgrade. The technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a firmware download method, which is applied to a terminal, wherein the terminal includes a first system chip and at least one second system chip, and the method includes:
[0006] Establishing a connection between the first system chip and the code cache device, and using a download tool to download the first system code in the code cache device to the flash memory module of the first system chip;
[0007] Starting the first system code, and modifying the Bootloader program in the first system chip based on the first system code to obtain a target Bootloader program;
[0008] A connection is established between the first system chip and each of the second system chips based on the target Bootloader program, and the second system code in the code cache device is forwarded to the flash memory module of each of the second system chips via the target Bootloader program using the download tool.
[0009] In a second aspect, an embodiment of the present application provides a firmware downloading device, the firmware downloading device comprising:
[0010] A first module is used to establish a connection between a first system chip and a code cache device, and use a download tool to download a first system code in the code cache device to a flash memory module of the first system chip;
[0011] A program modification module, used for starting the first system code, modifying the Bootloader program in the first system chip based on the first system code, and obtaining a target Bootloader program;
[0012] The second module is used to establish a connection between the first system chip and each of the second system chips based on the target Bootloader program, and use the download tool to forward the second system code in the code cache device to the flash memory module of each of the second system chips through the target Bootloader program.
[0013] In a third aspect, an embodiment of the present application provides a storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0014] In a fourth aspect, an embodiment of the present application provides a computer device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0015] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0016] In the embodiment of the present application, by establishing a connection between the first system chip and the code cache device, the first system code in the code cache device is downloaded to the flash memory module of the first system chip using a download tool, and then the first system code is started, and the Bootloader program in the first system chip is modified based on the first system code to obtain the target Bootloader program, and then the connection between the first system chip and each of the second system chips is established based on the target Bootloader program, and the second system code in the code cache device is forwarded to the flash memory module of each of the second system chips through the target Bootloader program using the download tool. By adopting the embodiment of the present application, the second system code can be automatically forwarded to the second system chip using the modified target Bootloader program in the first system chip during the research and development, testing and production process, without the need to trigger the firmware download of the second system chip separately by manually inputting instructions or automatically matching versions, avoiding forgetting to download the firmware of the second system chip or the failure of the firmware download due to power failure, and improving the success rate of the firmware upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 This is a system architecture diagram of a firmware download method provided in an embodiment of the present application;
[0019] Figure 2 The present invention provides a flowchart of a firmware download method.
[0020] Figure 3 The present invention provides a flowchart of a firmware download method.
[0021] Figure 4 The embodiment of the present application provides an example schematic diagram of downloading a first system code;
[0022] Figure 5 This is an example schematic diagram of a second system code download provided in an embodiment of the present application;
[0023] Figure 6 It is a structural schematic diagram of a firmware downloading device provided in an embodiment of the present application;
[0024] Figure 7It is a structural schematic diagram of a firmware downloading device provided in an embodiment of the present application;
[0025] Figure 8 The present application provides a schematic diagram of the structure of a second code module;
[0026] Fig. 9 A schematic diagram of the structure of a computer device is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0028] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.
[0029] See also Figure 1 , which is a system structure diagram of a firmware download method provided in an embodiment of the present application. Figure 1 As shown, the firmware download method provided in the embodiment of the present application can be applied to the code download of the terminal, and the code is applied to the firmware upgrade. The terminal includes a first system chip and at least one second system chip. The first system chip can use the Qualcomm platform, and the second system chip can be a micro control unit (MCU, Micro Control Unit). The terminal includes but is not limited to mobile phones, personal computers, smart furniture, vehicle-mounted equipment, wearable devices and other terminals with multi-core systems. Figure 1As shown, the system architecture diagram also includes a code cache device, which can be a computer, a mobile phone, or other device that can store code and run a download tool.
[0030] In the embodiment of the present application, a connection between the first system chip and the code cache device is established through a USB virtual serial port, and a download tool is used to download the first system code in the code cache device to the flash memory module of the first system chip, and then a connection between the first system chip and the second system chip is established through a Jlink interface, and a download tool is used to download the second system code in the code cache device to the flash memory modules of each of the second system chips. By adopting the embodiment of the present application, the second system code can be automatically forwarded to the second system chip using the modified target Bootloader program in the first system chip during the research and development, testing and production process, without the need to trigger the firmware download of the second system chip separately by manually inputting instructions or automatically matching versions, thereby avoiding forgetting to download the firmware of the second system chip or the failure of the firmware download due to power failure, and improving the success rate of the firmware upgrade.
[0031] based on Figure 1 The system architecture shown below will be combined with Figure 2 to Figure 5 , the firmware download method provided in the embodiment of the present application is introduced in detail.
[0032] See also Figure 2 , Figure 2 A flowchart of a firmware download method is provided for an embodiment of the present application. Figure 2 As shown, the firmware downloading method may include the following steps S101 to S103.
[0033] S101, establishing a connection between a first system chip and a code cache device, and using a download tool to download a first system code in the code cache device to a flash memory module of the first system chip;
[0034] The code cache device may be a computer, a mobile phone, or other device capable of storing code and running a download tool; the download tool may be an application running on the code cache device, for downloading the first system code stored in the code cache device to a flash memory module of the first system chip.
[0035] The first system chip may be a central processing unit, which may run a first system code to process the most basic and lowest-level work tasks of the system; the first system code refers to a program code fixed to the first system chip, also called firmware.
[0036] The flash memory module refers to a non-volatile memory that can store the first system code. The flash memory module can be located inside or outside the first system chip, such as eMMC flash memory, UFS flash memory, FLASH flash memory, etc.
[0037] Specifically, the first system chip establishes a serial port connection with the code cache device via a USB virtual serial port, and a download tool is run on the code cache device to download the first system code in the code cache device to the flash memory module of the first system chip.
[0038] S102, starting the first system code, and modifying the Bootloader program in the first system chip based on the first system code to obtain a target Bootloader program;
[0039] Specifically, the Bootloader program refers to a small program that boots the operating system, which can initialize hardware devices and establish a mapping map of memory space, thereby bringing the system's hardware and software environment to a suitable state, so as to prepare the correct environment for the final call to the operating system kernel. The first system code pre-writes a code for modifying the Bootloader program, and based on the pre-written code for modifying the Bootloader program, the Bootloader program in the first system chip is modified to obtain a modified target Bootloader program.
[0040] S103, establishing a connection between the first system chip and each of the second system chips based on the target Bootloader program, and using the download tool to forward the second system code in the code cache device to the flash memory module of each of the second system chips via the target Bootloader program.
[0041] Specifically, the second system chip may be a microcontroller unit using an MCU solution, and the second system code refers to a program code fixed to the second system chip, also called firmware;
[0042] The flash memory module refers to a non-volatile memory that can store the second system code. The flash memory module can exist inside or outside the second system chip, such as eMMC flash memory, UFS flash memory, FLASH flash memory, etc.
[0043] In an embodiment of the present application, by establishing a connection between the first system chip and the code cache device, a download tool is used to download the first system code in the code cache device to the flash memory module of the first system chip, and then the first system code is started, and the Bootloader program in the first system chip is modified based on the first system code to obtain the target Bootloader program, and then the connection between the first system chip and each of the second system chips is established based on the target Bootloader program, and the download tool is used to forward the second system code in the code cache device to the flash memory module of each of the second system chips through the target Bootloader program. By adopting the embodiment of the present application, the modified target Bootloader program in the first system chip can be used to automatically forward the second system code to the second system chip during the research and development, testing and production process, without the need to trigger the firmware download of the second system chip separately by manually inputting instructions or automatically matching versions, avoiding forgetting to download the firmware of the second system chip or the failure of the firmware download due to power failure, and improving the success rate of the firmware upgrade.
[0044] See also Figure 3 , Figure 3 A flowchart of a firmware download method is proposed for the embodiment of the present application. Figure 3 As shown, the firmware downloading method may include the following steps S201 to S206.
[0045] S201, starting a USB virtual serial port, and establishing a connection between a first system chip and a code cache device based on the USB virtual serial port;
[0046] Specifically, a connection between the first system chip and the code cache device is established through a USB virtual serial port.
[0047] S202, using a download tool to download the first system code in the code cache device to the flash memory module of the first system chip;
[0048] Specifically, a download tool is run on the code cache device, and the download tool is used to download the first system code in the code cache device to the flash memory module of the first system chip.
[0049] The first system chip may be a single-core central processing unit (CPU) based on a Qualcomm platform, and the flash memory module may be an eMMC chip.
[0050] Please also see Figure 4 , Figure 4 An example schematic diagram of downloading a first system code is provided for the embodiment of the present application. Figure 4 As shown, the first system code is stored in the code cache device, and a download tool is run in the code cache device. The download tool sends the first system code to the first system chip through the USB virtual serial port and stores it in the eMMC chip.
[0051] S203, starting the first system code, and modifying the Bootloader program in the first system chip based on the first system code to obtain a target Bootloader program;
[0052] Specifically, the Bootloader program refers to a small program that boots the operating system, which can initialize hardware devices and establish a mapping map of memory space, thereby bringing the system's software and hardware environment to a suitable state, so as to prepare the correct environment for the final call to the operating system kernel. The first system code pre-writes a code for modifying the Bootloader program, and based on the code for modifying the Bootloader program, the Bootloader program in the first system chip is modified to obtain a modified target Bootloader program.
[0053] S204, starting the target Bootloader program, calling the GPIO interface of the first system chip based on the target Bootloader program and simulating the Jlink protocol;
[0054] Specifically, the target Bootloader program calls the GPIO interface to simulate a Jlink protocol adapted to the Jlink interface; the GPIO interface is also called a general input / output port, which is a port expander integrated in the first system chip.
[0055] S205, establishing a connection between the GPIO interface and the Jlink interface of each of the second system chips based on the Jlink protocol;
[0056] Specifically, the GPIO interface establishes a communication connection with the Jlink interface of each of the second system chips based on the Jlink protocol.
[0057] S206 , using the download tool to forward the second system code in the code cache device to the flash memory modules of each second system chip via the target Bootloader program.
[0058] Specifically, a target second system chip is determined from each of the second system chips, the second system code in the code cache device is forwarded to the flash memory module of the target second system chip via the target Bootloader program using the download tool, the next second system chip among each of the second system chips is determined, the next second system chip is used as the target second system chip, and the step of using the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program is performed. When there is no next second system chip, the download is completed.
[0059] Furthermore, the use of the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program specifically includes: receiving the Multiloader.bin file sent by the code cache device based on the download tool through the USB virtual serial port, forwarding the Multiloader.bin file to the random access memory of the target second system chip via the target Bootloader program, starting the Multiloader.bin file, communicating with the target Bootloader program, generating a communication channel, and forwarding the second system code to the flash memory module of the target second system chip via the target Bootloader program based on the communication channel.
[0060] The second system chip may be an MCU.
[0061] The random access memory is an internal memory that directly exchanges data with the CPU and is usually used as a temporary data storage medium for the operating system or other running programs.
[0062] The flash memory module may be an internal FLASH flash memory of the second system chip.
[0063] Please also see Figure 5 , Figure 5 An example schematic diagram of downloading a second system code is provided for the embodiment of the present application. Figure 5 As shown, the download tool on the code cache device is run, and based on the download tool, the second system code in the code cache device is sent through the USB virtual serial port, the second system code is forwarded to the FLASH flash memory of the second system chip through the target Bootloader program in the first system chip, and the GPIO interface of the first system chip simulates the Jlink protocol and the Jlink interface of the second system chip to realize the Jlink connection.
[0064] In an embodiment of the present application, a connection between a first system chip and a code cache device is established through a USB virtual serial port, and then a download tool is used to download the first system code in the code cache device to a flash memory module of the first system chip, and the Bootloader program in the first system chip is modified based on the downloaded first system code to obtain a target Bootloader program, and a Jlink interface is simulated in the first system chip based on the target Bootloader program, and a Jlink download path is implemented in the first system chip, so that the second system code in the code cache device can be transferred to the second system chip; during the entire firmware download process, the modified target Bootloader program in the first system chip is used to automatically forward the second system code to the second system chip, and there is no need to trigger the firmware download of the second system chip by manually inputting instructions. In the production system, a workstation dedicated to inputting instructions can be reduced, which not only saves labor costs but also improves production efficiency; there is also no need to trigger the firmware download of the second system chip by automatically matching versions; during the research and development and testing process, the method of automatically triggering the firmware download of the second system chip can avoid firmware download failures due to forgetting to download the firmware of the second system chip or due to power failure, thereby improving the success rate of firmware upgrades.
[0065] The following will be combined Figure 6 to Figure 8 , the firmware download device provided in the embodiment of the present application is introduced in detail. It should be noted that, Figure 6 to Figure 8 The firmware download device in is used to execute this application Figure 1 to Figure 5 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 1 to Figure 5 The embodiment shown.
[0066] See also Figure 6 , is a schematic diagram of the structure of a firmware download device provided in an embodiment of the present application. Figure 6 As shown, the firmware downloading device 1 in the embodiment of the present application may include: a first module 101 , a program modification module 102 and a second module 103 .
[0067] The first module 101 is used to establish a connection between a first system chip and a code cache device, and use a download tool to download the first system code in the code cache device to a flash memory module of the first system chip;
[0068] A program modification module 102, configured to start the first system code, modify the Bootloader program in the first system chip based on the first system code, and obtain a target Bootloader program;
[0069] The second module 103 is used to establish a connection between the first system chip and each of the second system chips based on the target Bootloader program, and use the download tool to forward the second system code in the code cache device to the flash memory module of each of the second system chips through the target Bootloader program.
[0070] It should be noted that the firmware download device provided in the above embodiment only uses the division of the above functional modules as an example when executing the firmware download method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the firmware download device provided in the above embodiment and the firmware download method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0071] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0072] In an embodiment of the present application, by establishing a connection between the first system chip and the code cache device, a download tool is used to download the first system code in the code cache device to the flash memory module of the first system chip, and then the first system code is started, and the Bootloader program in the first system chip is modified based on the first system code to obtain the target Bootloader program, and then the connection between the first system chip and each of the second system chips is established based on the target Bootloader program, and the download tool is used to forward the second system code in the code cache device to the flash memory module of each of the second system chips through the target Bootloader program. By adopting the embodiment of the present application, the modified target Bootloader program in the first system chip can be used to automatically forward the second system code to the second system chip during the research and development, testing and production process, without the need to trigger the firmware download of the second system chip separately by manually inputting instructions or automatically matching versions, avoiding forgetting to download the firmware of the second system chip or the failure of the firmware download due to power failure, and improving the success rate of the firmware upgrade.
[0073] See also Figure 7 , is a schematic diagram of the structure of a firmware download device provided in an embodiment of the present application. Figure 7 As shown, the firmware downloading device 2 of the embodiment of the present application may include: a virtual serial port module 201 , a first code module 202 , a program modification module 203 , a protocol simulation module 204 , a Jlink connection module 205 and a second code module 206 .
[0074] A virtual serial port module 201 is used to start a USB virtual serial port and establish a connection between the first system chip and the code cache device based on the USB virtual serial port;
[0075] A first code module 202, configured to use a download tool to download the first system code in the code cache device to a flash memory module of the first system chip;
[0076] A program modification module 203, used for starting the first system code, modifying the Bootloader program in the first system chip based on the first system code, and obtaining a target Bootloader program;
[0077] The protocol simulation module 204 is used to start the target Bootloader program, call the GPIO interface of the first system chip based on the target Bootloader program and simulate the Jlink protocol;
[0078] A Jlink connection module 205, used for establishing a connection between the GPIO interface and the Jlink interface of each second system chip based on the Jlink protocol;
[0079] The second code module 206 is used to use the download tool to forward the second system code in the code cache device to the flash memory modules of each second system chip via the target Bootloader program.
[0080] Please also see Figure 8 , Figure 8 A schematic diagram of the structure of a second code module is provided for an embodiment of the present application. Figure 8 As shown, the second code module 206 may include:
[0081] A target determining unit 2061, configured to determine a target second system chip from each of the second system chips;
[0082] A code download unit 2062, configured to use the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program;
[0083] The step execution unit 2063 is used to determine the next second system chip in each of the second system chips, take the next second system chip as the target second system chip, and execute the step of using the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program;
[0084] The download ending unit 2064 is used to complete the downloading when there is no next second system chip.
[0085] It should be noted that the firmware download device provided in the above embodiment only uses the division of the above functional modules as an example when executing the firmware download method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the firmware download device provided in the above embodiment and the firmware download method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0086] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0087] In an embodiment of the present application, a connection between a first system chip and a code cache device is established through a USB virtual serial port, and then a download tool is used to download the first system code in the code cache device to a flash memory module of the first system chip, and the Bootloader program in the first system chip is modified based on the downloaded first system code to obtain a target Bootloader program, and a Jlink interface is simulated in the first system chip based on the target Bootloader program, and a Jlink download path is implemented in the first system chip, so that the second system code in the code cache device can be transferred to the second system chip; during the entire firmware download process, the modified target Bootloader program in the first system chip is used to automatically forward the second system code to the second system chip, and there is no need to trigger the firmware download of the second system chip by manually inputting instructions. In the production system, a workstation dedicated to inputting instructions can be reduced, which not only saves labor costs but also improves production efficiency; there is also no need to trigger the firmware download of the second system chip by automatically matching versions; during the research and development and testing process, the method of automatically triggering the firmware download of the second system chip can avoid firmware download failures due to forgetting to download the firmware of the second system chip or due to power failure, thereby improving the success rate of firmware upgrades.
[0088] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 1 to Figure 5 The firmware download method of the embodiment shown in the figure can be found in the specific execution process. Figure 1 to Figure 5 The specific description of the illustrated embodiment will not be repeated here.
[0089] See also Fig. 9 , which is a schematic diagram of the structure of a computer device according to an embodiment of the present application. Fig. 9As shown, the computer device 1000 may include: at least one processor 1001, at least one memory 1002, at least one network interface 1003, at least one input and output interface 1004, at least one communication bus 1005 and at least one display unit 1006. Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect the various parts of the entire computer device 1000, and executes various functions and processes data of the terminal 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1002, and calling data stored in the memory 1002. The memory 1002 can be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1002 can optionally be at least one storage device located away from the aforementioned processor 1001. Among them, the network interface 1003 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The communication bus 1005 is used to realize the connection and communication between these components. As Fig. 9 As shown, the memory 1002 as a storage medium of a terminal device may include an operating system, a network communication module, an input / output interface module, and a firmware download program.
[0090] exist Fig. 9 In the computer device 1000 shown, the input and output interface 1004 is mainly used to provide an input interface for the user and the access device, and to obtain data input by the user and the access device.
[0091] In one embodiment.
[0092] The processor 1001 may be used to call the firmware download program stored in the memory 1002, and specifically perform the following operations:
[0093] Establishing a connection between the first system chip and the code cache device, and using a download tool to download the first system code in the code cache device to the flash memory module of the first system chip;
[0094] Starting the first system code, and modifying the Bootloader program in the first system chip based on the first system code to obtain a target Bootloader program;
[0095] A connection is established between the first system chip and each of the second system chips based on the target Bootloader program, and the second system code in the code cache device is forwarded to the flash memory module of each of the second system chips via the target Bootloader program using the download tool.
[0096] Optionally, when executing the establishment of the connection between the first system chip and the code cache device, the processor 1001 specifically performs the following operations:
[0097] The USB virtual serial port is started, and a connection between the first system chip and the code cache device is established based on the USB virtual serial port.
[0098] Optionally, when executing the process of establishing a connection between the first system chip and each of the second system chips based on the target Bootloader program, the processor 1001 specifically performs the following operations:
[0099] Starting the target Bootloader program, calling the GPIO interface of the first system chip based on the target Bootloader program and simulating the Jlink protocol;
[0100] A connection between the GPIO interface and the Jlink interface of each of the second system chips is established based on the Jlink protocol.
[0101] Optionally, when executing the step of using the download tool to forward the second system code in the code cache device to the flash memory modules of each second system chip via the target Bootloader program, the processor 1001 specifically performs the following operations:
[0102] determining a target second system chip from each of the second system chips;
[0103] Using the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program;
[0104] Determine the next second system chip in each of the second system chips, use the next second system chip as the target second system chip, and perform the step of using the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program;
[0105] When there is no next second system chip, the downloading is completed.
[0106] Optionally, when executing the step of using the download tool to download the second system code in the code cache device to the flash memory module of the target second system chip, the processor 1001 specifically performs the following operations:
[0107] The code cache device receives a Multiloader.bin file sent by the download tool through the USB virtual serial port, and the Multiloader.bin file is forwarded to the random access memory of the target second system chip through the target Bootloader program;
[0108] Start the Multiloader.bin file, communicate with the target Bootloader program, and generate a communication channel;
[0109] The second system code is forwarded to the flash memory module of the target second system chip via the target Bootloader program based on the communication channel.
[0110] In an embodiment of the present application, a connection between a first system chip and a code cache device is established through a USB virtual serial port, and then a download tool is used to download the first system code in the code cache device to a flash memory module of the first system chip, and the Bootloader program in the first system chip is modified based on the downloaded first system code to obtain a target Bootloader program, and a Jlink interface is simulated in the first system chip based on the target Bootloader program, and a Jlink download path is implemented in the first system chip, so that the second system code in the code cache device can be transferred to the second system chip; during the entire firmware download process, the modified target Bootloader program in the first system chip is used to automatically forward the second system code to the second system chip, and there is no need to trigger the firmware download of the second system chip by manually inputting instructions. In the production system, a workstation dedicated to inputting instructions can be reduced, which not only saves labor costs but also improves production efficiency; there is also no need to trigger the firmware download of the second system chip by automatically matching versions; during the research and development and testing process, the method of automatically triggering the firmware download of the second system chip can avoid firmware download failures due to forgetting to download the firmware of the second system chip or due to power failure, thereby improving the success rate of firmware upgrades.
[0111] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0112] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A firmware downloading method, characterized in that: Applied to a terminal, the terminal includes a first system chip and at least one second system chip, and the method includes: Establishing a connection between the first system chip and the code cache device, and using a download tool to download the first system code in the code cache device to the flash memory module of the first system chip; Starting the first system code, and modifying the Bootloader program in the first system chip based on the first system code to obtain a target Bootloader program; Starting the target Bootloader program, calling the GPIO interface of the first system chip based on the target Bootloader program and simulating the Jlink protocol; Establishing a connection between the GPIO interface and the Jlink interface of each second system chip based on the Jlink protocol; determining a target second system chip from each of the second system chips; Using the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program; Determine the next second system chip in each of the second system chips, use the next second system chip as the target second system chip, and perform the step of using the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program; When there is no next second system chip, the downloading is completed.
2. The firmware download method according to claim 1, characterized in that: The establishing a connection between the first system chip and the code cache device includes: The USB virtual serial port is started, and a connection between the first system chip and the code cache device is established based on the USB virtual serial port.
3. The firmware download method according to claim 1, characterized in that: The step of using the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program includes: The code cache device receives a Multiloader.bin file sent by the download tool through the USB virtual serial port, and the Multiloader.bin file is forwarded to the random access memory of the target second system chip through the target Bootloader program; Start the Multiloader.bin file, communicate with the target Bootloader program, and generate a communication channel; The second system code is forwarded to the flash memory module of the target second system chip via the target Bootloader program based on the communication channel.
4. A firmware downloading device, characterized in that: The firmware downloading device comprises: A first module is used to establish a connection between a first system chip and a code cache device, and use a download tool to download a first system code in the code cache device to a flash memory module of the first system chip; A program modification module, used for starting the first system code, modifying the Bootloader program in the first system chip based on the first system code, and obtaining a target Bootloader program; The second module is used to start the target Bootloader program, call the GPIO interface of the first system chip based on the target Bootloader program and simulate the Jlink protocol; establish a connection between the GPIO interface and the Jlink interface of each second system chip based on the Jlink protocol; determine the target second system chip from each second system chip; use the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program; determine the next second system chip in each second system chip, use the next second system chip as the target second system chip, and execute the step of using the download tool to forward the second system code in the code cache device to the flash memory module of the target second system chip via the target Bootloader program; when there is no next second system chip, the download is completed.
5. The firmware downloading device according to claim 4, characterized in that: The first module includes: A connection establishing unit, used for starting a USB virtual serial port, and establishing a connection between the first system chip and the code cache device based on the USB virtual serial port; The first code unit is used to download the first system code in the code cache device to the flash memory module of the first system chip by using a download tool.
6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the firmware download method according to any one of claims 1 to 3 is implemented.
7. A computer device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
multiprocessor firmware online mutual updating method under a VPX architecture
CN109656605A
Internet of Things Wifi loaded multi-MCU upgrading method and device, equipment and medium
CN111831309A