Firmware updating method and device, electronic equipment, storage medium and program product

By controlling the startup mode of the digital signal processor and the normal operation of the loading program through a microcontroller, the stability of the firmware to be updated is ensured, which solves the problems of unstable and complex firmware updates in the prior art and improves the success rate of updates.

CN121900787APending Publication Date: 2026-04-21HUIZHOU DESAY SV AUTOMOTIVE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUIZHOU DESAY SV AUTOMOTIVE
Filing Date
2025-12-31
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In the prior art, the firmware update process of digital signal processors is unstable and relies on the bootloader within the digital signal processor, which makes the upgrade process complicated.

Method used

The microcontroller controls the digital signal processor to boot from a slave device, writes the loading program and determines its running status. Under normal operating conditions, the program data is written to the firmware to be updated, thus achieving stable control of firmware updates by the microcontroller.

Benefits of technology

It improves the success rate and stability of firmware updates and simplifies the upgrade process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121900787A_ABST
    Figure CN121900787A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware updating method and device, electronic equipment, a storage medium and a program product. The specific implementation scheme comprises the following steps: controlling the starting mode of the digital signal processor to be a slave device starting mode; in the slave device starting mode, writing a loading program contained in the microcontroller into the digital signal processor, and determining a program running state of the loading program; under the condition that the program running state is normal running, program data are written into the firmware to be updated corresponding to the digital signal processor. The starting mode of the digital signal processor is controlled through the microcontroller, the loading program is sent to the digital signal processor, the stability of the to-be-updated firmware during updating is ensured, program data are written into the to-be-updated firmware under the condition that the program operation state is normal operation, the purpose that the microcontroller controls updating of the to-be-updated firmware is achieved, and the updating efficiency of the to-be-updated firmware is improved. And the updating success rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a firmware update method, apparatus, electronic device, storage medium, and program product. Background Technology

[0002] In existing technologies, upgrading the program of a digital signal processor (DSP) typically involves utilizing the DSP's serial peripheral interface and multiplexer, combined with an automatic upgrade algorithm, to achieve online upgrades. Alternatively, a handshake and feedback instruction mechanism using a dual-chip system can be employed to handle unexpected situations during the upgrade process using backup program files. Furthermore, the DSP software's target file is converted into a data file and written to the DSP's on-chip firmware using protocol framing.

[0003] However, using multiplexers increases device costs, while dual-chip systems rely on a bootloader during the basic input / output system startup to handle unexpected situations during upgrades. This results in the microcontroller being unable to fully control the digital signal processor's update process, leading to poor stability during upgrades. Furthermore, the digital signal processor's ability to receive data files and update its on-chip firmware depends on its internal bootloader, making software upgrades more complex. Summary of the Invention

[0004] This invention provides a firmware update method, apparatus, electronic device, storage medium, and program product to enable the firmware update process of a digital signal processor to be controlled by a microcontroller, thereby ensuring the stability of the firmware update process.

[0005] According to one aspect of the present invention, a firmware update method is provided, applied to a microcontroller connected to a digital signal processor, the method comprising:

[0006] The startup mode of the digital signal processor is controlled to be a slave device startup mode, which indicates that the firmware corresponding to the digital signal processor needs to be updated.

[0007] In the slave device boot mode, the loader contained in the microcontroller is written into the digital signal processor, and the program running status of the loader is determined, the program running status indicating whether the loader is running normally in the digital signal processor;

[0008] When the program is running normally, program data is written into the firmware to be updated corresponding to the digital signal processor. The program data includes the data that needs to be written into the firmware to be updated as indicated by the microcontroller. The program data is used to update the firmware to be updated.

[0009] According to another aspect of the present invention, a firmware update method is provided, applied to a digital signal processor, the digital signal processor being connected to a microcontroller, the method comprising:

[0010] Under the control of the microcontroller, the boot mode is set to slave device boot mode, which indicates that the firmware corresponding to the digital signal processor needs to be updated.

[0011] The loading program written by the microcontroller is run, and the program running status of the loading program is read by the microcontroller. The program running status indicates whether the loading program is running normally in the digital signal processor.

[0012] The microcontroller receives program data written by itself and converts the program data into a data write instruction. The program data is used to update the firmware to be updated. The program data includes data sent by the microcontroller when the memory of the firmware to be updated is not occupied.

[0013] The data writing instruction is sent to the firmware to be updated.

[0014] According to another aspect of the present invention, a firmware update apparatus is provided, characterized in that it is configured in a microcontroller, the microcontroller being connected to a digital signal processor, and comprising:

[0015] The control module is used to control the startup mode of the digital signal processor to be a slave device startup mode, wherein the slave device startup mode indicates that the firmware corresponding to the digital signal processor needs to be updated.

[0016] The determination module is used to write the loader included in the microcontroller into the digital signal processor in the slave device boot mode, and determine the program running status of the loader, wherein the program running status indicates whether the loader is running normally in the digital signal processor;

[0017] The writing module is used to write program data into the firmware to be updated corresponding to the digital signal processor when the program is running normally. The program data includes the data that needs to be written into the firmware to be updated as indicated by the microcontroller. The program data is used to update the firmware to be updated.

[0018] According to another aspect of the present invention, a firmware update apparatus is provided, characterized in that it is configured in a digital signal processor, the digital signal processor being connected to a microcontroller, and comprising:

[0019] The setting module is used to set the boot mode to slave device boot mode under the control of the microcontroller, wherein the slave device boot mode indicates that the firmware corresponding to the digital signal processor needs to be updated.

