CN117519737A - Micro control unit firmware upgrading method and device, electronic equipment and storage medium - Google Patents

Micro control unit firmware upgrading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117519737A
CN117519737A CN202210901103.XA CN202210901103A CN117519737A CN 117519737 A CN117519737 A CN 117519737A CN 202210901103 A CN202210901103 A CN 202210901103A CN 117519737 A CN117519737 A CN 117519737A
Authority
CN
China
Prior art keywords
firmware
control unit
micro control
central processing
processing unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210901103.XA
Other languages
Chinese (zh)
Inventor
谭瀚禹
李宇庭
雷舰
高卫红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Opening Of Biomedical Technology Wuhan Co ltd
Original Assignee
Opening Of Biomedical Technology Wuhan Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Opening Of Biomedical Technology Wuhan Co ltd filed Critical Opening Of Biomedical Technology Wuhan Co ltd
Priority to CN202210901103.XA priority Critical patent/CN117519737A/en
Publication of CN117519737A publication Critical patent/CN117519737A/en
Pending legal-status Critical Current

Links

Abstract

The application discloses a method and a device for upgrading firmware of a micro control unit, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: when the micro control unit is abnormal, continuously sending preset characters to the central processing unit connected with the communication so that the central processing unit sends a firmware file after receiving the preset characters; and receiving a firmware file sent by the central processing unit, and carrying out firmware upgrading based on the firmware file. Therefore, the firmware upgrading method for the micro control unit realizes the firmware upgrading of the micro control unit under the abnormal condition and restores the normal working state of the micro control unit.

Description

