Firmware upgrading method, motor driver and computer readable storage medium

By configuring the watchdog program in the system or software of the motor driver, it automatically detects and handles firmware upgrade interrupts, solving the problems of inefficient upgrade efficiency and complex operation caused by manual intervention, and achieving an efficient and automatic firmware upgrade process.

CN119829095APending Publication Date: 2025-04-15CHINA LEADSHINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411928325.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Existing motor drivers require manual intervention when firmware upgrades are interrupted, resulting in inefficient upgrades and complex operation.

Method used

By configuring the watchdog program in the system or software, obtain the first reset flag used to indicate the watchdog program reset, judge its set status, and automatically re-execute the firmware upgrade program to avoid manual intervention.

Benefits of technology

It realizes automatic reset and re-upgrade when firmware upgrade is interrupted, improves the efficiency of firmware upgrade, simplifies the operation process, and saves time and labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829095A_ABST
    Figure CN119829095A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a firmware upgrading method and a motor driver applying the firmware upgrading method. The firmware upgrading method comprises the steps that a watchdog program is started; obtaining a first reset mark used for indicating reset of the watchdog program; wherein the first reset mark is set when execution of the firmware upgrading program is interrupted; judging whether a first preset condition is met; when a first preset condition is met, executing a preset application program; and when the first preset condition is not met, if the first reset mark is set, re-executing the firmware upgrading program. According to the method and the device, when the firmware upgrading is interrupted, hardware resetting does not need to be performed manually, so that the firmware upgrading efficiency is improved, and the operation process is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of motor controllers, and in particular to a firmware upgrade method, a motor driver, and a computer-readable storage medium. Background Art

[0002] A motor driver is a device that controls and manages the operation of a motor by converting electrical energy into mechanical energy according to instructions from a motor drive controller. The motor driver can precisely control the speed, torque, power output and other parameters of the motor to achieve high energy efficiency, low noise and good stability. With the development of technology, the functions and performance of motor drivers are constantly improving, and their control chips also need to be continuously updated and upgraded.

[0003] Firmware upgrade is the process of updating or replacing the basic software or programs inside the device / equipment, aiming to improve the performance of the device, add new functions or fix potential security vulnerabilities to adapt to new needs or solve existing problems. At present, when the control chip of the motor driver is upgraded, it is usually carried out through communication between the host computer and the motor driver. However, due to environmental interference, unstable communication and other reasons, interruptions may occur during the firmware upgrade process, resulting in upgrade failure.

[0004] When the firmware upgrade is interrupted, the more common solutions are: one is hardware reset, that is, resetting the motor driver by physical means to make it re-enter the firmware upgrade state, such as reinitializing the device, updating the firmware, etc.; the other is software reset, that is, controlling the motor driver to enter the recovery mode and perform some basic system repair operations, such as clearing the cache, restoring factory settings, etc. Although the above two methods can solve the problem, both require manual intervention, low firmware upgrade efficiency, and increased operational complexity. Summary of the invention

[0005] The present application provides a firmware upgrade method, a motor driver and a computer-readable storage medium, which can solve the technical problem that when the firmware upgrade of the existing motor driver is interrupted, manual intervention is required to restart the upgrade program, resulting in low firmware upgrade efficiency and complex operation.

[0006] In a first aspect, an embodiment of the present application provides a firmware upgrade method, the method comprising: Start the watchdog program; Acquire a first reset flag for indicating the reset of the watchdog program; wherein the first reset flag is set when the execution of the firmware upgrade program is interrupted; Determining whether a first preset condition is met; When the first preset condition is met, a preset application is executed; when the first preset condition is not met, if the first reset flag is set, the firmware upgrade program is re-executed.

[0007] In some embodiments, the determining whether the first preset condition is met includes: Acquire one or more second reset flags for indicating system startup; When at least one of the second reset flags is set, it is considered that the first preset condition is met; otherwise, it is considered that the first preset condition is not met.

[0008] In some embodiments, one or more of the second reset flags include a reset flag for indicating power-on; And / or, one or more of the second reset flags include a reset flag for indicating completion of initialization.

[0009] In some embodiments, the firmware upgrade method further includes: when the first preset condition is not met, if the first reset flag is not set, outputting a fault handling instruction.

[0010] In some embodiments, the firmware upgrade method further includes: when executing the preset application, executing a dog feeding program according to a preset period.