[0020] The running module is used to run a loading program written by the microcontroller. The program running status of the loading program is available for the microcontroller to read, and the program running status indicates whether the loading program is running normally in the digital signal processor.

[0021] A receiving module is used to receive program data written by the microcontroller and convert the program data into data writing instructions. The program data is used to update the firmware to be updated. The program data includes data sent by the microcontroller when the memory of the firmware to be updated is not occupied.

[0022] The sending module is used to send the data writing instruction to the firmware to be updated.

[0023] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0024] At least one processor; and

[0025] A memory communicatively connected to the at least one processor; wherein,

[0026] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the firmware update method according to any embodiment of the present invention.

[0027] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the firmware update method according to any embodiment of the present invention.

[0028] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the firmware update method described in any embodiment of the present invention.

[0029] The technical solution of this invention controls the startup mode of the digital signal processor to a slave device startup mode. In this slave device startup mode, a loading program contained in the microcontroller is written into the digital signal processor, and the program running state of the loading program is determined. When the program running state is normal operation, program data is written into the firmware to be updated corresponding to the digital signal processor. By controlling the startup mode of the digital signal processor through the microcontroller and sending the loading program to the digital signal processor, the stability of the firmware update is ensured. When the program running state is normal operation, program data is written into the firmware to be updated, realizing microcontroller-controlled firmware update and improving the update success rate.

[0030] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a flowchart of a firmware update method for a microcontroller according to Embodiment 1 of the present invention;

[0033] Figure 2 This is an architecture diagram of a firmware update system provided according to Embodiment 1 of the present invention;

[0034] Figure 3 This is a flowchart of a program data writing method provided in Embodiment 1 of the present invention;

[0035] Figure 4 This is a flowchart of a state determination method provided according to Embodiment 2 of the present invention;

[0036] Figure 5 This is a flowchart of a firmware update method for a digital signal processor according to Embodiment 3 of the present invention;

[0037] Figure 6 This is a flowchart of a program execution method provided in Embodiment 4 of the present invention;

[0038] Figure 7 This is a schematic diagram of a firmware update device for a microcontroller according to Embodiment 5 of the present invention;

[0039] Figure 8 This is a schematic diagram of a firmware update device for a digital signal processor according to Embodiment Six of the present invention;

[0040] Figure 9 This is a block diagram of an electronic device provided according to Embodiment Seven of the present invention. Detailed Implementation

[0041] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0042] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0043] Example 1

[0044] Figure 1 This is a flowchart of a firmware update method for a microcontroller according to Embodiment 1 of the present invention. This embodiment is applicable to situations where firmware is updated. The method can be executed by a firmware update device, which can be implemented in hardware and / or software. The firmware update device can be configured in an electronic device, which can be equipped with a microcontroller. Figure 1 As shown, the method includes:

[0045] S110. Control the startup mode of the digital signal processor to slave device startup mode.

[0046] The slave device boot mode indicates that the firmware corresponding to the digital signal processor needs to be updated.

[0047] In this embodiment, a digital signal processor (DSP) can be understood as a chip capable of performing digital signal processing, and the DSP can be controlled by a microcontroller. A microcontroller can be understood as a device used to update the firmware on the DSP; a microcontroller can be a miniature computer device. A boot mode can be understood as information used to determine the operating state of the DSP; the boot mode can indicate that the DSP is in a firmware update mode or in a normal operating state. A device boot mode indicates that the firmware connected to the DSP needs to be updated. The firmware to be updated can be understood as external firmware connected to the DSP, and the firmware to be updated can be connected to the DSP through multiple sets of serial peripheral interfaces.

[0048] Specifically, the microcontroller is connected to the digital signal processor (DSP) via serial peripheral interfaces and general purpose input / output (GPIO), and the DSP is connected to the firmware to be updated via multiple sets of serial peripheral interfaces. When the microcontroller determines that the firmware of the DSP needs to be updated, it sets the boot mode of the DSP to slave device boot mode via GPIO, and the firmware update is performed in this slave device boot mode.

[0049] For example, Figure 2 This is an architecture diagram of a firmware update system provided according to Embodiment 1 of the present invention. Figure 2 As shown, the microcontroller (MCU) and digital signal processor (DSP) are connected via the serial peripheral interface (SPI) and general purpose input / output (GPIO1 and GPIO2). The DSP is connected to the firmware SPI Flash to be updated via multiple sets of xSPI serial peripheral interfaces, and the DSP's Reset pin is set low. The xSPI data signals can be 1, 4, or 8 sets, etc. When the microcontroller determines that the firmware of the DSP needs to be updated, it controls the DSP's BootMode to slave mode via GPIO1 and GPIO2 and releases the Reset pin.

[0050] S120. In the slave device boot mode, the loading program contained in the microcontroller is written into the digital signal processor, and the program running status of the loading program is determined.

[0051] The program running status indicates whether the loading program is running normally in the digital signal processor.

[0052] In this embodiment, the loader can be understood as a program designed according to specific requirements, and the loader can be written into the digital signal processor. The program running status can be understood as an indication of whether the loader is running normally in the digital signal processor.

[0053] Specifically, when the digital signal processor (DSP) is booted in slave mode, it can operate in a read-only memory (ROM) boot mode. A loader can be sent to the DSP, and the program running in the DSP writes the loader into its ROM. The loader is controlled to run on the DSP's ROM, and its execution status is read.

[0054] For example, in device boot mode, such as Figure 2 As shown, the DSP can receive data sent by the MCU via SPI. The microcontroller MCU can send the loader program (i.e., the loader program) to the digital signal processor DSP via SPI. Then, the microcontroller MCU triggers the loader program to run and reads the program running status of the loader program via SPI.

