A method and apparatus for remote cross-upgrading of MCU platform IAP and APP

By receiving and processing upgrade instructions and data at the APP layer of the MCU platform, remote cross-upgrades of IAP and APP are realized, simplifying the upgrade process, enhancing convenience and stability during the upgrade process, solving the problems of the inability of the IAP layer to upgrade remotely and the complexity of APP layer upgrades in the existing technology, and realizing the restoration of the device's state during operation.

CN122308868APending Publication Date: 2026-06-30紫光天际(南京)科技有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
紫光天际(南京)科技有限公司
Filing Date
2026-03-26
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In the existing technology, the IAP layer upgrade of the MCU platform cannot be remotely achieved through OTA. The upgrade process of the APP layer is complicated and requires product restart, which makes the upgrade operation inconvenient and unstable.

Method used

By receiving upgrade instructions and data at the APP layer of the MCU platform, generating upgrade control information, and writing it into a shared temporary storage area, the system triggers a jump to the IAP layer to load and verify firmware data, thereby enabling remote cross-upgrades between IAP and APP.

Benefits of technology

It simplifies the upgrade process, improves the convenience and stability of remote upgrades, reduces the logic code usage of IAP programs, and ensures device status recovery in the event of upgrade failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122308868A_ABST
    Figure CN122308868A_ABST
Patent Text Reader

Abstract

This disclosure relates to the field of microcontroller technology, specifically to a method and apparatus for remote cross-upgrading of IAP and APP on an MCU platform. By uniformly receiving upgrade commands and data at the APP layer and cooperating with a shared temporary storage area for state transitions, the system acquires the ability to perform OTA remote overwrite and iteration of IAP layer firmware, realizing remote updates of the IAP layer firmware. Secondly, the device can directly obtain upgrade data and trigger subsequent upgrade mechanisms while the APP program is running normally, replacing the existing process that requires the device to restart and enter the IAP layer before the upgrade operation can begin, simplifying the firmware upgrade execution steps and improving the convenience of firmware upgrades.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of microcontroller unit (MCU) technology, and specifically to a method and apparatus for remote cross-upgrading of MCU platform IAP and APP. Background Technology

[0002] For firmware updates of MCU platform products, over-the-air (OTA) upgrades serve as a fundamental operating method to support the functional evolution of various IoT and smart terminals. Their stable and efficient execution in complex application scenarios is a core technology ensuring the long-term reliable operation and continuous iteration of massive numbers of devices. In common MCU platform architectures, code is typically divided into an in-application programming (IAP) layer responsible for status self-checks and firmware upgrades, and an application layer (APP) responsible for actual application functions.

[0003] However, the fixed division of responsibilities in related technologies prevents IAP layer upgrades from being remotely implemented via OTA, and the upgrade process for the APP layer is complex, typically requiring the product to first perform a reboot to enter the IAP layer before triggering the upgrade process. Therefore, providing a mechanism that simplifies the upgrade process and enables remote cross-upgrades between IAP and APP to improve the convenience and overall stability of remote product upgrades has become an urgent problem to be solved. Summary of the Invention

[0004] In view of this, this disclosure provides a method and apparatus for remote cross-upgrading of MCU platform IAP and APP, in order to solve the problem of how to provide a mechanism that simplifies the upgrade operation process and enables remote cross-upgrading of IAP and APP, so as to improve the convenience and overall stability of product remote upgrades.

[0005] This disclosure provides a method for remote cross-upgrading of MCU platform IAP and APP, the method including: The APP program running in the APP firmware area of ​​the MCU platform receives upgrade instructions and upgrade firmware data, generates upgrade control information containing the upgrade object and current status based on the upgrade instructions, and writes the upgrade firmware data and upgrade control information into the shared temporary storage area. After the firmware upgrade data is received, the upgrade control information will be updated to the pending upgrade state, and a jump to the IAP firmware area in the MCU platform will be triggered. The upgrade control information in the shared temporary storage area is read by the IAP program running in the IAP firmware area; If the upgrade control information indicates that the upgrade target is IAP, the upgrade firmware data in the shared temporary storage area will be loaded into memory for execution, and after verification, the upgrade firmware data will be overwritten to the IAP firmware area. If the upgrade control information indicates that the upgrade target is an APP, then jump to the APP firmware area to load the upgrade firmware data in the shared temporary storage area into memory for execution, and after verification, overwrite the APP firmware area with the upgrade firmware data.

[0006] This disclosure also provides a remote cross-upgrade device for MCU platform IAP and APP, the device comprising: The receiving and writing module is used to receive upgrade instructions and upgrade firmware data through the APP program running in the APP firmware area of ​​the MCU platform, generate upgrade control information containing the upgrade object and current status based on the upgrade instructions, and write the upgrade firmware data and upgrade control information into the shared temporary storage area. The status update and jump module is used to update the upgrade control information to the upgrade-ready status after the firmware data to be upgraded is received, and to trigger a jump to the IAP firmware area in the MCU platform. The information reading module is used to read upgrade control information in the shared temporary storage area through the IAP program running in the IAP firmware area; The IAP upgrade execution module is used to load the upgrade firmware data in the shared temporary storage area into memory and run it if the upgrade control information indicates that the upgrade object is IAP, and overwrite the IAP firmware area with the upgrade firmware data after verification. The APP upgrade execution module is used to jump to the APP firmware area if the upgrade control information indicates that the upgrade object is the APP, so as to load the upgrade firmware data in the shared temporary storage area into memory for execution, and overwrite the APP firmware area with the upgrade firmware data after verification.

[0007] This disclosure also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the remote cross-upgrade method of any of the above-described MCU platform IAP and APP.

[0008] This disclosure also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described remote cross-upgrade methods for MCU platform IAP and APP.

[0009] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described remote cross-upgrade methods for MCU platform IAP and APP.

[0010] In the remote cross-upgrade method and apparatus for MCU platform IAP and APP in the above embodiments of this disclosure, firstly, by uniformly receiving upgrade instructions and data at the APP layer and cooperating with a shared temporary storage area for state transition, the system is equipped with the ability to perform OTA remote overwrite and iteration of IAP layer firmware, realizing remote update of IAP layer firmware. Secondly, the device can directly obtain upgrade data and trigger subsequent upgrade mechanisms while the APP program is running normally, replacing the process in the prior art that requires the device to restart and enter the IAP layer before the upgrade operation can be started, simplifying the execution steps of firmware upgrade and improving the convenience of firmware upgrade. Finally, by transferring the data receiving function to the APP layer, the logic code and FLASH space occupation of the IAP program are reduced; at the same time, before performing physical firmware overwrite, the system loads the upgrade firmware data into memory for running verification, and with the temporary storage and backup mechanism of new and old firmware in FLASH, the state recovery is realized when firmware upgrade fails, ensuring the operational stability of the device during the cross-upgrade process. Attached Figure Description

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

[0012] Figure 1 A flowchart illustrating a remote cross-upgrade method for MCU platform IAP and APP provided in this embodiment of the disclosure; Figure 2 A schematic diagram illustrating the specific process of a remote cross-upgrade method for MCU platform IAP and APP provided in this embodiment of the disclosure; Figure 3 A schematic diagram of the structure of a remote cross-upgrade device for MCU platform IAP and APP provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Detailed Implementation

[0013] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this disclosure.

[0014] It should be noted that, in the description of this disclosure, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this disclosure are used to distinguish similar objects and are not used to describe a particular order or sequence.

[0015] To enable those skilled in the art to better understand the present disclosure, the present disclosure will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0016] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a remote cross-upgrade method for an MCU platform IAP and APP provided in this embodiment. It should be noted that the remote cross-upgrade method for an MCU platform IAP and APP provided in this embodiment can be executed by a computer device. This computer device can be a server, a terminal device, or a cluster system composed of multiple devices (in the various embodiments below, for simplicity, the executing entity will be uniformly referred to as the system). The method flow may include the following steps: Step S101: Receive upgrade instructions and upgrade firmware data through the APP program running in the APP firmware area of ​​the MCU platform, generate upgrade control information containing the upgrade object and current status based on the upgrade instructions, and write the upgrade firmware data and upgrade control information into the shared temporary storage area.

[0017] In this embodiment, this step aims to change the traditional architecture where the underlying IAP is responsible for receiving upgrade data, and instead, during the normal execution of business at the application layer, the preparation of upgrade pre-upgrade data and the construction of status information are completed in parallel by the APP program.

[0018] The APP firmware area refers to a space within the MCU platform used to store the actual application business logic code. The APP program refers to the application entity residing in this space and currently running the dominant system. The upgrade command refers to a control signaling issued by an external device to trigger the system firmware update process. The upgrade control information is a data structure generated by the system based on the upgrade command, used as credentials for state transitions and object determination in subsequent processes.

[0019] Specifically, while the APP program is running normally, the system obtains upgrade instructions and corresponding upgrade firmware data from external sources through the communication interface. The system parses the upgrade instructions to determine whether the upgrade target is a low-level program or an application-level program, and encapsulates the upgrade target information along with the current reception status into upgrade control information, which is then written into a pre-allocated shared temporary storage area.

[0020] Furthermore, the shared temporary storage area can be a storage area independent of the IAP firmware area and the APP firmware area, serving as a data handover hub across runtime levels.

[0021] Step S102: After the firmware upgrade data is received, the upgrade control information is updated to the pending upgrade state, and a jump to the IAP firmware area in the MCU platform is triggered.

[0022] In this embodiment, this step is intended to complete the environment switching and state handover from the data reception stage to the firmware upgrade execution stage.

[0023] Specifically, once the system detects that the upgrade firmware data in the shared temporary storage area has been completely written, the system overwrites the upgrade control information in the temporary storage area and updates its internal status field to an upgrade-ready state indicating that the data is ready.

[0024] Furthermore, after the status update is completed, the system actively issues a program jump instruction to change the current program pointer of the processor, causing the system to exit the currently running APP firmware area and transfer control to the IAP firmware area in the MCU platform that is responsible for the underlying layer.

[0025] Step S103: Read the upgrade control information in the shared temporary storage area by running the IAP program in the IAP firmware area.

[0026] In this embodiment, the IAP firmware area can refer to a space independently partitioned within the MCU platform, specifically used for storing device boot and application programming service code. The IAP program is the underlying monitoring service running in this space.

[0027] Specifically, when system control is transferred to the IAP firmware area, the system wakes up the IAP program. The IAP program addresses and accesses the shared temporary storage area, retrieves and parses the upgrade control information that has been updated by the APP program, and extracts the specific upgrade object indicated by the control information.

[0028] Step S104: If the upgrade object indicated by the upgrade control information is IAP, then the upgrade firmware data in the shared temporary storage area is loaded into memory for execution, and after verification, the upgrade firmware data is overwritten to the IAP firmware area.

[0029] In this embodiment, this step provides a memory-verified cross-write mechanism for scenarios that require updating the underlying program.

[0030] Specifically, if the upgrade control information confirms that the IAP program itself needs to be replaced, considering that the system cannot directly erase or write the currently running code in the original storage area, the system can extract the upgrade firmware data stored in the shared temporary storage area and load it into the system's random access memory, i.e., memory, for execution.

[0031] Furthermore, while the new code is running in memory, the system verifies the normality of its logical operation. After confirming that the new code in memory has not encountered any runtime anomalies, the system triggers the underlying write sequence, which can first migrate or back up the original old firmware data in the IAP firmware area to the preset old firmware storage area, and then overwrite the IAP firmware area with the new firmware data.

[0032] Understandably, by first loading the firmware into memory for trial operation and then performing a physical overwrite, and in conjunction with backing up the old firmware, the risk of system failure that may be caused by directly erasing or writing to the native non-volatile storage area is effectively avoided, providing data support for product status recovery in the event of upgrade anomalies or failures.

[0033] Step S105: If the upgrade control information indicates that the upgrade target is APP, then jump to the APP firmware area to load the upgrade firmware data in the shared temporary storage area into memory for operation, and after verification, overwrite the APP firmware area with the upgrade firmware data.

[0034] In this embodiment, this step provides a closed-loop update logic within the APP environment for scenarios that require updating application-layer programs.

[0035] Specifically, if the system confirms that the upgrade target is an APP program, the IAP program suspends the underlying overwrite operation, redirects the program pointer, and jumps back to the APP firmware area. Subsequently, under the control of the APP environment, the system loads the new version of the APP firmware data from the shared temporary storage area into memory for execution.

[0036] Furthermore, after the system verifies that the application code can function normally in memory, the old version of the APP firmware can be backed up first, and then the APP environment itself can trigger an erase / write operation to overwrite the upgrade firmware data to the APP firmware area, thereby completing the application layer code replacement.

[0037] In the remote cross-upgrade method and apparatus for MCU platform IAP and APP in the above embodiments of this disclosure, firstly, by uniformly receiving upgrade instructions and data at the APP layer and cooperating with a shared temporary storage area for state transition, the system is equipped with the ability to perform OTA remote overwrite and iteration of IAP layer firmware, realizing remote update of IAP layer firmware. Secondly, the device can directly obtain upgrade data and trigger subsequent upgrade mechanisms while the APP program is running normally, replacing the process in the prior art that requires the device to restart and enter the IAP layer before the upgrade operation can be started, simplifying the execution steps of firmware upgrade and improving the convenience of firmware upgrade. Finally, by transferring the data receiving function to the APP layer, the logic code and FLASH space occupation of the IAP program are reduced; at the same time, before performing physical firmware overwrite, the system loads the upgrade firmware data into memory for running verification, and with the temporary storage and backup mechanism of new and old firmware in FLASH, the state recovery is realized when firmware upgrade fails, ensuring the operational stability of the device during the cross-upgrade process.

[0038] In one possible implementation of the above embodiments, the size of the shared temporary storage area is based on the larger of the APP firmware area and the IAP firmware area, and iterative redundancy space is reserved.

[0039] In this embodiment, the system fully considers the space reuse requirements in cross-upgrade scenarios when planning storage resources in the early stages. Since the shared temporary storage area needs to accommodate firmware payloads with different attributes from both the application layer and the underlying layer, the system directly extracts the physical capacity limits of the APP firmware area and the IAP firmware area for comparison, and selects the maximum value as the baseline for temporary storage area capacity allocation. Furthermore, the system allocates an additional buffer sector as iterative redundancy space based on this baseline.

[0040] Understandably, this capacity planning approach ensures that throughout the product's long lifecycle, no matter how much the business logic at any layer expands, as long as the overall physical limits of the hardware are not exceeded, the temporary storage area will have sufficient throughput capacity to accommodate data packets sent in a single transaction.

[0041] In the remote cross-upgrade method and apparatus for MCU platform IAP and APP in the above embodiments of this disclosure, by establishing a storage configuration benchmark of taking the larger of the two zones and adding redundancy, the system achieves a balance between space utilization and iterative inclusiveness within a limited non-volatile storage medium. This design eliminates the risk of upgrade package truncation due to lockout of the temporary storage area, ensuring the smooth implementation of subsequent long-cycle updates for each version.

[0042] In one possible implementation of step S102 above, triggering a jump to the IAP firmware area in the MCU platform includes: The APP program issues a program jump command to simulate the reboot process and enter the IAP firmware area.

[0043] In this embodiment, after the system completes the overall arrangement of the upgrade data, it does not use physical power-off restart methods such as unplugging the power or triggering the hardware watchdog reset.

[0044] Conversely, the system can perform the boot handover at the software level. For example, a running application program can proactively disable currently used interrupt services and reset peripheral states, then directly force-write the starting physical address of the IAP firmware area to the processor's program counter. This instruction-level jump microscopically replicates the processor's behavior of searching for the boot vector table after system power-on.

[0045] Here, through the aforementioned code-level address offset, the system tricks the processor into entering an initial boot sequence that resembles a power-on reboot, thereby waking up the dormant IAP underlying program.

[0046] In the remote cross-upgrade method and apparatus for MCU platform IAP and APP in the above embodiments of this disclosure, by introducing a software jump instruction that simulates a restart, the system autonomously completes the soft switching of the operating environment without the need for external hardware pin intervention. This approach not only shortens the time overhead of cross-level control flow handover, but also avoids uncontrollable fluctuations in peripheral states that may be caused by hardware-level reset, ensuring the electrical stability of the device when switching execution tracks.

[0047] In one possible implementation of the above embodiments, the upgrade control information further includes: the upgrade firmware version and the upgrade result status.

[0048] In this embodiment, when initially generating the scheduling certificate, the system injects more dimensions of verification and tracking parameters into the control information data structure. In addition to the upgrade object, the system simultaneously encapsulates the firmware version number of the received payload for subsequent receivers to compare the order of old and new versions, avoiding repeated erasure and rewriting of the same version.

[0049] Meanwhile, the system pre-allocates an upgrade result status word within the control information to record the execution progress. The initial value of this status word can be set to the default state and rewritten in real time at subsequent action nodes such as verification, loading, and overwriting.

[0050] In the remote cross-upgrade method and apparatus for MCU platform IAP and APP in the above embodiments of this disclosure, by expanding the version number and status word in the control flow information, the system establishes a traceable status maintenance file for the monotonous upgrade action, so that every change in the upgrade process can be left in the form of log in the non-volatile storage area, thereby enhancing the transparency of the upgrade task execution process.

[0051] In one possible implementation of the above embodiments, if an operational error is detected during the process of loading the upgrade firmware data from the shared temporary storage area into memory for execution, the following steps are taken: Update the status of upgrade results in the shared temporary storage area to an exception flag for status feedback.

[0052] In this embodiment, during the trial run of the new firmware in the isolated memory environment, once abnormal behavior such as memory overflow or unresponsive key variables is detected, the system's main control protection mechanism can immediately intervene and forcibly interrupt the execution process of the new code.

[0053] At this point, the system aborts subsequent erase / write sequences that physically overwrite the non-volatile storage area. As an alternative, the system extracts the error event from memory, generates a core fault code, and writes it to the corresponding upgrade result status field in the shared temporary storage area, marking it with a clear exception identifier. When the device subsequently resumes normal business mode and re-establishes communication with the remote server, this exception identifier will be packaged and uploaded as a diagnostic basis for cloud-based analysis of the failure cause.

[0054] In the remote cross-upgrade method and apparatus for MCU platform IAP and APP in the above embodiments of this disclosure, the system utilizes a temporary storage area to construct a closed-loop anti-brick fault tolerance mechanism. When faced with a damaged or defective update load, the system can decisively abandon the overwrite action and record the on-site fault status, preventing the complete paralysis of the device caused by erroneous codes polluting the native firmware area, and improving the security threshold of remote unattended devices when performing OTA tasks.

[0055] In one possible implementation of the above embodiments, after overwriting the upgrade firmware data to the IAP firmware area, or after overwriting the upgrade firmware data to the APP firmware area, the method further includes: clearing the shared temporary storage area.

[0056] In this embodiment, regardless of whether the system ultimately executes the underlying environment replacement branch or the application layer logic replacement branch, as long as it is confirmed that the new firmware data has been completely and accurately written into the corresponding long-term physical storage area, the system can start a unified cleanup sequence.

[0057] The system controls the flash memory controller to issue a full erase command to the sector where the shared temporary storage area is located, erasing all firmware, control information and scattered status records previously left in the buffer zone, so that the area is restored to its initial blank writable state.

[0058] In the remote cross-upgrade method and apparatus for MCU platform IAP and APP in the above embodiments of this disclosure, by forcibly performing a clearing operation of the temporary storage area after the cross-layer overlay operation is completed, the system promptly releases the occupied public buffer resources. This not only prevents the retention of expired firmware code from interfering with the addressing of the device's next regular OTA task, but also eliminates the security risk of old binary files being read by external abnormal means, maintaining a clean and orderly internal storage environment for the chip.

[0059] In one embodiment, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the specific process of a remote cross-upgrade method for MCU platform IAP and APP provided in an embodiment of this disclosure, as shown below. Figure 2 As shown, where: The non-volatile storage space of the MCU platform (i.e., FLASH in the figure) is pre-divided into multiple independent blocks, mainly including the IAP firmware area (i.e., the old IAP firmware in the figure) for storing the underlying running logic, the APP firmware area (i.e., the old APP firmware in the figure) for storing the actual business logic, and a shared temporary storage area independent of the two (i.e., the upgrade firmware information temporary storage area in the figure).

[0060] During the normal operation of the system, the APP program performs application functions and opens a receiving interface through the built-in upgrade function module. When an IAP upgrade command or APP upgrade command is issued from the outside, the APP program directly captures the above command in the current environment, performs preprocessing, and writes the generated firmware data and status records (i.e., the upgrade firmware data and upgrade control information in the aforementioned embodiment) into the common temporary storage area in FLASH.

[0061] After data reception and writing are completed, the system performs a handover of the operating environment. Whether through normal device power-on or through a program jump triggered after reception, system control is transferred to the IAP layer. In addition to performing routine status self-checks, the IAP program actively accesses the shared temporary storage area in FLASH to read the new firmware data and status records previously written by the APP layer.

[0062] The system executes the corresponding upgrade branch logic based on the read status record: On the one hand, if the log indicates that the current action is an IAP firmware update, the IAP program will execute the update after completing the memory operation verification. Figure 2 The "IAP Upgrade" data flow indicated in the middle will physically overwrite the new firmware data in the shared temporary storage area to the IAP firmware area, realizing the replacement of the underlying program.

[0063] On the other hand, if the log indicates that the current action is an APP firmware update, the control flow is redirected back to the APP layer. The APP program also reads the new firmware data and status record from the shared temporary storage area, and after completing the memory operation verification, executes... Figure 2 The "APP upgrade" data flow indicated in the image shows that the APP program itself physically overwrites the new firmware data to the APP firmware area, completing the replacement of the application layer program.

[0064] Through the above Figure 2 The interactive flow shown demonstrates how this embodiment separates the receiving actions originally belonging to the IAP layer and relies on a shared temporary storage area as a cross-layer data and status transfer hub, thereby achieving independent remote cross-upgrades of both the IAP and APP layers without relying on hardware restart intervention.

[0065] As an example, please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of a remote cross-upgrade device for an MCU platform IAP and APP provided in an embodiment of this disclosure, as shown below. Figure 3 As shown, the device may include: The receiving and writing module 31 is used to receive upgrade instructions and upgrade firmware data through the APP program running in the APP firmware area of ​​the MCU platform, generate upgrade control information containing the upgrade object and the current status based on the upgrade instructions, and write the upgrade firmware data and upgrade control information into the shared temporary storage area. The status update and jump module 32 is used to update the upgrade control information to the upgrade status after the firmware data to be upgraded is received, and to trigger a jump to the IAP firmware area in the MCU platform. Information reading module 33 is used to read upgrade control information in the shared temporary storage area through the IAP program running in the IAP firmware area; The IAP upgrade execution module 34 is used to load the upgrade firmware data in the shared temporary storage area into memory and run it if the upgrade control information indicates that the upgrade object is IAP, and to overwrite the IAP firmware area with the upgrade firmware data after verification. The APP upgrade execution module 35 is used to jump to the APP firmware area if the upgrade control information indicates that the upgrade object is the APP, so as to load the upgrade firmware data in the shared temporary storage area into memory for execution, and overwrite the APP firmware area with the upgrade firmware data after verification.

[0066] In one embodiment, the size of the shared temporary storage area is configured based on the larger of the APP firmware area and the IAP firmware area, and iterative redundancy space is reserved.

[0067] In one embodiment, the status update and jump module 32, when triggering a jump to the IAP firmware area in the MCU platform, is specifically used by the APP program to issue a program jump instruction to simulate a reboot process and enter the IAP firmware area. In one embodiment, the upgrade control information further includes: the upgrade firmware version and the upgrade result status.

[0068] In one embodiment, the device further includes an exception handling module, which is used to update the status of the upgrade result in the shared temporary storage area to an exception identifier if an exception is verified during the process of loading the upgrade firmware data in the shared temporary storage area into memory for operation, so as to provide status feedback.

[0069] In one embodiment, the device further includes a temporary storage area clearing module, which is used to clear the shared temporary storage area after the upgrade firmware data is overwritten to the IAP firmware area, or after the upgrade firmware data is overwritten to the APP firmware area.

[0070] It should be noted that the remote cross-upgrade device for MCU platform IAP and APP provided in the above embodiments is only illustrated by the division of the above program modules when implementing the corresponding remote cross-upgrade method for MCU platform IAP and APP. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the above device can be divided into different program modules to complete all or part of the processing described above. In addition, the device provided in the above embodiments and the corresponding Figure 1 The embodiments of the methods shown belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0071] This disclosure also provides an electronic device having the above-described features. Figure 3 The method for remote cross-upgrading of MCU platform IAP and APP is shown.

[0072] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure.

[0073] The following is a detailed reference. Figure 4The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present disclosure. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 401, which can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) 402 or a program loaded from memory 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of the electronic device. The processor 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0074] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0075] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from memory 408, or installed from ROM 402. When the computer program is executed by processor 401, it performs the functions defined in the remote cross-upgrade method for MCU platform IAP and APP according to embodiments of this disclosure.

[0076] Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0077] This disclosure also provides a computer-readable storage medium in which the methods described in this disclosure can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded over a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the remote cross-upgrade method for MCU platform IAP and APP shown in the above embodiments is implemented.

[0078] A portion of this disclosure can be applied to computer program products, such as computer program instructions, which, when executed by a computer, can invoke or provide methods and / or technical solutions according to this disclosure through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, and installation package files. Accordingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions; the computer compiling the instructions and then executing the corresponding compiled program; the computer reading and executing the instructions; or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0079] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for remote cross-upgrading of MCU platform IAP and APP, characterized in that, The method includes: The APP program running in the APP firmware area of ​​the MCU platform receives upgrade instructions and upgrade firmware data, generates upgrade control information containing the upgrade object and current status based on the upgrade instructions, and writes the upgrade firmware data and the upgrade control information into a shared temporary storage area. After the upgrade firmware data is received, the upgrade control information is updated to the pending upgrade state, and a jump to the IAP firmware area in the MCU platform is triggered. The upgrade control information in the shared temporary storage area is read by the IAP program running in the IAP firmware area; If the upgrade control information indicates that the upgrade target is IAP, then the upgrade firmware data in the shared temporary storage area is loaded into memory and run, and after verification, the upgrade firmware data is overwritten to the IAP firmware area. If the upgrade control information indicates that the upgrade target is an APP, then jump to the APP firmware area to load the upgrade firmware data in the shared temporary storage area into memory for execution, and after verification, overwrite the APP firmware area with the upgrade firmware data.

2. The method according to claim 1, characterized in that, The size of the shared temporary storage area is based on the larger of the APP firmware area and the IAP firmware area, and iterative redundancy space is reserved.

3. The method according to claim 1, characterized in that, The trigger jump to the IAP firmware area in the MCU platform includes: The APP program issues a program jump command to simulate a restart process and enter the IAP firmware area.

4. The method according to claim 1, characterized in that, The upgrade control information also includes: the upgrade firmware version and the upgrade result status.

5. The method according to claim 4, characterized in that, If an operational error is detected during the process of loading the upgrade firmware data from the shared temporary storage area into memory for execution, the following applies: The status of the upgrade result in the shared temporary storage area is updated to an anomaly flag for status feedback.

6. The method according to claim 1, characterized in that, After overwriting the upgrade firmware data to the IAP firmware area, or after overwriting the upgrade firmware data to the APP firmware area, the method further includes: clearing the shared temporary storage area.

7. A remote cross-upgrade device for MCU platform IAP and APP, characterized in that, The device includes: The receiving and writing module is used to receive upgrade instructions and upgrade firmware data through the APP program running in the APP firmware area of ​​the MCU platform, generate upgrade control information containing the upgrade object and the current status based on the upgrade instructions, and write the upgrade firmware data and the upgrade control information into a shared temporary storage area. The status update and jump module is used to update the upgrade control information to the pending upgrade status after the upgrade firmware data has been received, and to trigger a jump to the IAP firmware area in the MCU platform. The information reading module is used to read upgrade control information in the shared temporary storage area through the IAP program running in the IAP firmware area; The IAP upgrade execution module is used to load the upgrade firmware data in the shared temporary storage area into memory and run it if the upgrade control information indicates that the upgrade object is IAP, and to overwrite the IAP firmware area with the upgrade firmware data after verification. The APP upgrade execution module is used to jump to the APP firmware area if the upgrade object indicated by the upgrade control information is an APP, so as to load the upgrade firmware data in the shared temporary storage area into memory for execution, and overwrite the APP firmware area with the upgrade firmware data after verification.

8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the remote cross-upgrade method for MCU platform IAP and APP as described in any one of claims 1-6 when executing the computer program.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the remote cross-upgrade method for MCU platform IAP and APP as described in any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the remote cross-upgrade method for MCU platform IAP and APP as described in any one of claims 1-6.