[0011] In some embodiments, the firmware upgrade method further includes: When executing the preset application, determining whether an upgrade instruction and an upgrade configuration file sent from a host computer are received when executing the preset application; If the upgrade instruction is not received, continue to execute the preset application; if the upgrade instruction is received, verify the upgrade configuration file; If the verification is qualified, the initialization program is executed; The firmware upgrade program is executed according to the upgrade configuration file.

[0012] In a second aspect, an embodiment of the present application further provides a firmware upgrade method, the method comprising: Start the watchdog program; Acquire a first reset flag for indicating the reset of the watchdog program; wherein the first reset flag is set when the execution of the firmware upgrade program is interrupted; Determining whether the first reset flag is set; If the first reset flag is not set, the preset application is executed; if the first reset flag is set, the firmware upgrade program is re-executed.

[0013] In some embodiments, the firmware upgrade method further includes: When executing the preset application program, the dog feeding program is executed regularly according to the preset cycle; Determining whether an upgrade instruction and an upgrade configuration file sent from a host computer are received when executing the preset application; If the upgrade instruction is not received, continue to execute the preset application; if the upgrade instruction is received, verify the upgrade configuration file; If the verification is qualified, the initialization program is executed; The firmware upgrade program is executed according to the upgrade configuration file.

[0014] In a third aspect, an embodiment of the present application provides a motor driver, comprising a processor, and a memory communicatively connected to the processor; The memory is used to store programs or instructions executed by the computer; The processor is used to execute a computer-executed program or instruction stored in the memory, and when the program or instruction is executed, the firmware upgrade method as described in any of the above embodiments is implemented.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer-executable program or instruction is stored, and when the program or instruction is executed by a processor, the firmware upgrade method as described in any of the above embodiments is implemented.

[0016] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the firmware upgrade method as described in any of the above embodiments.

[0017] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the firmware upgrade method described in any of the above embodiments.

[0018] The firmware upgrade method provided by the embodiment of the present application and the motor driver using the firmware upgrade method configure a watchdog program in the system or software to reset when the firmware upgrade is interrupted; during the operation of the system or software, a first reset flag indicating the reset of the watchdog program is obtained, and based on whether the first reset flag is set, the reset status of the watchdog program is determined, and then it is clarified whether an interruption occurs in the firmware upgrade, and the firmware upgrade program is automatically re-executed when the first reset flag is set, that is, when the firmware upgrade is interrupted. The present application realizes that when the firmware upgrade is interrupted, there is no need for manual intervention to perform a hardware reset, which improves the efficiency of the firmware upgrade, simplifies the operation process, and saves time and labor costs.

[0019] In addition, the present application also provides a computer-readable storage medium, a computer program product, and a chip, which have the same beneficial effects as the above-mentioned clock error compensation method. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0021] Figure 1 A flowchart of a firmware upgrade method provided in one embodiment of the present application.

[0022] Figure 2 A flowchart of a firmware upgrade method provided in another embodiment of the present application.

[0023] Figure 3 A flowchart of a firmware upgrade method provided in yet another embodiment of the present application.

[0024] Figure 4 A flowchart of a firmware upgrade method provided in yet another embodiment of the present application.

[0025] Figure 5 A schematic diagram of the structure of a motor driver provided in one embodiment of the present application.

[0026] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0027] The present application is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are intended to enable the present application to be better understood. However, those skilled in the art can easily recognize that some of the features can be omitted in different situations, or can be replaced by other elements, materials, and methods. In some cases, some operations related to the present application are not shown or described in the specification, in order to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations based on the description in the specification and the general technical knowledge in the art.

[0028] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0029] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are usually a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated before and after are in an "or" relationship. The "connection" and "connection" mentioned in this application, unless otherwise specified, include direct and indirect connections (connections).

[0030] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0031] In the process of controlling the movement of the motor, the motor driver plays a vital role. The motor driver is responsible for converting the electrical energy provided by the external power supply into an electrical energy form suitable for the operation of the motor, which may include the conversion of voltage, current and frequency. By adjusting these parameters, the driver can accurately control the speed, direction and torque of the motor to meet the needs of various application scenarios.

[0032] In general, a motor driver includes at least a control circuit and multiple hardware modules. Among them, the control circuit is responsible for controlling the current and voltage, thereby achieving precise control of the motor. The control circuit is usually composed of a variety of electronic components, such as processors, power amplifiers, sensors, etc. These components work together to output corresponding control signals to the motor according to the preset control algorithm to adjust the motor's speed, torque and direction. Multiple hardware modules jointly support the functional implementation of the driver. Common hardware modules include: a controller, an IO module for interactive communication, a drive module for converting DC power into AC power to drive the motor, and a sensor module for real-time monitoring of the motor's operating status.