[0055] S130. When the program is running normally, write the program data into the firmware to be updated corresponding to the digital signal processor.

[0056] The program data includes data that needs to be written to the firmware to be updated, as indicated by the microcontroller, and the program data is used to update the firmware to be updated.

[0057] In this embodiment, program data can be understood as data used to update the firmware to be updated. Program data can be data indicated by the microcontroller, data stored in the microcontroller, or data read by the microcontroller from an external device.

[0058] Specifically, if the program is running normally, it means that the microcontroller can control the digital signal processor normally. That is, the digital signal processor can convert program data into instructions, and use the instructions to write the program data into the firmware to be updated corresponding to the digital signal processor.

[0059] For example, such as Figure 2 As shown, the microcontroller (MCU) can read the status register of the digital signal processor (DSP) via SPI to determine the program execution status of the Loader program. When the program is running normally, the MCU sends program data to the DSP via SPI, and the DSP writes the program data into the SPI Flash of the firmware to be updated. The MCU then determines whether there is any more program data to be written to the firmware. If not, it sets the DSP to exit slave device boot mode and releases the Reset pin, allowing the DSP to enter normal operating mode.

[0060] The technical solution of this invention controls the startup mode of the digital signal processor to a slave device startup mode. In this slave device startup mode, a loading program contained in the microcontroller is written into the digital signal processor, and the program running state of the loading program is determined. When the program running state is normal operation, program data is written into the firmware to be updated corresponding to the digital signal processor. By controlling the startup mode of the digital signal processor through the microcontroller and sending the loading program to the digital signal processor, the stability of the firmware update is ensured. When the program running state is normal operation, program data is written into the firmware to be updated, realizing microcontroller-controlled firmware update and improving the update success rate.

[0061] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.

[0062] In one embodiment, writing program data into the firmware to be updated corresponding to the digital signal processor includes:

[0063] Determine program data and at least one program data packet contained in the program data, the program data packet including data stored in the microcontroller;

[0064] Send an erase command to the firmware to be updated, the erase command being used to control the firmware to be updated to perform an erase operation;

[0065] The memory field of the digital signal processor is read. When the busy flag in the memory field is cleared, the program data packet is written into the firmware to be updated corresponding to the digital signal processor for each program data packet. The busy flag indicates that the memory of the firmware to be updated is occupied.

[0066] In this embodiment, a program data packet can be understood as a data packet contained within program data, and the program data packet can be a data packet decomposed from program data. An erase command can be understood as a command used to control the firmware to be updated to perform an erase operation; the erase command can be sent by the microcontroller. A memory field can be understood as a field used to store the memory occupancy status of the firmware to be updated; the memory field can be stored in the random access memory of the digital signal processor. A busy flag can be understood as a flag indicating that the memory of the firmware to be updated is occupied.

[0067] Specifically, the process involves identifying the program data and at least one program data packet derived from the program data. When the program is running normally, the microcontroller sends an erase command to the digital signal processor (DSP). The DSP can then convert this erase command into an erase command for the firmware to be updated and send it to the firmware. The erase command is executed on the firmware to be updated, i.e., the firmware is controlled to perform an erase operation. The microcontroller reads the DSP's memory field, which stores the memory usage status of the firmware to be updated. When the busy flag in the memory field is cleared, each program data packet contained in the program data is sequentially written into the corresponding firmware to be updated. After each program data packet is written to the firmware, the DSP's memory field is read, and the next program data packet is written only after the busy flag in the memory field is cleared.

[0068] For example, Figure 3 This is a flowchart of a program data writing method provided according to Embodiment 1 of the present invention. Figure 3 As shown, the microcontroller (MCU) reads the status register of the digital signal processor (DSP) via SPI to determine whether the Loader program is running and to ascertain the program's running status. If the program is running normally, the MCU sends an erase command to the DSP. The parameters of the erase command are the start address (start_addr) and the length (length). The DSP receives the erase command and converts it into an erase command for the SPI Flash of the firmware to be updated. The MCU periodically reads the memory usage status of the SPI Flash and updates it in the DSP's memory field. The MCU reads the DSP's memory field until the busy flag is cleared. Then, the MCU can read the program data packets contained in the program data. For each program data packet, it writes it into the SPI Flash of the firmware to be updated and continues reading the DSP's memory field. It continues writing the next program data packet only when the busy flag is cleared. The MCU reads the remaining bytes of the program data; if no bytes remain, it means that all program data has been written to the firmware to be updated.

[0069] Optionally, after writing the program data packet into the firmware to be updated corresponding to the digital signal processor, the method further includes:

[0070] Determine the writing order of each program data packet when it is written to the firmware to be updated;

[0071] The write data in the firmware to be updated is read according to the writing order, and the write data verification value of the write data is determined. The write data includes the program data written by the microcontroller into the firmware to be updated.

[0072] Determine the program data verification value of the program data stored in the microcontroller;

[0073] If the written data verification value is the same as the program data verification value, then the verification result is determined to be a successful verification.

[0074] Otherwise, the verification result will be determined as a verification failure;

[0075] Output the verification result.

[0076] In this embodiment, the writing order can be understood as the order in which the program data packets contained in the program data are written to the firmware to be updated when the microcontroller writes them. The written data can be understood as the data written by the microcontroller to the firmware to be updated. The written data checksum can be understood as a checksum calculated on the written data. The program data checksum can be understood as a checksum of the program data, which can be calculated based on the program data or stored in the microcontroller.

