A low power consumption optimization method for MCU of IoT terminal equipment

By using low-power Bluetooth and external off-chip flash chips in IoT terminal devices, the rapid stability and low power consumption of the MCU upgrade process are achieved, and problems such as high power consumption, high cost and equipment damage in the existing technology are solved, which improves selectivity and reduces costs.

CN119789073APending Publication Date: 2025-04-08XIAN CHINASTAR M&C LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411938149.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing MCU upgrade methods for IoT terminal devices have problems such as high power consumption, high cost, and failure to upgrade may damage the equipment. The upgrade process has great requirements for the MCU on-chip flash and is less selective.

Method used

Low-power Bluetooth is used as the transit, and the upgrade files are temporarily stored by external off-chip flash chips and automatically managed the upgrade status, achieving rapid and stable MCU upgrade process and low power consumption.

Benefits of technology

It realizes rapid stability and low power consumption of the MCU upgrade process, reduces the risk of device damage, reduces the requirement for on-chip flash of the MCU, improves selectivity and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119789073A_ABST
    Figure CN119789073A_ABST
Patent Text Reader

Abstract

The present invention discloses a method for optimizing MCU low power consumption of an Internet of Things terminal device, including: 1. Broadcasting device identification information of the Internet of Things terminal device; 2. Screening the device to be upgraded by the intelligent terminal; 3. The device to be upgraded sends a Bluetooth request message and writes the received message into an off-chip flash; 4. After obtaining the upgrade package, the Bluetooth wakes up the MCU while feeding back to the intelligent terminal; 5. The MCU changes from the normal operation state to the ready upgrade state and sends an upgrade package request message to the Bluetooth; 6. The Bluetooth reads the off-chip flash and sends the upgrade file to the MCU; 7. The MCU changes from the ready upgrade state to the installation completion state; 8. The MCU changes from the installation completion state to the normal operation state; 9. The Bluetooth broadcasts the identification information of the new device. The present invention does not need to be connected before Bluetooth upgrade, but only needs to scan the device Bluetooth broadcast device identification information, screen the device to be upgraded from the scanned device, and automatically re-upgrade without damaging the device if an unexpected situation occurs during the upgrade process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of upgrading terminal equipment of Internet of Things, and in particular relates to a method for optimizing the low power consumption of an MCU of a terminal equipment of Internet of Things. Background Art

[0002] Most IoT devices are powered by batteries, which have high requirements for power consumption and protection level. Once installed and disassembled, it is difficult to upgrade and optimize the device functions. At present, IoT devices use low-power Bluetooth as a transfer, which is fast and stable without disassembly. Most of the current Bluetooth upgrade solutions require the installation of host computer programs, and they all have high requirements for the flash on the MCU chip that needs to be upgraded. To ensure the stability and reliability of the device, it is necessary to keep a copy of the original user program or the last user program that can run normally in the flash on the MCU chip. If the upgrade fails, it will roll back to this user program. This upgrade method requires a bootloader program to be kept in the flash on the MCU chip. Two user programs will inevitably lead to lower selectivity and higher costs when selecting MCUs, and even cannot be implemented when the upgrade file is large. In addition, the upgrade and optimization process requires Bluetooth to be connected in sequence, which consumes a lot of power; if the power is off or other unexpected situations occur during the upgrade process, the device will often be damaged. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a low-power consumption optimization method for MCU of an Internet of Things terminal device in view of the deficiencies in the above-mentioned prior art.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: a low power consumption optimization method of MCU of Internet of Things terminal equipment, characterized in that the method comprises the following steps:

[0005] Step 1: The IoT terminal device broadcasts device identification information: the IoT terminal device includes an MCU and a Bluetooth module communicating with the MCU, the Bluetooth module is externally equipped with an off-chip flash chip, and the device identification information includes the MCU operating status, device serial number, and software version number;

[0006] When the MCU is powered on, it sends its own device identification information to the Bluetooth module, and the Bluetooth module broadcasts the device identification information;

[0007] The MCU operation status includes normal operation status, ready to upgrade status and installation completion status;