[0033] The controller of the motor driver includes at least one processor, in which corresponding firmware is stored for executing the control logic of the drive. The firmware receives external instructions or signals and outputs corresponding control signals to the motor driver according to the preset control algorithm. Usually, the firmware supports configuration and debugging through software, which can improve the flexibility and adaptability of the motor driver.

[0034] The following is a detailed description of the method for upgrading the firmware in the motor driver.

[0035] Figure 1 This is a flowchart of a firmware upgrade method provided by an embodiment of the present application. Figure 1 As shown, the firmware upgrade method provided in this embodiment specifically includes the following steps: Step S101, start the watchdog program.

[0036] Typically, processors, especially processors containing embedded chips, are provided with a watchdog timer (WDT) program. The watchdog program is a monitoring mechanism for detecting whether the monitored program or service is running normally, and automatically taking measures to recover when an abnormality is detected.

[0037] Step S102: obtaining a first reset flag for indicating a reset of the watchdog program; wherein the first reset flag is set when the execution of the firmware upgrade program is interrupted.

[0038] The watchdog program reset is actually a protection mechanism used to prevent the system from falling into an unrecoverable state due to a fault or abnormal behavior. It will wait for a "feed the dog" signal from the software within a set time. If the software fails to send the "feed the dog" signal in time for some reason (such as an infinite loop, hang, etc.), the watchdog timer will time out, thereby triggering a system reset to restore the normal operation of the system. The watchdog program reset can be implemented in software, hardware, or a combination of the two. In this embodiment, the watchdog program is pre-set to automatically resume and re-execute the firmware upgrade program when an interrupt occurs during the execution of the firmware upgrade program. Therefore, the situation of the firmware upgrade program can be obtained by obtaining the first reset flag indicating the reset of the watchdog program.

[0039] Step S103: determine whether the first reset flag is set.

[0040] Step S104: if the first reset flag is not set, then execute the preset application program; if the first reset flag is set, then re-execute the firmware upgrade program.

[0041] Firmware upgrade interruption means that the upgrade process is unexpectedly terminated or fails due to some reason during the firmware upgrade process. Firmware upgrade is an important operation to fix vulnerabilities, add new functions or improve device performance. However, if there is an interruption during the upgrade process, it may cause the device to not work properly or even damage the device. There may be many reasons for firmware upgrade interruption, such as power failure, communication failure, storage failure, software error and human intervention. Some of the reasons that lead to firmware upgrade interruption can be recovered by reloading the firmware upgrade program.

[0042] Therefore, after obtaining the first reset flag indicating the reset of the watchdog program, it is necessary to further determine whether the first reset flag is set, that is, whether the watchdog is reset. If the first reset flag is not set, it means that the previous loading and execution of the firmware upgrade program was normal and there was no interruption. At this time, the processor can normally jump to execute the preset application, which can be an application directly burned when the embedded system leaves the factory, or an application loaded by the embedded system after the system firmware is upgraded. If the first reset flag is set, it means that there is an interruption in loading and executing the firmware upgrade program. At this time, the processor can choose to jump and re-execute the firmware upgrade program according to the setting of the first reset flag. By reloading and executing the firmware upgrade program again, it tries to recover so that the firmware upgrade is successful. There is no need for manual intervention in the first time, which improves the efficiency of the firmware upgrade, and realizes self-recovery of some reasons for the firmware upgrade interruption through program settings.

[0043] Figure 2 This is a flowchart of a firmware upgrade method provided by another embodiment of the present application. Figure 2 As shown, the firmware upgrade method provided in this embodiment, based on the above embodiment, also includes the following steps: Step S201: When executing a preset application program, a dog feeding program is executed regularly according to a preset cycle.

[0044] A software watchdog is usually a background thread or process that periodically checks whether the monitored program or service is running normally, and takes appropriate recovery measures when an abnormality is detected. The premise for realizing this function is that during the normal operation of the system or software, that is, during the execution of the preset application, the system or software needs to regularly output a feeding signal to the watchdog program to reset the watchdog program; if the dog is not fed after the feeding time, that is, the feeding signal is not output to the watchdog program, the watchdog program will time out and the watchdog will reset. In other cases, such as during the firmware upgrade process, the firmware upgrade is interrupted due to unexpected power failure, interference, communication disconnection, etc., and the application will not work after powering on again, and the dog cannot be fed, which will cause the software watchdog to reset.