Micro control unit firmware upgrading method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technology, and more particularly, to a method and apparatus for upgrading firmware of a micro control unit, an electronic device, and a computer readable storage medium.
Background
In the related art, when the micro control unit (Microcontroller Unit, MCU) needs to perform firmware upgrade, a preset character is sent to the central processing unit (central processing unit, CPU) in communication connection, and after the central processing unit receives the preset character, the central processing unit starts to transmit a firmware file to the micro control unit, and the micro control unit performs firmware upgrade based on the firmware file. However, when the micro control unit is abnormal, the preset character cannot be sent to the central processing unit, and the central processing unit cannot send the firmware file to the micro control unit, so that the micro control unit cannot perform firmware upgrading.
Therefore, how to implement firmware upgrade of the micro control unit in case of abnormality is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a method and a device for upgrading firmware of a micro control unit, electronic equipment and a computer readable storage medium, which realize the firmware upgrading of the micro control unit under abnormal conditions.
In order to achieve the above object, the present application provides a firmware upgrade method for a micro control unit, which is applied to the micro control unit, and the method includes:
when the micro control unit is abnormal, continuously sending preset characters to a central processing unit connected with the communication unit, so that the central processing unit sends a firmware file after receiving the preset characters;
and receiving the firmware file sent by the central processing unit, and carrying out firmware upgrading based on the firmware file.
Wherein, still include:
receiving a firmware upgrading instruction sent by the central processing unit, and replying a preset character to the central processing unit so that the central processing unit sends a firmware file after receiving the preset character;
and receiving the firmware file sent by the central processing unit, and carrying out firmware upgrading based on the firmware file.
When the micro control unit is abnormal, the method continuously sends preset characters to a central processing unit connected with the communication, and comprises the following steps:
when the firmware upgrade fails, the preset character is continuously sent to the central processing unit connected with the communication.
The CPU divides the firmware file into a plurality of firmware subfiles according to a preset length and sequentially sends the firmware subfiles to the micro control unit;
correspondingly, the receiving the firmware file sent by the central processing unit includes:
receiving a target firmware subfile sent by the central processing unit;
if the receiving is successful, replying a first response character to the central processing unit, so that the central processing unit continues to send the next firmware subfile of the target firmware subfile to the micro control unit after receiving the first response character;
if the receiving fails, replying a second response character to the central processing unit, so that the central processing unit sends the target firmware subfile to the micro control unit again after receiving the second response character.
Wherein, still include:
and replying the first response character to the central processing unit when receiving a transmission completion flag sent by the central processing unit.
In order to achieve the above object, the present application provides a firmware upgrade method for a micro control unit, which is applied to a central processing unit, and the method includes:
reading a firmware file;
judging whether a preset character sent by a micro control unit is received or not;
and if the preset character sent by the micro control unit is received, judging that the micro control unit is abnormal, and sending a firmware file to the micro control unit so that the micro control unit can perform firmware upgrading based on the firmware file.
Wherein, still include:
if the preset character sent by the micro control unit is not received, a firmware upgrading instruction is sent to the micro control unit so that the micro control unit replies the preset character;
and when the preset character sent by the micro control unit is received, sending a firmware file to the micro control unit so that the micro control unit can perform firmware upgrading based on the firmware file.
Wherein sending a firmware file to the micro control unit comprises:
dividing the firmware file into a plurality of firmware subfiles according to a preset length, and sequentially sending the firmware subfiles to the micro control unit; the micro control unit replies a first response character if the firmware subfile is successfully received, and replies a second response character if the firmware subfile is failed to be received;
after the target firmware subfile is sent to the micro control unit, if a first response character is received, continuing to send the next firmware subfile of the target firmware subfile to the micro control unit; and if the second response character is received, the target firmware subfile is sent to the micro control unit again.
Wherein, still include:
after receiving a first response character corresponding to the last firmware subfile, sending a transmission completion mark to the micro control unit so that the central processing unit replies the first response character;
and after receiving the first response character corresponding to the transmission completion mark, completing the transmission of the firmware file.
In order to achieve the above object, the present application provides a firmware upgrade apparatus for a micro control unit, which is applied to the micro control unit, the apparatus comprising:
the first sending module is used for continuously sending preset characters to the central processing unit connected in a communication way when the micro control unit is abnormal, so that the central processing unit sends a firmware file after receiving the preset characters;
and the first upgrading module is used for receiving the firmware file sent by the central processing unit and upgrading the firmware based on the firmware file.
In order to achieve the above object, the present application provides a firmware upgrade apparatus for a micro control unit, which is applied to a central processing unit, and the apparatus includes:
the reading module is used for reading the firmware file;
the judging module is used for judging whether a preset character sent by the micro control unit is received or not;
and the second sending module is used for judging that the micro control unit is abnormal when the preset character sent by the micro control unit is received, and sending a firmware file to the micro control unit so that the micro control unit can perform firmware upgrading based on the firmware file.
To achieve the above object, the present application provides an electronic device, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the micro control unit firmware upgrading method when executing the computer program.
To achieve the above object, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the micro control unit firmware upgrade method as described above.
According to the scheme, the firmware upgrading method for the micro control unit is applied to the micro control unit and comprises the following steps: when the micro control unit is abnormal, continuously sending preset characters to a central processing unit connected with the communication unit, so that the central processing unit sends a firmware file after receiving the preset characters; and receiving the firmware file sent by the central processing unit, and carrying out firmware upgrading based on the firmware file.
According to the micro-control unit firmware upgrading method, when the micro-control unit is abnormal, the preset characters are continuously sent to the central processing unit, after the central processing unit receives the preset characters, the firmware file is transmitted to the micro-control unit, and the micro-control unit performs firmware upgrading based on the firmware file. Therefore, the firmware upgrading method for the micro control unit realizes the firmware upgrading of the micro control unit under the abnormal condition and restores the normal working state of the micro control unit. The application also discloses a micro control unit firmware upgrading device, electronic equipment and a computer readable storage medium, and the technical effects can be achieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
FIG. 1 is a flow chart illustrating a method of firmware upgrade for a micro control unit according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating another method of micro-control unit firmware upgrade, according to an example embodiment;
FIG. 3 is a flowchart illustrating yet another method of micro control unit firmware upgrade, according to an example embodiment;
FIG. 4 is a flow chart of an embodiment of an application provided herein;
FIG. 5 is a block diagram of a micro control unit firmware upgrade apparatus, according to an example embodiment;
FIG. 6 is a block diagram of another micro control unit firmware upgrade apparatus, according to an example embodiment;
fig. 7 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application. In addition, in the embodiments of the present application, "first," "second," and the like are used to distinguish similar objects, and are not necessarily used to describe a particular order or sequence.
The embodiment of the application discloses a firmware upgrading method of a micro control unit, which realizes the firmware upgrading of the micro control unit under the abnormal condition.
Referring to fig. 1, a flowchart of a firmware upgrade method for a micro control unit according to an exemplary embodiment is shown, as shown in fig. 1, including:
s101: when the micro control unit is abnormal, continuously sending preset characters to a central processing unit connected with the communication unit, so that the central processing unit sends a firmware file after receiving the preset characters;
the execution body of the embodiment is a micro control unit, and the purpose is to upgrade firmware of the micro control unit under abnormal conditions. . In this embodiment, the micro control unit may be a power panel, or may be another unit with similar firmware upgrade requirements, which is communicatively connected to the cpu, and this embodiment is not limited in detail. In an application scenario, the central processing unit can be a central processing unit in ultrasonic instrument equipment, the ultrasonic instrument equipment is provided with a battery controlled by a power panel, and the position of the mobile equipment can be flexibly moved under a series of tedious operations such as shutdown, restarting and the like, so that convenience is provided for doctors. When a doctor can disconnect a power supply and use battery power to prepare ultrasonic examination, the doctor can accurately acquire the current battery information and the connection state of the power adapter, reasonably arrange the use time, prevent the loss of examination data and ensure the experience of a user and the safety of the data. The power panel in the ultrasonic instrument equipment is mainly used for power management, acquires and monitors the electric quantity, voltage, charging current and temperature of a battery, controls a fan and other functions, and has important influence on 3D and 4D scanning and standby awakening.
In specific implementation, the abnormal situation may include an abnormal situation after the firmware upgrade of the micro control unit fails, and of course, other abnormal situations may also be included, which is not limited herein specifically. In a specific implementation, when the micro control unit is abnormal, a preset character, such as an ASCII C character, is continuously sent to the central processor to trigger firmware upgrade.
Further, after receiving the preset character sent by the micro control unit, the application software of the central processing unit reads the firmware file and starts to transmit the firmware file to the micro control unit, wherein the firmware file can be a file in a bin format.
S102: and receiving the firmware file sent by the central processing unit, and carrying out firmware upgrading based on the firmware file.
In this step, the micro control unit receives the firmware file sent by the central processing unit, and performs firmware upgrade based on the firmware file. After the upgrade is successful, the firmware upgrade process is finished, and when the upgrade is failed, the execution of S101 can be triggered again, and the firmware upgrade process is repeated.
As a preferred embodiment, the central processing unit divides the firmware file into a plurality of firmware subfiles according to a preset length and sequentially sends the firmware subfiles to the micro control unit; correspondingly, the receiving the firmware file sent by the central processing unit includes: receiving a target firmware subfile sent by the central processing unit; if the receiving is successful, replying a first response character to the central processing unit, so that the central processing unit continues to send the next firmware subfile of the target firmware subfile to the micro control unit after receiving the first response character; if the receiving fails, replying a second response character to the central processing unit, so that the central processing unit sends the target firmware subfile to the micro control unit again after receiving the second response character; and replying the first response character to the central processing unit when receiving a transmission completion flag sent by the central processing unit.
In an implementation, the firmware file may be transferred between the central processor and the micro-control unit using an Xmodem protocol, which is an asynchronous file transfer protocol widely used in serial communication, providing simple continuous file transfer with a fixed packet length point-to-point. In this embodiment, the cpu divides the firmware file into a plurality of firmware subfiles according to a predetermined length, and fills a predetermined character, such as NACK (0 x 1A), when the last firmware subfile is less than the predetermined length. The cpu transmits a firmware subfile of a preset length, for example, 1K (1024 bytes), to the mcu each time, and the format of the data packet transmitted to the mcu each time may be:
< SOH (header) > < packet number anti-code > < file data > < check bit >;
the packet header is a preset fixed character, the packet sequence number can be understood as the sequence number of the firmware subfile, and the file data is specific content of the firmware subfile. The check bits may be SUM check, i.e. the check bits are the SUM of all data bits except the header and 0xff and the overflow bits are anded. The check bits may be checked using XOR (exclusive or), i.e. the check bits are the exclusive or result of all data bits.
The micro control unit responds to each received firmware subfile through a first response character or a second response character, wherein the first response character represents normal reception, the second response character represents abnormal reception, namely, when the reception is successful, the micro control unit replies the first response character to the central processor, and when the reception is failed, the micro control unit replies the second response character to the central processor. A first response character, e.g., ACK, and a second response character, e.g., NACK.
When the central processor receives the first response character, the next firmware subfile is continuously sent to the micro-control unit, and when the central processor receives the second response character, the current firmware subfile is repeatedly sent to the micro-control unit.
And when the transmission of the last firmware subfile is successful, namely the central processing unit receives a first response character corresponding to the last firmware subfile, a transmission completion mark is sent to the micro control unit so as to inform the micro control unit that the transmission of the firmware file is finished. And after receiving the transmission completion mark, the micro control unit returns a first response character, and when the central processing unit receives the first response character corresponding to the transmission completion mark, the firmware file is transmitted.
According to the firmware upgrading method for the micro control unit, when the micro control unit is abnormal, the preset characters are continuously sent to the central processing unit, after the central processing unit receives the preset characters, the firmware file is transmitted to the micro control unit, and the micro control unit performs firmware upgrading based on the firmware file. Therefore, the firmware upgrading method for the micro control unit provided by the embodiment of the application realizes the firmware upgrading of the micro control unit under the abnormal condition and restores the normal working state of the micro control unit.
The embodiment of the application discloses a firmware upgrading method for a micro control unit, and compared with the previous embodiment, the technical scheme is further described and optimized. Specific:
referring to fig. 2, a flowchart of another firmware upgrade method for a micro control unit according to an exemplary embodiment is shown, as shown in fig. 2, including:
s201: receiving a firmware upgrading instruction sent by a central processing unit, and replying a preset character to the central processing unit so that the central processing unit sends a firmware file after receiving the preset character;
s202: receiving the firmware file sent by the central processing unit, and carrying out firmware upgrading based on the firmware file;
it should be noted that, step S201 to step S202 are firmware upgrade processes under the normal condition of the micro control unit. Under the normal condition of the micro control unit, the preset characters are not continuously sent to the central processing unit, the central processing unit triggers the firmware upgrading process, the firmware upgrading instruction is sent to the micro control unit, and after the micro control unit receives the firmware upgrading instruction, the micro control unit replies the preset characters to the central processing unit, and the transmission of the firmware file is started. After the CPU receives the preset character, the CPU starts to transmit the firmware file to the micro-control unit, and the micro-control unit receives the firmware file and upgrades the firmware based on the firmware file.
S203: when the firmware upgrade fails, continuously sending preset characters to the central processing unit, so that the central processing unit sends a firmware file after receiving the preset characters;
s204: and receiving the firmware file sent by the central processing unit, and carrying out firmware upgrading based on the firmware file.
It will be appreciated that since firmware upgrades are similar to a brusher, an exception condition prevents the micro control unit from failing entirely. Therefore, when the firmware upgrade fails, the function of the micro control unit is completely disabled, and at the moment, the micro control unit cannot communicate with the micro control unit through the normal data packet format, so that when the firmware upgrade fails, the micro control unit is specified to continuously send preset characters to the central processing unit, the central processing unit starts to transmit firmware files to the micro control unit after receiving the preset characters, and the micro control unit firmware files are updated based on the firmware files.
It can be seen that this embodiment enables firmware upgrades under both normal and abnormal conditions of the micro control unit.
The embodiment of the application discloses a firmware upgrading method of a micro control unit, which realizes the firmware upgrading of the micro control unit under the abnormal condition.
Referring to fig. 3, a flowchart of yet another firmware upgrade method for a micro control unit, as shown in fig. 3, according to an exemplary embodiment, includes:
s301: reading a firmware file;
the execution body of the embodiment is a central processing unit of the micro control unit. In a specific implementation, the central processing unit triggers firmware upgrade and reads the firmware file.
S302: judging whether a preset character sent by a micro control unit is received or not; if the preset character sent by the micro control unit is received, S303 is entered; if the preset character sent by the micro control unit is not received, S304 is entered;
in this embodiment, the micro control unit communicates with the central processor through the serial port, and when the micro control unit is abnormal, the micro control unit continuously transmits a preset character to the central processor. The central processing unit reads the serial data, judges whether a preset character sent by the micro control unit is received, if yes, the step S303 is carried out, and if not, the step S304 is carried out.
S303: determining that the micro control unit is abnormal, and sending a firmware file to the micro control unit so that the micro control unit can perform firmware upgrading based on the firmware file;
in a specific implementation, when the central processor receives the preset character, a firmware file is sent to the micro control unit, and the micro control unit performs firmware upgrade based on the firmware file.
As a preferred embodiment, sending a firmware file to the micro control unit includes: dividing the firmware file into a plurality of firmware subfiles according to a preset length, and sequentially sending the firmware subfiles to the micro control unit; the micro control unit replies a first response character if the firmware subfile is successfully received, and replies a second response character if the firmware subfile is failed to be received; after the target firmware subfile is sent to the micro control unit, if a first response character is received, continuing to send the next firmware subfile of the target firmware subfile to the micro control unit; if a second response character is received, the target firmware subfile is sent to the micro control unit again; after receiving a first response character corresponding to the last firmware subfile, sending a transmission completion mark to the micro control unit so that the central processing unit replies the first response character; and after receiving the first response character corresponding to the transmission completion mark, completing the transmission of the firmware file. The specific transmission manner of the firmware file is the same as that described in the first embodiment, and will not be described here again.
S304: sending a firmware upgrading instruction to the micro control unit so that the micro control unit replies the preset character;
s305: and when the preset character sent by the micro control unit is received, sending a firmware file to the micro control unit so that the micro control unit can perform firmware upgrading based on the firmware file.
In a specific implementation, when the CPU does not receive the preset character, a firmware upgrading instruction is sent to the micro control unit, and after the micro control unit receives the firmware upgrading instruction, the CPU replies the preset character to start transmission of the firmware file. After receiving the preset character, the central processing unit transmits a firmware file to the micro control unit, and the micro control unit receives the firmware file and performs firmware upgrading based on the firmware file.
It can be seen that this embodiment enables firmware upgrades under both normal and abnormal conditions of the micro control unit.
The following describes an application embodiment provided in the present application, where the micro control unit is specifically a power board, as shown in fig. 4, and may specifically include the following steps:
step 1: triggering firmware upgrade by application software and reading a firmware file;
step 2: the application software reads the serial port data and judges whether a character C is received or not; if not, entering a step 3; if yes, enter step 4;
step 3: the application software sends a firmware upgrading instruction to the power panel through the serial port and judges whether a character C is received or not; if not, the upgrade fails; if yes, enter step 4;
step 4: the application software transmits a firmware file to the power panel through the serial port and judges whether the firmware file is transmitted completely or not; if not, the step 5 is carried out, and if yes, the step 6 is carried out;
step 5: the application software sends an Xmodem-1K (STX) data packet to the power panel through the serial port, namely sends a firmware subfile with the length of 1K, and receives an ACK packet fed back by the power panel;
step 6: the application software sends an Xmodem-1K (EOT) data packet to the power panel through the serial port, and receives an ACK packet fed back by the power panel;
step 7: the power panel upgrades the firmware based on the received firmware file.
The following describes a micro control unit firmware upgrading device applied to a micro control unit according to an embodiment of the present application, and the micro control unit firmware upgrading device described below and the micro control unit firmware upgrading method described above may be referred to each other.
Referring to fig. 5, a block diagram of a firmware upgrade apparatus for a micro control unit according to an exemplary embodiment is shown, as shown in fig. 5, including:
a first sending module 501, configured to continuously send a preset character to a central processing unit connected to a communication unit when the micro control unit is abnormal, so that the central processing unit sends a firmware file after receiving the preset character;
the first upgrade module 502 is configured to receive the firmware file sent by the central processing unit, and perform firmware upgrade based on the firmware file.
According to the micro-control unit firmware upgrading device, when the micro-control unit is abnormal, the preset characters are continuously sent to the central processing unit, after the central processing unit receives the preset characters, the firmware file is transmitted to the micro-control unit, and the micro-control unit performs firmware upgrading based on the firmware file. Therefore, the firmware upgrading device for the micro control unit provided by the embodiment of the application realizes the firmware upgrading of the micro control unit under the abnormal condition and restores the normal working state of the micro control unit.
On the basis of the above embodiment, as a preferred implementation manner, the method further includes:
the receiving module is used for receiving the firmware upgrading instruction sent by the central processing unit and replying a preset character to the central processing unit so that the central processing unit can send a firmware file after receiving the preset character;
and the second upgrading module is used for receiving the firmware file sent by the central processing unit and upgrading the firmware based on the firmware file.
Based on the foregoing embodiment, as a preferred implementation manner, the first sending module 501 is specifically configured to: when the firmware upgrade fails, the preset character is continuously sent to the central processing unit connected with the communication.
On the basis of the above embodiment, as a preferred implementation manner, the central processing unit divides the firmware file into a plurality of firmware subfiles according to a preset length, and sends the firmware subfiles to the micro control unit in sequence;
accordingly, the first upgrade module 502 includes:
the receiving unit is used for receiving the target firmware subfiles sent by the central processing unit;
the first replying unit is used for replying a first response character to the central processing unit when the receiving is successful, so that the central processing unit continues to send the next firmware subfile of the target firmware subfile to the micro control unit after receiving the first response character;
and the second replying unit is used for replying a second response character to the central processing unit when the reception fails, so that the central processing unit sends the target firmware subfile to the micro control unit again after receiving the second response character.
On the basis of the foregoing embodiment, as a preferred implementation manner, the first upgrade module 502 further includes:
and the third replying unit is used for replying the first response character to the central processing unit when receiving the transmission completion mark sent by the central processing unit.
The following describes a micro control unit firmware upgrading device applied to a central processing unit according to an embodiment of the present application, and the micro control unit firmware upgrading device described below and the micro control unit firmware upgrading method described above applied to the central processing unit may be referred to each other.
Referring to fig. 6, another configuration diagram of a firmware upgrade apparatus for a micro control unit according to an exemplary embodiment is shown, as shown in fig. 6, including:
a reading module 601, configured to read a firmware file;
a judging module 602, configured to judge whether a preset character sent by the micro control unit is received;
and a second sending module 603, configured to determine that the micro control unit is abnormal when the preset character sent by the micro control unit is received, and send a firmware file to the micro control unit, so that the micro control unit performs firmware upgrade based on the firmware file.
According to the micro-control unit firmware upgrading device, when the micro-control unit is abnormal, the preset characters are continuously sent to the central processing unit, after the central processing unit receives the preset characters, the firmware file is transmitted to the micro-control unit, and the micro-control unit performs firmware upgrading based on the firmware file. Therefore, the firmware upgrading device for the micro control unit provided by the embodiment of the application realizes the firmware upgrading of the micro control unit under the abnormal condition and restores the normal working state of the micro control unit.
On the basis of the above embodiment, as a preferred implementation manner, the method further includes:
the third sending module is used for sending a firmware upgrading instruction to the micro control unit when the preset character sent by the micro control unit is not received, so that the micro control unit replies the preset character;
and the fourth sending module is used for sending a firmware file to the micro control unit when receiving the preset character sent by the micro control unit, so that the micro control unit can perform firmware upgrading based on the firmware file.
On the basis of the above embodiment, as a preferred implementation manner, the second sending module 603 or the fourth sending module is specifically configured to: dividing the firmware file into a plurality of firmware subfiles according to a preset length, and sequentially sending the firmware subfiles to the micro control unit; the micro control unit replies a first response character if the firmware subfile is successfully received, and replies a second response character if the firmware subfile is failed to be received; after the target firmware subfile is sent to the micro control unit, if a first response character is received, continuing to send the next firmware subfile of the target firmware subfile to the micro control unit; and if the second response character is received, the target firmware subfile is sent to the micro control unit again.
On the basis of the above embodiment, as a preferred implementation manner, the second sending module 603 or the fourth sending module is further configured to: after receiving a first response character corresponding to the last firmware subfile, sending a transmission completion mark to the micro control unit so that the central processing unit replies the first response character; and after receiving the first response character corresponding to the transmission completion mark, completing the transmission of the firmware file.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Based on the hardware implementation of the program modules, and in order to implement the method of the embodiments of the present application, the embodiments of the present application further provide an electronic device, fig. 7 is a block diagram of an electronic device according to an exemplary embodiment, and as shown in fig. 7, the electronic device includes:
a communication interface 1 capable of information interaction with other devices such as network devices and the like;
and the processor 2 is connected with the communication interface 1 to realize information interaction with other devices and is used for executing the firmware upgrading method of the micro control unit provided by one or more technical schemes when running the computer program. And the computer program is stored on the memory 3.
Of course, in practice, the various components in the electronic device are coupled together by a bus system 4. It will be appreciated that the bus system 4 is used to enable connected communications between these components. The bus system 4 comprises, in addition to a data bus, a power bus, a control bus and a status signal bus. But for clarity of illustration the various buses are labeled as bus system 4 in fig. 7.
The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program for operating on an electronic device.
It will be appreciated that the memory 3 may be either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. Wherein the nonvolatile Memory may be Read Only Memory (ROM), programmable Read Only Memory (PROM, programmable Read-Only Memory), erasable programmable Read Only Memory (EPROM, erasable Programmable Read-Only Memory), electrically erasable programmable Read Only Memory (EEPROM, electrically Erasable Programmable Read-Only Memory), magnetic random access Memory (FRAM, ferromagnetic random access Memory), flash Memory (Flash Memory), magnetic surface Memory, optical disk, or compact disk Read Only Memory (CD-ROM, compact Disc Read-Only Memory); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be random access memory (RAM, random Access Memory), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available, such as static random access memory (SRAM, static Random Access Memory), synchronous static random access memory (SSRAM, synchronous Static Random Access Memory), dynamic random access memory (DRAM, dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, synchronous Dynamic Random Access Memory), double data rate synchronous dynamic random access memory (ddr SDRAM, double Data Rate Synchronous Dynamic Random Access Memory), enhanced synchronous dynamic random access memory (ESDRAM, enhanced Synchronous Dynamic Random Access Memory), synchronous link dynamic random access memory (SLDRAM, syncLink Dynamic Random Access Memory), direct memory bus random access memory (DRRAM, direct Rambus Random Access Memory). The memory 3 described in the embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the embodiments of the present application may be applied to the processor 2 or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 2 or by instructions in the form of software. The processor 2 described above may be a general purpose processor, DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 2 may implement or perform the methods, steps and logic blocks disclosed in the embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied in a hardware decoding processor or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium in the memory 3 and the processor 2 reads the program in the memory 3 to perform the steps of the method described above in connection with its hardware.
The processor 2 implements corresponding flows in the methods of the embodiments of the present application when executing the program, and for brevity, will not be described in detail herein.
In an exemplary embodiment, the present application also provides a storage medium, i.e. a computer storage medium, in particular a computer readable storage medium, for example comprising a memory 3 storing a computer program executable by the processor 2 for performing the steps of the method described above. The computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware associated with program instructions, where the foregoing program may be stored in a computer readable storage medium, and when executed, the program performs steps including the above method embodiments; and the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.
Alternatively, the integrated units described above may be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partly contributing to the prior art, and the computer software product may be stored in a storage medium, and include several instructions to cause an electronic device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (13)