[0077] Specifically, when writing each program data packet to the firmware to be updated, the write address can be determined, and the write order can be obtained based on the write address corresponding to each program data packet. The microcontroller reads the write data in the firmware to be updated according to the write order and calculates the write data checksum. The microcontroller then determines the program data checksum of the program data stored in it. If the write data checksum matches the program data checksum, the checksum is considered passed; otherwise, the checksum is considered failed. After obtaining the checksum, the microcontroller outputs the checksum, which can be fed back to the device that provided the program data.

[0078] For example, such as Figure 3 As shown, the DSP receives the read command sent by the MCU, reads the write data from the SPI Flash and returns it to the MCU. The MCU calculates the write data checksum and determines whether the write data checksum is the same as the program data checksum. The microcontroller MCU can calculate the write data checksum using the CRC32 checksum calculation method. The program data checksum can be the checksum sent to the microcontroller MCU by the device providing the program data.

[0079] In one embodiment, the startup mode of the digital signal processor is a slave device startup mode, including:

[0080] Receive a flashing command, wherein the flashing command indicates whether to update the firmware to be updated;

[0081] If the flashing command indicates that the firmware to be updated needs to be updated, then the startup mode of the digital signal processor is controlled to be the slave device startup mode;

[0082] Otherwise, the startup mode of the digital signal processor is controlled to be the master device startup mode.

[0083] In this embodiment, the flashing command can be understood as an instruction initiated by the device providing program data. This flashing command can be sent to the microcontroller, indicating that the firmware to be updated needs to be updated. The master device boot mode indicates that the digital signal processor is in a normal working state.

[0084] Specifically, the microcontroller (MCU) receives a flash command and determines the program data provided by the flash command. If the flash command indicates that the firmware to be updated needs to be updated, the MCU sets the boot mode of the digital signal processor (DSP) to slave boot mode via general-purpose input / output (GPIO); otherwise, it sets the boot mode of the DSP to master boot mode via GPIO.

[0085] For example, such as Figure 2 As shown, if the flashing command indicates that the firmware to be updated needs to be updated, the boot mode of the digital signal processor (DSP) is controlled to slave boot mode via GPIO1 and GPIO2; otherwise, the boot mode of the DSP is controlled to master boot mode via GPIO1 and GPIO2. In master boot mode, the DSP and SPI Flash are connected via xSPI. The DSP reads program data from the SPI Flash and starts booting. The microcontroller (MCU) communicates with the DSP via SPI.

[0086] Example 2

[0087] Figure 4 This is a flowchart of a state determination method according to Embodiment 2 of the present invention. This embodiment focuses on the method for determining the program running state in the above embodiments. Figure 4 As shown, the method includes:

[0088] S210. Control the startup mode of the digital signal processor to slave device startup mode.

[0089] S220. In the slave device startup mode, the program running in the digital signal processor is determined to be a firmware startup program.

[0090] In this embodiment, the firmware startup program can be understood as a program running in the digital signal processor from the device startup mode. The firmware startup program may be a program related to starting the read-only memory.

[0091] For example, in slave device boot mode, the microcontroller (MCU) communicates with the digital signal processor (DSP) via SPI and makes the program running on the DSP a bootrom program, i.e., a firmware boot program.

[0092] S230, The loader contained in the microcontroller is sent to the digital signal processor.

[0093] The loading program is stored in the random access memory of the digital signal processor via the firmware startup program.

[0094] Specifically, the microcontroller sends the loader to the digital signal processor (DSP), where a firmware startup program running on the DSP can store the loader in the DSP's random access memory (RAM).

[0095] For example, the microcontroller (MCU) sends the Loader program to the digital signal processor (DSP) via SPI, and the DSP's Bootrom program writes the Loader program into the DSP's random access memory (RAM). The Loader program consists of multiple data packets, specifying the starting address and length of each data packet to be stored in the DSP's RAM.

[0096] S240. Control the loading program to run in the digital signal processor, and read the program running status of the loading program.

[0097] Specifically, the microcontroller can control the loader to run in the digital signal processor and read the program running status of the loader through the serial peripheral interface.

[0098] Optionally, controlling the loading program to run in the digital signal processor and reading the program running status of the loading program includes:

[0099] Send a program execution instruction to the digital signal processor, the program execution instruction being used to trigger the loaded program to run in the digital signal processor;

[0100] Read the program running status of the loader.

[0101] In this embodiment, the program execution instruction can be understood as an instruction used to trigger the execution of the loading program, and the program execution instruction can be an instruction initiated by the microcontroller.

[0102] For example, the microcontroller (MCU) sends program execution instructions to the digital signal processor (DSP). The DSP executes these instructions to trigger the loader program to run, and reads the loader program's running status via SPI. If the program is running normally, the program data is written to the SPI Flash of the firmware to be updated on the DSP.

[0103] S250. When the program is running normally, write the program data into the firmware to be updated corresponding to the digital signal processor.

[0104] The technical solution of this invention involves determining that the program running in the digital signal processor (DSP) is a firmware boot program in the slave device boot mode; sending the loading program contained in the microcontroller to the DSP; controlling the loading program to run in the DSP; and reading the program running status of the loading program. By sending the loading program to the DSP through the microcontroller, the loading program runs in the DSP and its running status is read, ensuring stability during firmware updates.

[0105] Example 3

[0106] Figure 5 This is a flowchart of a firmware update method for a digital signal processor according to Embodiment 3 of the present invention. This embodiment is applicable to situations where firmware is updated. The method can be executed by a firmware update device, which can be implemented in hardware and / or software. The firmware update device can be configured in an electronic device, which can be equipped with a digital signal processor. Figure 5 As shown, the method includes:

[0107] S310. Under the control of the microcontroller, the startup mode is set to the device startup mode.

[0108] The slave device boot mode indicates that the firmware corresponding to the digital signal processor needs to be updated.

[0109] Specifically, the microcontroller is connected to the digital signal processor (DSP) via serial peripheral interfaces and general purpose input / output (GPIO), and the DSP is connected to the firmware to be updated via multiple sets of serial peripheral interfaces. When the microcontroller determines that the firmware of the DSP needs to be updated, it sets the DSP's boot mode to slave boot mode.

[0110] For example, such as Figure 3 As shown, the DSP initializes the SPI interface connected to the MCU. When the microcontroller determines that the firmware of the digital signal processor needs to be updated, it controls the boot mode of the DSP to slave mode via GPIO1 and GPIO2.

[0111] S320. Run the loader written through the microcontroller.

[0112] The program running status of the loader is read by the microcontroller, and the program running status indicates whether the loader is running normally in the digital signal processor.

[0113] Specifically, when the digital signal processor (DSP) is booted from a slave device, it operates in a read-only memory (ROM) boot mode. In this mode, the DSP can receive a loader written by the microcontroller and write it into its own random access memory (RAM). The microcontroller can then control the loader to run on the RAM and read its execution status.

[0114] S330: Receive program data written by the microcontroller and convert the program data into a data write instruction.

[0115] The program data is used to update the firmware to be updated, and the program data includes data sent by the microcontroller when the memory of the firmware to be updated is not occupied.

[0116] In this embodiment, the data write instruction can be understood as an instruction obtained by converting program data through a digital signal processor. The data write instruction is used to write program data into the firmware to be updated.

[0117] Specifically, when the microcontroller reads that the program is running normally, the program data written by the microcontroller is received, and the digital signal processor converts the program data into data write instructions.

[0118] S340. Send the data writing instruction to the firmware to be updated.

[0119] Specifically, when the memory of the firmware to be updated is not occupied, this instruction is used to write program data into the firmware corresponding to the digital signal processor.

[0120] For example, such as Figure 3As shown, the digital signal processor (DSP) converts program data into data write instructions and writes these instructions into the SPI Flash of the firmware to be updated. Executing the data write instructions on the SPI Flash of the firmware to be updated will update the firmware's SPI Flash.

[0121] The technical solution of this invention involves setting the boot mode to slave device boot mode under the control of the microcontroller; running a loading program written by the microcontroller; receiving program data written by the microcontroller and converting the program data into data write instructions; and sending the data write instructions to the firmware to be updated. By controlling the boot mode of the digital signal processor (DSP) to slave device boot mode through the microcontroller and running the loading program written by the microcontroller, the stability of the firmware update is ensured. When the microcontroller reads that the program running status is normal, the DSP receives the program data sent by the microcontroller and writes the program data to the firmware to be updated. This achieves microcontroller-controlled firmware update, improving the update success rate.

[0122] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.

[0123] In one embodiment, receiving program data written by the microcontroller and converting the program data into data write instructions includes:

[0124] The microcontroller sends an erase command, which is used to control the firmware to be updated to perform an erase operation.

[0125] The erase command is converted into a firmware erase command, and the firmware erase command is sent to the firmware to be updated;

[0126] Read the busy status of the firmware to be updated and store the busy status in the memory field of the digital signal processor. The busy status includes whether the memory of the firmware to be updated is occupied.

[0127] Receive at least one program data packet contained in the program data written by the microcontroller;

[0128] For each program data packet, the program data packet is converted into a data write instruction.

[0129] In this embodiment, the firmware erase instruction can be understood as an instruction converted by the digital signal processor from the erase instruction sent by the microcontroller. The firmware erase instruction can be sent to the firmware to be updated. The busy state can be understood as an indication of whether the memory of the firmware to be updated is occupied. The busy state includes a busy flag. When the busy flag is cleared, it indicates that the memory of the firmware to be updated is not occupied.

[0130] Specifically, when the microcontroller determines that the program is running normally, the digital signal processor (DSP) receives an erase command from the microcontroller. The DSP converts the erase command into a firmware erase command and sends it to the firmware to be updated. The DSP begins reading the busy status of the firmware to be updated and stores the busy status in its memory field. At this time, the microcontroller reads the DSP's memory field. When the memory field indicates that the busy flag has been cleared, meaning the memory of the firmware to be updated is not occupied, the microcontroller receives at least one program data packet contained in the program data written by the microcontroller. For each program data packet, the DSP converts the program data packet into a data write command.

[0131] For example, such as Figure 3 As shown, the DSP receives the erase command and converts it into a firmware erase command for the SPI Flash. It periodically reads the status of the SPI Flash and stores the status in a memory field. When the memory field indicates that the memory for the firmware to be updated is not occupied, the DSP receives the program data packet contained in the program data and converts the program data packet into a data write command for the SPI Flash. It periodically reads the status of the SPI Flash and stores the status in a memory field.

[0132] Example 4

[0133] Figure 6 This is a flowchart of a program execution method according to Embodiment 4 of the present invention. This embodiment focuses on the program loading and execution method described in the above embodiments. Figure 6 As shown, the method includes:

[0134] S410. Under the control of the microcontroller, the startup mode is set to the device startup mode.

[0135] S420: The control firmware startup program writes the loading program sent by the microcontroller into the random access memory of the digital signal processor.

[0136] The firmware startup program includes the program running in the digital signal processor in the slave device startup mode.

[0137] Specifically, when the digital signal processor (DSP) is in slave boot mode, the program running on the DSP is the firmware boot program. The DSP controls the firmware boot program, writing the loading program into the DSP's random access memory (RAM).