[0045] This type of reset should not occur. In this embodiment, the reset caused by this situation is not caused by the interruption of the firmware upgrade program, which will cause confusion in the execution of the system program. Therefore, when executing the preset application program, it is necessary to execute the dog feeding program according to the preset period and output the dog feeding signal to the watchdog program.

[0046] Step S202: determining whether an upgrade instruction and an upgrade configuration file sent from a host computer are received when executing a preset application.

[0047] Step S203: If no upgrade instruction is received, continue to execute the preset application; if an upgrade instruction is received, verify the upgrade configuration file.

[0048] Step S204: If the verification is qualified, the initialization program is executed.

[0049] Step S205: Execute the firmware upgrade program according to the upgrade configuration file.

[0050] The timing of sending firmware upgrade instructions mainly depends on the device type, the manufacturer's update strategy and the specific needs of the user. The timing of sending firmware upgrade instructions includes regular updates, when there are system problems, and when new functions are required. During the normal operation of the system or software, that is, during the execution of the preset application, it will check whether the upgrade instructions and upgrade configuration files sent by the host computer have been received.

[0051] If the upgrade command and upgrade configuration file are not received, the preset application program will continue to be executed. If the upgrade command and upgrade configuration file are received, the upgrade configuration file needs to be verified and initialized before the firmware is upgraded using the data packet. After the verification is qualified and the initialization is completed, the firmware upgrade program is executed and the firmware upgrade is completed according to the upgrade configuration file.

[0052] It should be noted that after receiving the upgrade instruction and upgrade configuration file, the firmware upgrade program can be executed immediately, or it can be set to be executed at a certain time after a period of time, or it can be manually jumped to execution when the system is idle. However, no matter when the firmware upgrade program is executed, the upgrade configuration file needs to be verified and initialized before execution.

[0053] The main purpose of the firmware upgrade configuration file verification is to ensure that the downloaded firmware file is consistent with the original file released by the manufacturer and has not been tampered with or damaged. This helps prevent malware or viruses from entering the device through firmware updates, thereby protecting the security and stability of the device.

[0054] After the firmware upgrade configuration file is verified to be qualified, that is, before executing the firmware upgrade program, the main purpose of executing the initialization program is to prepare to enter the upgrade mode, configure the basic settings of the system or software, load the necessary drivers, check the hardware status, etc., to make prerequisite preparations for the firmware upgrade.

[0055] In some embodiments, after executing the firmware upgrade program, an initialization program is also executed. The initialization program at this time is to ensure that the system or software can run normally with the new firmware version. In some cases, initialization at different stages is very necessary.

[0056] In some embodiments, in order to reduce the difficulty of software deployment, a loop waiting program may be added to the system software program to achieve the reset of the watchdog program.

[0057] When the system receives a firmware upgrade instruction from the host computer, the loop waiting program can be started. At this time, the watchdog program starts timing. When the timing time of the watchdog program is reached, the watchdog program will automatically reset.

[0058] In summary, the firmware upgrade method provided by the embodiment of the present application configures a watchdog program in the system or software, which is used to reset when the firmware upgrade is interrupted; during the operation of the system or software, by obtaining the first reset flag used to indicate the reset of the watchdog program, based on whether the first reset flag is set, the reset status of the watchdog program is determined, and then it is clarified whether an interruption occurs in the firmware upgrade, and the firmware upgrade program is automatically re-executed when the first reset flag is set, that is, when the firmware upgrade is interrupted. The present application realizes that when the firmware upgrade is interrupted, there is no need for manual hardware reset, which improves the efficiency of the firmware upgrade and simplifies the operation process.

[0059] At the same time, the system or software is also configured to periodically feed the dog during the normal operation of the preset application to ensure the normal operation of the watchdog program; and when receiving the upgrade command and upgrade configuration file sent from the host computer, the upgrade configuration file is first verified and initialized, and then the firmware upgrade program is executed according to the upgrade configuration file to complete the firmware upgrade, ensuring the reliability and stability of the system or software.