1. A method for upgrading firmware of a micro control unit, the method being applied to the micro control unit, the method comprising:
when the micro control unit is abnormal, continuously sending preset characters to a central processing unit connected with the communication unit, so that the central processing unit sends a firmware file after receiving the preset characters;
and receiving the firmware file sent by the central processing unit, and carrying out firmware upgrading based on the firmware file.
2. The method of firmware upgrade of a micro control unit according to claim 1, further comprising:
receiving a firmware upgrading instruction sent by the central processing unit, and replying a preset character to the central processing unit so that the central processing unit sends a firmware file after receiving the preset character;
and receiving the firmware file sent by the central processing unit, and carrying out firmware upgrading based on the firmware file.
3. The firmware upgrade method of a micro control unit according to claim 1, wherein when the micro control unit is abnormal, continuously transmitting a preset character to a communication-connected central processing unit, comprising:
when the firmware upgrade fails, the preset character is continuously sent to the central processing unit connected with the communication.
4. A method of upgrading firmware of a micro control unit according to any one of claims 1 to 3, wherein the central processor divides the firmware file into a plurality of firmware subfiles according to a preset length and sequentially transmits the firmware subfiles to the micro control unit;
correspondingly, the receiving the firmware file sent by the central processing unit includes:
receiving a target firmware subfile sent by the central processing unit;
if the receiving is successful, replying a first response character to the central processing unit, so that the central processing unit continues to send the next firmware subfile of the target firmware subfile to the micro control unit after receiving the first response character;
if the receiving fails, replying a second response character to the central processing unit, so that the central processing unit sends the target firmware subfile to the micro control unit again after receiving the second response character.
5. The method for upgrading firmware of a micro control unit according to claim 4, further comprising:
and replying the first response character to the central processing unit when receiving a transmission completion flag sent by the central processing unit.
6. A method for upgrading firmware of a micro control unit, applied to a central processing unit, the method comprising:
reading a firmware file;
judging whether a preset character sent by a micro control unit is received or not;
and if the preset character sent by the micro control unit is received, judging that the micro control unit is abnormal, and sending a firmware file to the micro control unit so that the micro control unit can perform firmware upgrading based on the firmware file.
7. The method of firmware upgrade of a micro control unit according to claim 6, further comprising:
if the preset character sent by the micro control unit is not received, a firmware upgrading instruction is sent to the micro control unit so that the micro control unit replies the preset character;
and when the preset character sent by the micro control unit is received, sending a firmware file to the micro control unit so that the micro control unit can perform firmware upgrading based on the firmware file.
8. The firmware upgrade method of a micro control unit according to claim 6 or 7, wherein transmitting a firmware file to the micro control unit comprises:
dividing the firmware file into a plurality of firmware subfiles according to a preset length, and sequentially sending the firmware subfiles to the micro control unit; the micro control unit replies a first response character if the firmware subfile is successfully received, and replies a second response character if the firmware subfile is failed to be received;
after the target firmware subfile is sent to the micro control unit, if a first response character is received, continuing to send the next firmware subfile of the target firmware subfile to the micro control unit; and if the second response character is received, the target firmware subfile is sent to the micro control unit again.
9. The method of firmware upgrade of a micro control unit according to claim 8, further comprising:
after receiving a first response character corresponding to the last firmware subfile, sending a transmission completion mark to the micro control unit so that the central processing unit replies the first response character;
and after receiving the first response character corresponding to the transmission completion mark, completing the transmission of the firmware file.
10. A micro-control unit firmware upgrade apparatus, applied to a micro-control unit, the apparatus comprising:
the first sending module is used for continuously sending preset characters to the central processing unit connected in a communication way when the micro control unit is abnormal, so that the central processing unit sends a firmware file after receiving the preset characters;
and the first upgrading module is used for receiving the firmware file sent by the central processing unit and upgrading the firmware based on the firmware file.
11. A micro control unit firmware upgrade apparatus applied to a central processing unit, the apparatus comprising:
the reading module is used for reading the firmware file;
the judging module is used for judging whether a preset character sent by the micro control unit is received or not;
and the second sending module is used for judging that the micro control unit is abnormal when the preset character sent by the micro control unit is received, and sending a firmware file to the micro control unit so that the micro control unit can perform firmware upgrading based on the firmware file.
12. An electronic device, comprising:
a memory for storing a computer program;
processor for implementing the steps of the micro control unit firmware upgrade method according to any one of claims 1 to 9 when executing said computer program.
13. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the micro control unit firmware upgrade method according to any one of claims 1 to 9.
CN202210901103.XA 2022-07-28 2022-07-28 Micro control unit firmware upgrading method and device, electronic equipment and storage medium Pending CN117519737A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210901103.XA CN117519737A (en) 2022-07-28 2022-07-28 Micro control unit firmware upgrading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210901103.XA CN117519737A (en) 2022-07-28 2022-07-28 Micro control unit firmware upgrading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117519737A true CN117519737A (en) 2024-02-06