[0138] S430: Receive the program execution instruction sent by the microcontroller.

[0139] The program execution instructions are used to trigger the loading program to run in the digital signal processor.

[0140] For example, the microcontroller (MCU) sends a program execution instruction to the digital signal processor (DSP), and the DSP triggers the execution of the program execution instruction, thus enabling the loaded program to run in the DSP.

[0141] S440. Trigger the program execution instructions to run in the digital signal processor and record the program execution status.

[0142] The program running status indicates whether the loading program is running normally in the digital signal processor.

[0143] Specifically, the digital signal processor (DSP) triggers the program execution instructions to run within the DSP and records the program execution status of the loaded program. The microcontroller can read the program execution status of the loaded program through a serial peripheral interface.

[0144] S450: Receive program data written by the microcontroller and convert the program data into a data write instruction.

[0145] S460. Send the data writing instruction to the firmware to be updated.

[0146] The technical solution of this invention involves controlling the firmware startup program to write the loading program sent by the microcontroller into the random access memory of the digital signal processor; receiving the program execution instruction sent by the microcontroller; triggering the program execution instruction to run in the digital signal processor; and recording the program execution status. By writing the loading program sent by the microcontroller into the random access memory through the firmware startup program and triggering the loading program to run on the digital signal processor through the program execution instruction, the stability of the firmware to be updated is ensured, and the update process is simplified.

[0147] Example 5

[0148] Figure 7 This is a schematic diagram of a firmware update device for a microcontroller according to Embodiment 5 of the present invention. Figure 7 As shown, the device includes:

[0149] The control module 510 is used to control the startup mode of the digital signal processor to a slave device startup mode, wherein the slave device startup mode indicates that the firmware corresponding to the digital signal processor needs to be updated.

[0150] The determination module 520 is used to write the loading program contained in the microcontroller into the digital signal processor in the slave device boot mode, and determine the program running status of the loading program, wherein the program running status indicates whether the loading program is running normally in the digital signal processor;

[0151] The writing module 530 is used to write program data into the firmware to be updated corresponding to the digital signal processor when the program is running normally. The program data includes data that needs to be written into the firmware to be updated as indicated by the microcontroller, and the program data is used to update the firmware to be updated.

[0152] The technical solution of this invention involves a control module controlling the startup mode of the digital signal processor (DSP) to a slave device startup mode; a determination module writing the loading program contained in the microcontroller into the DSP in the slave device startup mode and determining the program running state of the loading program; and a writing module writing program data into the firmware to be updated corresponding to the DSP when the program running state is normal. Through the cooperation between the modules, the microcontroller controls the startup mode of the DSP and sends the loading program to the DSP, ensuring the stability of the firmware update. When the program running state is normal, program data is written into the firmware to be updated, thus realizing microcontroller-controlled firmware updates and improving the update success rate.

[0153] In one embodiment, the determining module 520 includes:

[0154] The first determining unit is configured to determine, in the slave device boot mode, that the program running in the digital signal processor is a firmware boot program;

[0155] The first sending unit is used to send the loading program contained in the microcontroller to the digital signal processor, and the loading program is stored in the random access memory of the digital signal processor via the firmware startup program;

[0156] The control unit is used to control the loading program to run in the digital signal processor and to read the program running status of the loading program.

[0157] In one embodiment, the control unit is specifically used for:

[0158] Send a program execution instruction to the digital signal processor, the program execution instruction being used to trigger the loaded program to run in the digital signal processor;

[0159] Read the program running status of the loader.

[0160] In one embodiment, the writing module 530 includes:

[0161] The second determining unit is used to determine program data and at least one program data packet contained in the program data, wherein the program data packet includes data stored in the microcontroller;

[0162] The second sending unit is used to send an erase command to the firmware to be updated, and the erase command is used to control the firmware to be updated to perform an erase operation.

[0163] The reading unit is used to read the memory field of the digital signal processor. When the busy flag in the memory field is cleared, the unit writes the program data packet to the firmware to be updated corresponding to the digital signal processor for each program data packet. The busy flag indicates that the memory of the firmware to be updated is occupied.

[0164] In one embodiment, the writing module 530 further includes an output module, specifically used for:

[0165] Determine the writing order of each program data packet when it is written to the firmware to be updated;

[0166] The write data in the firmware to be updated is read according to the writing order, and the write data verification value of the write data is determined. The write data includes the program data written by the microcontroller into the firmware to be updated.

[0167] Determine the program data verification value of the program data stored in the microcontroller;

[0168] If the written data verification value is the same as the program data verification value, then the verification result is determined to be a successful verification.

[0169] Otherwise, the verification result will be determined as a verification failure;

[0170] Output the verification result.

[0171] In one embodiment, the control module 510 is specifically used for:

[0172] Receive a flashing command, wherein the flashing command indicates whether to update the firmware to be updated;

[0173] If the flashing command indicates that the firmware to be updated needs to be updated, then the startup mode of the digital signal processor is controlled to be the slave device startup mode;

[0174] Otherwise, the startup mode of the digital signal processor is controlled to be the master device startup mode.

[0175] The firmware update device provided in this embodiment of the invention can execute the firmware update method provided in any embodiment of the invention. Through the cooperation and coordination between the modules, the firmware update is completed, and it has the corresponding functional modules and beneficial effects of the execution method.

[0176] Example 6

[0177] Figure 8 This is a schematic diagram of a firmware update device for a digital signal processor according to Embodiment Six of the present invention. Figure 8 As shown, the device includes:

[0178] Setting module 610 is configured to set the boot mode to slave device boot mode under the control of the microcontroller, wherein the slave device boot mode indicates that the firmware corresponding to the digital signal processor needs to be updated.

[0179] The running module 620 is used to run a loading program written by the microcontroller. The program running status of the loading program is available for the microcontroller to read, and the program running status indicates whether the loading program is running normally in the digital signal processor.

[0180] The receiving module 630 is used to receive program data written by the microcontroller and convert the program data into data writing instructions. The program data is used to update the firmware to be updated. The program data includes data sent by the microcontroller when the memory of the firmware to be updated is not occupied.

[0181] The sending module 640 is used to send the data writing instruction to the firmware to be updated.

[0182] The technical solution of this invention involves a setting module that sets the boot mode to slave device boot mode under the control of the microcontroller; a running module that runs a loading program written by the microcontroller; a receiving module that receives program data written by the microcontroller and converts the program data into data writing instructions; and a sending module that sends the data writing instructions to the firmware to be updated. Through the cooperation of these modules, the microcontroller controls the digital signal processor's boot mode to slave device boot mode, runs the loading program written by the microcontroller, ensuring stability during firmware updates. When the microcontroller reads that the program is running normally, the digital signal processor receives the program data sent by the microcontroller and writes the program data into the firmware to be updated. This achieves microcontroller-controlled firmware updates, improving the success rate of the update.

[0183] In one embodiment, the receiving module 630 is specifically used for:

[0184] The microcontroller sends an erase command, which is used to control the firmware to be updated to perform an erase operation.

[0185] The erase command is converted into a firmware erase command, and the firmware erase command is sent to the firmware to be updated;

[0186] Read the busy status of the firmware to be updated and store the busy status in the memory field of the digital signal processor. The busy status includes whether the memory of the firmware to be updated is occupied.

[0187] Receive at least one program data packet contained in the program data written by the microcontroller;

[0188] For each program data packet, the program data packet is converted into a data write instruction.

[0189] In one embodiment, the running module 620 is specifically used for:

[0190] The control firmware startup program writes the loading program sent by the microcontroller into the random access memory of the digital signal processor, and the firmware startup program includes the program running in the digital signal processor in the slave device startup mode;

[0191] The microcontroller sends a program execution instruction, which triggers the loaded program to run in the digital signal processor.

[0192] The program execution instructions are triggered to run in the digital signal processor, and the program execution status is recorded. The program execution status indicates whether the loaded program is running normally in the digital signal processor.

[0193] The firmware update device provided in this embodiment of the invention can execute the firmware update method provided in any embodiment of the invention. Through the cooperation and coordination between the modules, the firmware update is completed, and it has the corresponding functional modules and beneficial effects of the execution method.

[0194] Example 7

[0195] According to embodiments of the present invention, the present invention also provides an electronic device, a computer-readable storage medium, and a computer program product.

[0196] Figure 9 This is a block diagram of an electronic device according to Embodiment Seven of the present invention, which implements the firmware update method described in the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0197] like Figure 9 As shown, the electronic device 410 includes at least one processor 411 and a memory, such as a read-only memory (ROM) 412 or a random access memory (RAM) 413, communicatively connected to the at least one processor 411. The memory stores computer programs executable by the at least one processor. The processor 411 can perform various appropriate actions and processes based on the computer program stored in the ROM 412 or loaded from storage unit 418 into the RAM 413. The RAM 413 may also store various programs and data required for the operation of the electronic device 410. The processor 411, ROM 412, and RAM 413 are interconnected via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0198] Multiple components in the electronic device are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, optical disk, etc.; and a communication unit 419, such as a network card, modem, wireless transceiver, etc. The communication unit 419 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0199] Processor 411 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 411 performs the various methods and processes described above, such as firmware update methods.

[0200] In some embodiments, the firmware update method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 410 via ROM 412 and / or communication unit 419. When the computer program is loaded into RAM 413 and executed by processor 411, one or more steps of the firmware update method described above may be performed. Alternatively, in other embodiments, processor 411 may be configured to perform the firmware update method by any other suitable means (e.g., by means of firmware).

[0201] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0202] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0203] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0204] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0205] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0206] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0207] In some embodiments, the computer program product includes a computer program that, when executed by a processor, implements the firmware update method provided in the embodiments of the present invention.

[0208] The technical solution of this invention provides a firmware update method, apparatus, electronic device, storage medium, and program product. The digital signal processor (DSP) is controlled to boot into a slave device boot mode. In this slave device boot mode, a loading program contained in the microcontroller is written into the DSP, and the program's running state is determined. If the program is running normally, program data is written into the firmware to be updated corresponding to the DSP. By controlling the DSP's boot mode through the microcontroller and sending the loading program to the DSP, stability during firmware updates is ensured. Writing program data to the firmware under normal program running conditions achieves microcontroller-controlled firmware updates, improving the update success rate.

[0209] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0210] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A firmware update method, characterized in that, Applied to a microcontroller connected to a digital signal processor, the method includes: The startup mode of the digital signal processor is controlled to be a slave device startup mode, which indicates that the firmware corresponding to the digital signal processor needs to be updated. In the slave device boot mode, the loader contained in the microcontroller is written into the digital signal processor, and the program running status of the loader is determined, the program running status indicating whether the loader is running normally in the digital signal processor; When the program is running normally, program data is written into the firmware to be updated corresponding to the digital signal processor. The program data includes the data that needs to be written into the firmware to be updated as indicated by the microcontroller. The program data is used to update the firmware to be updated.