[0060] In some more complex systems or software, there are multiple reset flags, such as the reset of system or software power-on, the reset of initialization, and the reset of watchdog. During the firmware upgrade process, the normal firmware upgrade program may also be triggered after the system or power is powered on and the initialization is completed. In any of the above embodiments, the watchdog reset is mainly used to automatically trigger the reloading and execution of the firmware upgrade program when the previous firmware upgrade program is interrupted. Therefore, if the firmware upgrade program is entered directly by judging whether the first reset flag is set and determining that it is a watchdog reset, it may enter the firmware upgrade program without upgrading. To deal with such situations, the present application also provides another firmware upgrade method.

[0061] Figure 3 This is a flowchart of a firmware upgrade method provided by another embodiment of the present application. Figure 3 As shown, the firmware upgrade method provided in this embodiment specifically includes the following steps: Step S301, start the watchdog program.

[0062] Step S302: Acquire a first reset flag for indicating a reset of the watchdog program; wherein the first reset flag is set when the execution of the firmware upgrade program is interrupted.

[0063] Step S303: determine whether the first preset condition is met.

[0064] After the system or software is powered on and initialized, if there is no fault, the system or software can directly execute the preset application program to complete the normal startup / initialization process. Therefore, the purpose of setting the first preset condition is to save the judgment of whether the first reset mark is set after determining that the system or software meets the first preset condition, that is, there is no need to judge whether the watchdog program is reset. If the first condition is met, the preset application program can be directly executed, which saves program threads and improves the startup / initialization efficiency of the system or software.

[0065] In some embodiments, determining whether the first preset condition is met specifically includes: Step S3031: Obtain one or more second reset flags for indicating system startup, wherein the one or more second reset flags include a reset flag for indicating power-on and / or a reset flag for indicating completion of initialization.

[0066] Step S3032: When at least one second reset flag is set, it is considered that the first preset condition is met; otherwise, it is considered that the first preset condition is not met.

[0067] Step S304: When the first preset condition is met, execute the preset application program; when the first preset condition is not met, if the first reset flag is set, re-execute the firmware upgrade program.

[0068] Compared with the above embodiment, after starting the watchdog program and obtaining the first reset flag, the present embodiment first determines whether the current state satisfies the first preset condition, that is, determines whether the current state is a reset caused by the system or software startup, specifically by the setting of the second reset flag indicating power-on and / or completion of initialization. When at least one of the second reset flags is set, it is considered that the current state satisfies the first preset condition, which is a reset of the system or software power-on. At this time, the system or software runs normally and enters the execution of the preset application program; when none of the second reset flags is set, it can be determined that the current state satisfies the first preset condition. At this time, the setting of the first reset flag is further determined. If the first reset flag is not set, it means that the previous loading and execution of the firmware upgrade program is normal and there is no interruption. At this time, the processor can jump to execute the preset application program normally; if the first reset flag is set, it means that there is an interruption in the loading and execution of the firmware upgrade program. At this time, the processor can choose to jump and re-execute the firmware upgrade program according to the setting of the first reset flag, and try to recover by reloading and executing the firmware upgrade program again to make the firmware upgrade successful.

[0069] In some embodiments, it also includes: Step S305: When the first preset condition is not met and the first reset flag is not set, outputting a fault handling instruction.

[0070] If it is determined in step S3032 that the current state does not meet the first preset condition, that is, the system or software is not currently powered on or reset after initialization, and if the first reset flag is not set, that is to say, there was no interruption during the previous firmware upgrade, the system or software will not trigger the reloading of the firmware upgrade program, nor will it jump to execute the preset application normally, that is to say, there is a fault in the system or software. At this time, the processor will output a fault handling instruction to remind the operator to troubleshoot and handle the fault.

[0071] Figure 4 This is a flowchart of a firmware upgrade method provided by another embodiment of the present application. Figure 4 As shown, the firmware upgrade method provided in this embodiment, based on the above embodiment, also includes the following steps: Step S401: When executing a preset application program, a dog feeding program is executed regularly according to a preset cycle.

[0072] Step S402: when executing the preset application, determine whether an upgrade instruction and an upgrade configuration file sent from the host computer are received when executing the preset application.

[0073] Step S403: If no upgrade instruction is received, continue to execute the preset application; if an upgrade instruction is received, verify the upgrade configuration file.

[0074] Step S404: If the verification is qualified, the initialization program is executed and the second reset flag is set.

[0075] Step S405: Execute the firmware upgrade program according to the upgrade configuration file.

[0076] It should be noted that the execution process of step S401 to step S405 is the same as or similar to the execution process of step S201 to step S205 in the aforementioned embodiment, and has the same technical effect. To avoid repetition, it will not be repeated here.