[0008] Step 2: The smart terminal selects the IoT terminal device to be upgraded: the smart terminal scans the Bluetooth module broadcast device identification information, selects the IoT terminal device to be upgraded, connects and sends the upgrade file information to the Bluetooth module of the IoT terminal device to be upgraded;

[0009] Step 3: The Bluetooth module of the IoT terminal device to be upgraded requests an upgrade package message from the smart terminal and writes the received upgrade package into an off-chip flash chip;

[0010] Step 4: After the Bluetooth module obtains the upgrade package, it feeds back to the smart terminal and wakes up the MCU at the same time: the Bluetooth module reads the upgrade file from the off-chip flash chip and verifies the file CRC. After the verification is passed, it sends a reception completion message to the smart terminal, wakes up the MCU at the same time, and sends the upgrade file information to the MCU;

[0011] Step 5. The MCU changes from the normal operation state to the ready-to-upgrade state and sends request messages of the upgrade package sub-packet data to the Bluetooth module in sequence: the MCU performs CRC check on the upgrade file information, and after verification, changes the upgrade status flag of the on-chip flash to: ready-to-upgrade state, writes the upgrade file information at the same time, and then restarts to enter the bootloader program; and actively sends request messages of the upgrade package sub-packet data to the Bluetooth module in sequence;

[0012] Step 6: The Bluetooth module reads the external flash chip and sends the upgrade file to the MCU;

[0013] Step 7: MCU changes from the ready-to-upgrade state to the installation-completed state: After the MCU receives the upgrade file, it changes the upgrade status flag of the on-chip flash to the installation-completed state and jumps to the user program to run;

[0014] When an unexpected error occurs during the MCU receiving the upgrade file and the execution fails, the upgrade status mark of the on-chip flash is: ready to upgrade or installation completed, and the IoT terminal device will erase the current user program and automatically restart;

[0015] Step 8: MCU changes from installation completion state to normal operation state: after the user program runs normally, the upgrade state flag of the on-chip flash is modified to normal operation state, and an upgrade completion message and new device identification information are sent to the Bluetooth module;

[0016] Step 9. The Bluetooth module broadcasts new device identification information: After receiving the upgrade completion message, the Bluetooth module sends the upgrade completion message to the smart terminal and broadcasts the new device identification information. After receiving the message, the smart terminal displays the upgrade completion information to the user.

[0017] The above-mentioned low-power consumption optimization method for MCU of an Internet of Things terminal device is characterized in that: in step one, the Bluetooth module broadcasts device identification information at a regular interval, and is in a low-power sleep state during the broadcast interval.

[0018] The above-mentioned method for optimizing MCU low power consumption of an IoT terminal device is characterized in that: the smart terminal includes a WeChat applet.

[0019] The above-mentioned low-power consumption optimization method for MCU of an Internet of Things terminal device is characterized in that the upgrade file information includes file size, sub-packet size, number of sub-packets and file CRC check value.

[0020] The above-mentioned method for optimizing MCU low power consumption of an Internet of Things terminal device is characterized in that: in step 3, the Bluetooth module of the Internet of Things terminal device to be upgraded requests a message and writes the received message into an off-chip flash chip, and the process is as follows:

[0021] Step 301: After receiving the upgrade file information, the Bluetooth module verifies the CRC check value in the upgrade file information, and after the check passes, sends a message requesting sub-packet data to the smart terminal;

[0022] Step 302: After receiving the message information requesting the sub-packet data, the intelligent terminal sends the corresponding sub-packet data to the Bluetooth module. After the sending is completed, there is no need to confirm the sending result and wait for the response signal. It only needs to wait for the next packet of message information requesting the sub-packet data or the reception completion message;

[0023] The sub-package data includes the sub-package number, the upgrade package sub-package data and the sub-package data CRC;

[0024] Step 303: The Bluetooth module receives the sub-packet data and writes it into the off-chip flash chip after verification, and then sends the next packet of message information requesting the sub-packet data;

[0025] Step 304: loop step 302 and step 303 until the upgrade package is acquired.

[0026] The above-mentioned method for optimizing MCU low power consumption of an IoT terminal device is characterized in that: in step 6, the process in which the Bluetooth module reads the off-chip flash chip and sends the upgrade file to the MCU is as follows:

[0027] Step 601: After receiving the request message, the Bluetooth module reads the off-chip flash chip and sends the corresponding upgrade package sub-package data to the MCU;

[0028] Step 602: The MCU receives the upgrade package sub-packet data and writes it into the on-chip flash after verification, and sends a request message for the next upgrade package sub-packet data;

[0029] Step 603: loop step 601 and step 602 until receiving the upgrade file is completed.

[0030] The above-mentioned method for optimizing MCU low power consumption in an Internet of Things terminal device is characterized in that: in steps one to four, the MCU is not aware of the communication process between the smart terminal and the Bluetooth module, and the operating state is not affected; when an error occurs during the communication process between the smart terminal and the Bluetooth module, the upgrade is exited and an error is reported.

[0031] The above-mentioned method for optimizing MCU low power consumption in an IoT terminal device is characterized in that: in steps 5 to 7, the upgrade status flag of the on-chip flash is: ready to upgrade status or installation completed status, and the MCU is running in the bootloader program at this time;

[0032] When an unexpected error occurs, the current user program will be erased. When the bootloader program reads the upgrade status mark as ready to upgrade, it will request the Bluetooth module to obtain the upgrade file package again; if the upgrade status mark is installed, it will send a user program failure message to the Bluetooth module, prompting the user to resend the upgrade package to the Bluetooth module.

[0033] Compared with the prior art, the present invention has the following advantages:

[0034] 1. The present invention adopts low-power Bluetooth as a transfer to upgrade the MCU of the Internet of Things terminal equipment. The upgrade is fast and stable, and the low power consumption state can be maintained during normal operation. In the normal working mode (non-upgrade state), the current MCU working state can be broadcasted through Bluetooth, so that the user can control the device operation state in real time; Bluetooth does not need to be connected, and the software version number and device operation state of the device to be upgraded can be obtained by scanning the Bluetooth broadcast of the device to be upgraded to determine whether an upgrade is required; when there are multiple devices, there is no need to connect one by one to determine whether an upgrade is required, and the device to be upgraded only needs to be selected from the scanned device list.

[0035] 2. The present invention uses WeChat applet as the user operation interface, and there is no need to install additional applications. If there is a power outage or other unexpected situations during the upgrade process, the current user program will be erased, and the device can be automatically re-upgraded after powering on or restarting automatically without damaging the device due to the upgrade.

[0036] 3. The method of the present invention has simple steps, and uses an external flash chip to temporarily store upgrade files and automatically manage the upgrade status to ensure stable and reliable upgrades, and has no great requirements on the on-chip flash of the Bluetooth module and the main control MCU.

[0037] In summary, the present invention adopts an external off-chip flash chip and a method for automatically managing the upgrade status to ensure that the upgrade process is stable and reliable while having no high requirements on the Bluetooth module and the MCU chip flash; Bluetooth does not need to be connected, and only the Bluetooth broadcast of the device to be upgraded needs to be scanned to obtain the software version number of the device to be upgraded and the device operation status to determine whether an upgrade is required; when there are multiple devices, there is no need to connect one by one to determine whether an upgrade is required, and only the device to be upgraded needs to be selected from the scanned device list; if there is a power outage or other unexpected situations during the upgrade process, the current user program will be erased, and the device can be automatically re-upgraded when it is powered on again or automatically restarted, and the device will not be damaged due to the upgrade, which is convenient for popularization and use.

[0038] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 The figure is a flowchart of the method of the present invention.

[0040] Figure 2 The smart terminal of the present invention sends the upgrade file to the Bluetooth module of the Internet of Things terminal device to be upgraded.

[0041] Figure 3 The Bluetooth module of the present invention wakes up the MCU to prepare for upgrading.

[0042] Figure 4 The MCU of the present invention actively obtains the upgrade file.

[0043] Figure 5 The present invention provides bootloader program-upgrade status management for the MCU.

[0044] Figure 6 It is the MCU user program-upgrade status management of the present invention. DETAILED DESCRIPTION

[0045] like Figures 1 to 6 As shown, a low power consumption optimization method for an Internet of Things terminal device MCU of the present invention comprises the following steps:

[0046] Step 1: The IoT terminal device broadcasts device identification information: the IoT terminal device includes an MCU and a Bluetooth module communicating with the MCU, the Bluetooth module is externally equipped with an off-chip flash chip, and the device identification information includes the MCU operating status, device serial number, and software version number;

[0047] When the MCU is powered on, it sends its own device identification information to the Bluetooth module, and the Bluetooth module broadcasts the device identification information;

[0048] The MCU operation status includes normal operation status, ready to upgrade status and installation completion status;

[0049] Step 2: The smart terminal selects the IoT terminal device to be upgraded: the smart terminal scans the Bluetooth module broadcast device identification information, selects the IoT terminal device to be upgraded, connects and sends the upgrade file information to the Bluetooth module of the IoT terminal device to be upgraded;

[0050] Step 3: The Bluetooth module of the IoT terminal device to be upgraded requests an upgrade package message from the smart terminal and writes the received upgrade package into an off-chip flash chip;

[0051] Step 4: After the Bluetooth module obtains the upgrade package, it feeds back to the smart terminal and wakes up the MCU at the same time: the Bluetooth module reads the upgrade file from the off-chip flash chip and verifies the file CRC. After the verification is passed, it sends a reception completion message to the smart terminal, wakes up the MCU at the same time, and sends the upgrade file information to the MCU;

[0052] Step 5. The MCU changes from the normal operation state to the ready-to-upgrade state and sends request messages of the upgrade package sub-packet data to the Bluetooth module in sequence: the MCU performs CRC check on the upgrade file information, and after verification, changes the upgrade status flag of the on-chip flash to: ready-to-upgrade state, writes the upgrade file information at the same time, and then restarts to enter the bootloader program; and actively sends request messages of the upgrade package sub-packet data to the Bluetooth module in sequence;

[0053] Step 6: The Bluetooth module reads the external flash chip and sends the upgrade file to the MCU;

[0054] Step 7: MCU changes from the ready-to-upgrade state to the installation-completed state: After the MCU receives the upgrade file, it changes the upgrade status flag of the on-chip flash to the installation-completed state and jumps to the user program to run;

[0055] When an unexpected error occurs during the MCU receiving the upgrade file and the execution fails, the upgrade status mark of the on-chip flash is: ready to upgrade or installation completed, and the IoT terminal device will erase the current user program and automatically restart;

[0056] Step 8: MCU changes from installation completion state to normal operation state: after the user program runs normally, the upgrade state flag of the on-chip flash is modified to normal operation state, and an upgrade completion message and new device identification information are sent to the Bluetooth module;

[0057] Step 9. The Bluetooth module broadcasts new device identification information: After receiving the upgrade completion message, the Bluetooth module sends the upgrade completion message to the smart terminal and broadcasts the new device identification information. After receiving the message, the smart terminal displays the upgrade completion information to the user.

[0058] In this embodiment, in step 1, the Bluetooth module broadcasts device identification information periodically, and is in a low-power sleep state during the broadcast intervals.

[0059] In this embodiment, the smart terminal includes a WeChat applet.

[0060] In this embodiment, the upgrade file information includes file size, sub-packet size, number of sub-packets and file CRC check value.

[0061] In this embodiment, in step 3, the Bluetooth module of the IoT terminal device to be upgraded requests a message and writes the received message into an off-chip flash chip. The process is as follows:

[0062] Step 301: After receiving the upgrade file information, the Bluetooth module verifies the CRC check value in the upgrade file information, and after the check passes, sends a message requesting sub-packet data to the smart terminal;

[0063] Step 302: After receiving the message information requesting the sub-packet data, the intelligent terminal sends the corresponding sub-packet data to the Bluetooth module. After the sending is completed, there is no need to confirm the sending result and wait for the response signal. It only needs to wait for the next packet of message information requesting the sub-packet data or the reception completion message;

[0064] The sub-package data includes the sub-package number, the upgrade package sub-package data and the sub-package data CRC;

[0065] Step 303: The Bluetooth module receives the sub-packet data and writes it into the off-chip flash chip after verification, and then sends the next packet of message information requesting the sub-packet data;

[0066] Step 304: loop step 302 and step 303 until the upgrade package is acquired.

[0067] In this embodiment, in step 6, the process in which the Bluetooth module reads the off-chip flash chip and sends the upgrade file to the MCU is as follows:

[0068] Step 601: After receiving the request message, the Bluetooth module reads the off-chip flash chip and sends the corresponding upgrade package sub-package data to the MCU;

[0069] Step 602: The MCU receives the upgrade package sub-packet data and writes it into the on-chip flash after verification, and sends a request message for the next upgrade package sub-packet data;

[0070] Step 603: loop step 601 and step 602 until receiving the upgrade file is completed.

[0071] In this embodiment, in steps 1 to 4, the MCU is not aware of the communication process between the smart terminal and the Bluetooth module, and the operating status is not affected; if an error occurs during the communication process between the smart terminal and the Bluetooth module, the upgrade is exited and an error is reported.

[0072] In this embodiment, in step 5 to step 7, the upgrade status flag of the on-chip flash is: ready to upgrade status or installation completed status, at which time the MCU runs the bootloader program;

[0073] When an unexpected error occurs, the current user program will be erased. When the bootloader program reads the upgrade status mark as ready to upgrade, it will request the Bluetooth module to obtain the upgrade file package again; if the upgrade status mark is installed, it will send a user program failure message to the Bluetooth module, prompting the user to resend the upgrade package to the Bluetooth module.

[0074] When the present invention is used, low-power Bluetooth is used as a transfer to upgrade the MCU of the Internet of Things terminal device. The upgrade is fast and stable, and the low-power consumption state can be maintained during normal operation. In the normal working mode (non-upgrade state), the current MCU working state can be broadcasted through Bluetooth, so that the user can control the device running state in real time; Bluetooth does not need to be connected, and the software version number and the device running state of the device to be upgraded can be obtained by scanning the Bluetooth broadcast of the device to be upgraded, so as to judge whether an upgrade is needed; when there are multiple devices, there is no need to connect one by one to judge whether an upgrade is needed, and it is only necessary to select the device to be upgraded from the scanned device list; the WeChat applet is used as the user operation interface, and no additional application program needs to be installed; if a power outage or other unexpected situations occur during the upgrade process, the current user program will be erased, and the device can be automatically re-upgraded after being powered on again or automatically restarted, and the device will not be damaged due to the upgrade; the method of using an external off-chip flash chip to temporarily store upgrade files and automatically manage the upgrade state ensures that the upgrade is stable and reliable, and there is no great requirement for the on-chip flash of the Bluetooth module and the main control MCU.

[0075] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A method for optimizing the low power consumption of MCU of an Internet of Things terminal device, characterized in that: The method comprises the following steps: Step 1: The IoT terminal device broadcasts device identification information: the IoT terminal device includes an MCU and a Bluetooth module communicating with the MCU, the Bluetooth module is externally equipped with an off-chip flash chip, and the device identification information includes the MCU operating status, device serial number, and software version number; When the MCU is powered on, it sends its own device identification information to the Bluetooth module, and the Bluetooth module broadcasts the device identification information; The MCU operation status includes normal operation status, ready to upgrade status and installation completion status; Step 2: The smart terminal selects the IoT terminal device to be upgraded: the smart terminal scans the Bluetooth module broadcast device identification information, selects the IoT terminal device to be upgraded, connects and sends the upgrade file information to the Bluetooth module of the IoT terminal device to be upgraded; Step 3: The Bluetooth module of the IoT terminal device to be upgraded requests an upgrade package message from the smart terminal and writes the received upgrade package into an off-chip flash chip; Step 4: After the Bluetooth module obtains the upgrade package, it feeds back to the smart terminal and wakes up the MCU at the same time: the Bluetooth module reads the upgrade file from the off-chip flash chip and verifies the file CRC. After the verification is passed, it sends a reception completion message to the smart terminal, wakes up the MCU at the same time, and sends the upgrade file information to the MCU; Step 5. The MCU changes from the normal operation state to the ready-to-upgrade state and sends request messages of the upgrade package sub-packet data to the Bluetooth module in sequence: the MCU performs CRC check on the upgrade file information, and after verification, changes the upgrade status flag of the on-chip flash to: ready-to-upgrade state, writes the upgrade file information at the same time, and then restarts to enter the bootloader program; and actively sends request messages of the upgrade package sub-packet data to the Bluetooth module in sequence; Step 6: The Bluetooth module reads the external flash chip and sends the upgrade file to the MCU; Step 7: MCU changes from the ready-to-upgrade state to the installation-completed state: After the MCU receives the upgrade file, it changes the upgrade status flag of the on-chip flash to the installation-completed state and jumps to the user program to run; When an unexpected error occurs during the MCU receiving the upgrade file and the execution fails, the upgrade status mark of the on-chip flash is: ready to upgrade or installation completed, and the IoT terminal device will erase the current user program and automatically restart; Step 8: MCU changes from installation completion state to normal operation state: after the user program runs normally, the upgrade state flag of the on-chip flash is modified to normal operation state, and an upgrade completion message and new device identification information are sent to the Bluetooth module; Step 9. The Bluetooth module broadcasts new device identification information: After receiving the upgrade completion message, the Bluetooth module sends the upgrade completion message to the smart terminal and broadcasts the new device identification information. After receiving the message, the smart terminal displays the upgrade completion information to the user.

2. A method for optimizing the low power consumption of an MCU of an Internet of Things terminal device according to claim 1, characterized in that: In step 1, the Bluetooth module broadcasts device identification information periodically and is in a low-power sleep state during the broadcast intervals.

3. A method for optimizing the low power consumption of an MCU of an Internet of Things terminal device according to claim 1, characterized in that: The smart terminal includes a WeChat applet.

4. A method for optimizing the low power consumption of an MCU of an Internet of Things terminal device according to claim 1, characterized in that: The upgrade file information includes file size, sub-packet size, number of sub-packets and file CRC check value.

5. A method for optimizing the low power consumption of an MCU of an Internet of Things terminal device according to claim 4, characterized in that: In step 3, the Bluetooth module of the IoT terminal device to be upgraded requests a message and writes the received message into an off-chip flash chip. The process is as follows: Step 301: After receiving the upgrade file information, the Bluetooth module verifies the CRC check value in the upgrade file information, and after the check passes, sends a message requesting sub-packet data to the smart terminal; Step 302: After receiving the message information requesting the sub-packet data, the intelligent terminal sends the corresponding sub-packet data to the Bluetooth module. After the sending is completed, there is no need to confirm the sending result and wait for the response signal. It only needs to wait for the next packet of message information requesting the sub-packet data or the reception completion message; The sub-package data includes the sub-package number, the upgrade package sub-package data and the sub-package data CRC; Step 303: The Bluetooth module receives the sub-packet data and writes it into the off-chip flash chip after verification, and then sends the next packet of message information requesting the sub-packet data; Step 304: loop step 302 and step 303 until the upgrade package is acquired.

6. A method for optimizing low power consumption of an MCU of an Internet of Things terminal device according to claim 1, characterized in that: In step 6, the process of the Bluetooth module reading the external flash chip and sending the upgrade file to the MCU is as follows: Step 601: After receiving the request message, the Bluetooth module reads the off-chip flash chip and sends the corresponding upgrade package data to the MCU; Step 602: The MCU receives the upgrade package sub-packet data and writes it into the on-chip flash after verification, and sends a request message for the next upgrade package sub-packet data; Step 603: loop step 601 and step 602 until receiving the upgrade file is completed.

7. A method for optimizing low power consumption of an MCU of an Internet of Things terminal device according to claim 1, characterized in that: In step 1 to step 4, the MCU is not aware of the communication process between the smart terminal and the Bluetooth module, and the operating status is not affected; if an error occurs during the communication process between the smart terminal and the Bluetooth module, the upgrade is exited and an error is reported.

8. A method for optimizing the low power consumption of an MCU of an Internet of Things terminal device according to claim 1, characterized in that: In step 5 to step 7, the upgrade status flag of the on-chip flash is: ready to upgrade status or installation completed status, at which time the MCU runs the bootloader program; When an unexpected error occurs, the current user program is erased. When the bootloader program reads the upgrade status flag as ready to upgrade, it requests the Bluetooth module to obtain the upgrade file package again. If the upgrade status flag is read as the installation completed state, a user program cannot be run message is sent to the Bluetooth module, prompting the user to resend the upgrade package to the Bluetooth module.