2. The method according to claim 1, characterized in that, In the slave device boot mode, writing the loader contained in the microcontroller into the digital signal processor and determining the program running state of the loader includes: In the slave device boot mode, the program running in the digital signal processor is determined to be a firmware boot program; The loading program contained in the microcontroller is sent to the digital signal processor, and the loading program is stored in the random access memory of the digital signal processor via the firmware startup program; The loading program is controlled to run in the digital signal processor, and the program running status of the loading program is read.

3. The method according to claim 2, characterized in that, The control of the loading program to run in the digital signal processor and the reading of the program running status of the loading program include: Send a program execution instruction to the digital signal processor, the program execution instruction being used to trigger the loaded program to run in the digital signal processor; Read the program running status of the loader.

4. The method according to claim 1, characterized in that, The step of writing program data into the firmware to be updated corresponding to the digital signal processor includes: Determine program data and at least one program data packet contained in the program data, the program data packet including data stored in the microcontroller; Send an erase command to the firmware to be updated, the erase command being used to control the firmware to be updated to perform an erase operation; The memory field of the digital signal processor is read. When the busy flag in the memory field is cleared, the program data packet is written into the firmware to be updated corresponding to the digital signal processor for each program data packet. The busy flag indicates that the memory of the firmware to be updated is occupied.

5. The method according to claim 4, characterized in that, After writing the program data packet into the firmware to be updated corresponding to the digital signal processor, the method further includes: Determine the writing order of each program data packet when it is written to the firmware to be updated; The write data in the firmware to be updated is read according to the writing order, and the write data verification value of the write data is determined. The write data includes the program data written by the microcontroller into the firmware to be updated. Determine the program data verification value of the program data stored in the microcontroller; If the written data verification value is the same as the program data verification value, then the verification result is determined to be a successful verification. Otherwise, the verification result will be determined as a verification failure; Output the verification result.

6. The method according to claim 1, characterized in that, The startup mode of the digital signal processor is a slave device startup mode, including: Receive a flashing command, wherein the flashing command indicates whether to update the firmware to be updated; If the flashing command indicates that the firmware to be updated needs to be updated, then the startup mode of the digital signal processor is controlled to be the slave device startup mode; Otherwise, the startup mode of the digital signal processor is controlled to be the master device startup mode.

7. A firmware update method, characterized in that, Applied to a digital signal processor connected to a microcontroller, the method includes: Under the control of the microcontroller, the boot mode is set to slave device boot mode, which indicates that the firmware corresponding to the digital signal processor needs to be updated. The loading program written by the microcontroller is run, and the program running status of the loading program is read by the microcontroller. The program running status indicates whether the loading program is running normally in the digital signal processor. The microcontroller receives program data written by itself and converts the program data into a data write instruction. The program data is used to update the firmware to be updated. The program data includes data sent by the microcontroller when the memory of the firmware to be updated is not occupied. The data writing instruction is sent to the firmware to be updated.

8. The method according to claim 7, characterized in that, The step of receiving program data written by the microcontroller and converting the program data into data write instructions includes: The microcontroller sends an erase command, which is used to control the firmware to be updated to perform an erase operation. The erase command is converted into a firmware erase command, and the firmware erase command is sent to the firmware to be updated; Read the busy status of the firmware to be updated and store the busy status in the memory field of the digital signal processor. The busy status includes whether the memory of the firmware to be updated is occupied. Receive at least one program data packet contained in the program data written by the microcontroller; For each program data packet, the program data packet is converted into a data write instruction.

9. The method according to claim 7, characterized in that, The process of running the loader written via the microcontroller includes: The control firmware startup program writes the loading program sent by the microcontroller into the random access memory of the digital signal processor, and the firmware startup program includes the program running in the digital signal processor in the slave device startup mode; The microcontroller sends a program execution instruction, which triggers the loaded program to run in the digital signal processor. The program execution instructions are triggered to run in the digital signal processor, and the program execution status is recorded. The program execution status indicates whether the loaded program is running normally in the digital signal processor.

10. A firmware update device, characterized in that, Configured in a microcontroller, the microcontroller being connected to a digital signal processor, including: The control module is used to control the startup mode of the digital signal processor to be a slave device startup mode, wherein the slave device startup mode indicates that the firmware corresponding to the digital signal processor needs to be updated. The determination module is used to write the loading program contained in the microcontroller into the digital signal processor in the slave device boot mode, and determine the program running status of the loading program, wherein the program running status indicates whether the loading program is running normally in the digital signal processor; The writing module is used to write program data into the firmware to be updated corresponding to the digital signal processor when the program is running normally. The program data includes data that needs to be written into the firmware to be updated as indicated by the microcontroller, and the program data is used to update the firmware to be updated.

11. A firmware update device, characterized in that, Configured in a digital signal processor, the digital signal processor being connected to a microcontroller, including: The setting module is used to set the boot mode to slave device boot mode under the control of the microcontroller, wherein the slave device boot mode indicates that the firmware corresponding to the digital signal processor needs to be updated. The running module is used to run a loading program written by the microcontroller. The program running status of the loading program is available for the microcontroller to read, and the program running status indicates whether the loading program is running normally in the digital signal processor. A receiving module is configured to receive program data written by the microcontroller and convert the program data into data writing instructions. The program data is used to update the firmware to be updated. The program data includes data sent by the microcontroller when the memory of the firmware to be updated is not occupied. The sending module is used to send the data writing instruction to the firmware to be updated.

12. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the firmware update method according to any one of claims 1-9.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the firmware update method according to any one of claims 1-9.

14. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the firmware update method according to any one of claims 1-9.