[0077] Figure 5 This is a schematic diagram of the structure of a motor driver provided by an embodiment of the present application. Figure 5 As shown, the motor driver provided in this embodiment includes at least a processor 510 and a memory 520 connected to the processor 510 via a bus.

[0078] The memory 520 is used to store programs or instructions executed by the computer.

[0079] The processor 510 is used to execute the computer-executed program or instruction stored in the memory, and when the program or instruction is executed, each step of the firmware upgrade method executed by the processor in any of the above embodiments is implemented. For details, please refer to the relevant description in the above method embodiment.

[0080] In some embodiments, the memory 520 may be independent or integrated with the processor 510 .

[0081] The motor driver provided in this embodiment can be used to execute the methods executed by the processors in the above embodiments. The implementation principles and technical effects are similar and will not be described in detail in this embodiment.

[0082] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of any embodiment of the firmware upgrade method of the above-mentioned motor driver can be implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0083] The processor may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0084] An embodiment of the present application also provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of any embodiment of the firmware upgrade method of the above-mentioned motor driver, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0085] It can be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0086] An embodiment of the present application also provides a computer program product, which includes a computer program code and is stored in a storage medium. When the computer program code is executed on at least one processor, the various processes of any embodiment of the firmware upgrade method for the motor driver described above can be implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0087] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0088] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the inspiration of the present application, ordinary technicians in the field can make several simple deductions, deformations or substitutions based on the ideas of the present application without departing from the scope of protection of the purpose of the present application and the claims. All of these are within the protection of the present application.

Claims

1. A firmware upgrade method, characterized in that: include: Start the watchdog program; Acquire a first reset flag for indicating the reset of the watchdog program; wherein the first reset flag is set when the execution of the firmware upgrade program is interrupted; Determining whether a first preset condition is met; When the first preset condition is met, a preset application is executed; when the first preset condition is not met, if the first reset flag is set, the firmware upgrade program is re-executed.

2. The firmware upgrade method according to claim 1, characterized in that: The determining whether the first preset condition is met includes: Acquire one or more second reset flags for indicating system startup; When at least one of the second reset flags is set, it is considered that the first preset condition is met; otherwise, it is considered that the first preset condition is not met.

3. The firmware upgrade method according to claim 2, characterized in that: The one or more second reset flags include a reset flag for indicating power-on; And / or, one or more of the second reset flags include a reset flag for indicating completion of initialization.

4. The firmware upgrade method according to any one of claims 1 to 3, characterized in that: Also includes: When the first preset condition is not met, if the first reset flag is not set, a fault handling instruction is output.

5. The firmware upgrade method according to claim 4, characterized in that: Also includes: When the preset application program is executed, the dog feeding program is executed regularly according to a preset cycle.

6. The firmware upgrade method according to claim 4, characterized in that: Also includes: When executing the preset application, determining whether an upgrade instruction and an upgrade configuration file sent from a host computer are received when executing the preset application; If the upgrade instruction is not received, continue to execute the preset application program; If the upgrade instruction is received, then verifying the upgrade configuration file; If the verification is qualified, the initialization program is executed; The firmware upgrade program is executed according to the upgrade configuration file.

7. A firmware upgrade method, characterized in that: include: Start the watchdog program; Acquire a first reset flag for indicating the reset of the watchdog program; wherein the first reset flag is set when the execution of the firmware upgrade program is interrupted; Determining whether the first reset flag is set; If the first reset flag is not set, the preset application is executed; if the first reset flag is set, the firmware upgrade program is re-executed.

8. The firmware upgrade method according to claim 7, characterized in that: Also includes: When executing the preset application program, the dog feeding program is executed regularly according to the preset cycle; Determining whether an upgrade instruction and an upgrade configuration file sent from a host computer are received when executing the preset application; If the upgrade instruction is not received, continue to execute the preset application program; If the upgrade instruction is received, then verifying the upgrade configuration file; If the verification is qualified, the initialization program is executed; The firmware upgrade program is executed according to the upgrade configuration file.

9. A motor driver, characterized in that: comprising a processor, and a memory communicatively connected to the processor; The memory is used to store programs or instructions executed by the computer; The processor is used to execute a computer-executed program or instruction stored in the memory, and when the program or instruction is executed, the firmware upgrade method according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer-executable program or instruction, and when the program or instruction is executed by a processor, the firmware upgrade method according to any one of claims 1 to 8 is implemented.