Family

ID=89740542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210901103.XA Pending CN117519737A (en) 2022-07-28 2022-07-28 Micro control unit firmware upgrading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117519737A (en)

Similar Documents

Publication Publication Date Title
US20080300020A1 (en) Wireless communication system, sim card, mobile communication terminal, and data guaranteeing method
CN109976767B (en) Software burning method and device
US20210318738A1 (en) Methods and apparatus for enhanced power delivery between devices
JP2010140266A (en) Electronic device system and electronic device
WO2005057400A1 (en) Electronic device, control method thereof, host device, and control method thereof
CN114281394A (en) Method, system, equipment and medium for fast on-line upgrading program
CN112448450A (en) Charging control method and device, electronic equipment and storage medium
CN114064080A (en) Vehicle software upgrading method, device, equipment and storage medium
CN111970102A (en) Data processing method and device, electronic equipment and storage medium
CN112698851A (en) Program update system, program transfer device, and program transfer method
CN113656049B (en) Operating system deployment method and device, electronic equipment and storage medium
CN105930284A (en) Method and device for loading FPGA
CN117519737A (en) Micro control unit firmware upgrading method and device, electronic equipment and storage medium
CN113051207A (en) Data processing method and device, electronic equipment and storage medium
CN113407465A (en) Switch configuration method and device of baseboard management controller and computer equipment
CN111177046B (en) Method and device for multi-bus device fusion access
CN116185512B (en) Drive loading method, device, equipment and medium for PTC driver
JP6946027B2 (en) IC cards, portable electronic devices, programs, processing devices and processing systems
CN114003535B (en) Device bandwidth configuration method and system, electronic device and storage medium
CN115065966B (en) Terminal and communication method
CN117519789A (en) Micro control unit control method and device, electronic equipment and storage medium
KR101660180B1 (en) Ic card, portable electronic apparatus, and ic card processing apparatus
JP2007072695A (en) Redundancy storage method and program to flash memory
EP2642411B1 (en) IC card and command processing method for IC card
CN111064488B (en) Transmitting/receiving device, transmitting/receiving system, storage medium, and transmitting/receiving method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination