A millimeter wave radar software upgrade backup method
By using a software upgrade and backup method with multiple backup files and flag bits in millimeter wave radar, the upgrade failure problem caused by communication instability during the radar firmware upgrade process is solved, and the system can be started safely and re-upgraded after failure, improving risk resistance.
Patent Information
- Application Number
- CN202311755716.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2043-12-20
AI Technical Summary
During the firmware upgrade of millimeter wave radar, the upgrade may fail due to factors such as unstable communication quality, resulting in the radar being in an unstartable state. It is difficult for traditional methods to ensure that the system can start safely and stably after the upgrade failed.
A software upgrade backup method is adopted, by setting multiple backup files and flags in the radar, ensuring that after the upgrade fails, the system can automatically fall back to a secure firmware state and re-upgrade. The specific steps include backing up boot2 and app1 files when powering on for the first time, upgrading when receiving the upgrade command, and backing up the files after the upgrade is successful in case of emergency needs.
It improves the risk resistance of the radar firmware upgrade process, ensures that the system can start safely and stably after the upgrade failure under any circumstances (such as unstable communication or power failure), and ensures the stability and availability of the system.
Smart Images

Figure CN117762449B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of radar technology, and in particular relates to a millimeter wave radar software upgrade backup method. Background Art
[0002] In recent years, vehicle-road cooperative technology has flourished, and the demand for radar-based road test perception systems has been growing. Usually, millimeter-wave radar is used for roadside perception projects. During the implementation process, the radar firmware needs to be frequently iterated and optimized according to the actual detection environment and customized requirements. And because the detection environment varies greatly, the radar firmware usually needs to be customized and developed, so that the normal operation of the same project requires multiple versions of radar firmware.
[0003] Some special products in the radar family, such as millimeter-wave radars, have special application scenarios, scattered sites, high installation density, and intranet environments. Most of the time, they need to be upgraded remotely through the network, but the upgrade fails due to various uncertain factors such as unstable communication quality and low speed. Radars are not allowed to be in an unstartable state at any time. We need to ensure that any errors that occur during the upgrade process can be rolled back to safe firmware operation. The traditional communication equipment firmware upgrade method is likely to cause equipment downtime once the firmware has problems during the upgrade process. Summary of the invention
[0004] The purpose of the present invention is to provide a millimeter wave radar software upgrade backup method, which improves the risk resistance of the radar firmware upgrade process and solves the problems in the prior art raised in the above background technology.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A millimeter wave radar software upgrade and backup method comprises: burning a software package to a flash chip, the software package comprising boot1, boot2 and app1; when the radar is powered on for the first time, the software first enters boot1 and determines whether boot3 and app2 exist, then the software performs a file integrity check on the boot2 file and copies the boot2 file to the boot3 file address, after the copying is completed, the software performs a file integrity check on the boot3 file, then sets the value of boot3Flag and saves it; when it is determined that the value of app2Flag is different from the value of boot3Flag, the software performs a file integrity check on the app1 file successfully, and then copies the app1 file to the address of the boot3 file; To the app2 file address, after the copy is completed, the software performs a file integrity check on the app2 file and if it is normal, sets the value of app2Flag and saves it; when the software receives an upgrade command in app1, the software sets the upgrade flag once and resets it; enters boot2 from boot1, the software determines whether there is an upgrade flag in boot2, and performs the upgrade operation; after app1 or boot2 is successfully upgraded, perform a file integrity check and back up the app1 file to the app2 address; after upgrading boot2, compare the first two digits of the version numbers of the upgraded boot2 and boot3. If they are different, erase the boot3 file and back up the boot2 file to the address where the boot3 file is located.
[0007] Preferably, the software first enters boot1 and determines whether boot3 and app2 exist, including: in boot1, the software determines whether boot3 and app2 exist by reading boot3Flag and app2Flag in flash through existence flags.
[0008] Preferably, the existence flag includes: the existence flag of boot3 is whether the value of boot3Flag is equal to 0x7EE7; the existence flag of app2 is whether the value of app2Flag is equal to 0x7EE7.
[0009] Preferably, the value of the boot3Flag is set to 0x7EE7.
[0010] Preferably, the value of the app2Flag is set to 0x7EE7.
[0011] Preferably, after the radar is powered on for the first time, the backup of the boot2 file and the app1 file is completed, and the backup files are boot3 and app2 respectively.
[0012] Preferably, when the software receives an upgrade command in app1, the software sets an upgrade flag and resets it, including: jumping back to boot1, and determining in boot1 whether the value of boot3Flag is equal to 0x7EE7 or whether the value of app2Flag is equal to 0x7EE7.
[0013] Preferably, the upgrade operation includes: independently upgrading a new app1 file or independently upgrading a new boot2 file, or upgrading both together.
[0014] Preferably, the method further includes: during the upgrade process, when the upgrade of app1 or boot2 fails due to unstable communication or power failure, after restarting boot1, the boot3 backup file is copied to boot2, and the app2 backup file is copied to app1.
[0015] Technical effects and advantages of the present invention: Compared with the prior art, the millimeter wave radar software upgrade backup method proposed by the present invention has the following advantages:
[0016] The present invention ensures that no matter under any circumstances, after the flashing of the boot and app fails, the radar can be re-upgraded after a safe and stable startup, which is used to ensure the stability and availability of the system. In particular, for critical systems and applications with high reliability requirements, under the architecture of 3-level boot plus 2-level app, not only can the boot and app be upgraded at will, but after an upgrade fails, they can be powered on immediately and work safely and stably again, thereby improving the risk resistance of the radar firmware upgrade process. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a radar hardware framework diagram of the present invention;
[0018] Figure 2 This is a schematic diagram of the internal partitions of the Flash chip of the present invention;
[0019] Figure 3 This is a flow chart of the startup process of the radar of the present invention when it is powered on. DETAILED DESCRIPTION
[0020] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0021] A millimeter-wave radar software upgrade backup method is provided in an embodiment of the present invention, which aims to ensure that the radar can be re-upgraded after a safe and stable startup after the boot and app are flashed failed under any circumstances, so as to ensure the stability and availability of the system, especially for key systems and applications with high reliability requirements. Under the architecture of 3-level boot plus 2-level app, not only can the boot and app be upgraded at will, but also they can be powered on immediately after an upgrade failure to work safely and stably, thereby improving the risk resistance of the radar firmware upgrade process.
[0022] Before describing the above-mentioned millimeter-wave radar software upgrade and backup method in detail, it is necessary to explain the software and hardware involved, as follows.
[0023] The main hardware components of the radar are: Figure 1 As shown in the figure: The main hardware components of millimeter wave radar: MCU (Microcontroller Unit): responsible for controlling the overall operation and processing tasks of the radar system. FLASH (flash memory) chip: used to store the program code and related data of the radar system, which can be read and written quickly. PMIC (Power Management Integrated Circuit): responsible for managing the power supply and power consumption management of the radar system, including battery management, power conversion and power monitoring functions. These hardware components work together to enable the radar system to operate normally and provide the required functions and performance.
[0024] The radar power-on startup process, such as Figure 3 As shown, the radar software consists of bootloader (boot for short) + app;
[0025] The bootloader is a program loading code solidified in the FLASH, connecting the underlying hardware and the application. The main function is to complete the initialization of the normal operation of the microprocessor and peripheral circuits, establish the mapping of the memory space, determine whether the system can run, bring the system's software and hardware environment to a suitable state, and load the system program or data in the flash. Every time the MCU is reset, the bootloader will be run.
[0026] This embodiment mainly describes how to implement the upgrade and backup of the millimeter-wave radar (based on the 220P model). The traditional software upgrade solution is: boot+app. When the radar runs in the app and receives an upgrade task, it will jump to the boot to perform the app upgrade operation, erase the storage location of the app in the flash, and rewrite the app program. If there is a problem with the communication or the voltage is unstable during the upgrade process, the app will fail to upgrade. The next time the machine is turned on, the app must be upgraded again under boot. The upgrade efficiency is not high and the boot cannot be upgraded. If there is a need to modify the boot, the software cannot upgrade the boot.
[0027] The traditional upgrade solution boot+app can only upgrade the app and must wait for the upgrade again if the app upgrade fails, which is inefficient and does not meet the needs. This solution is changed to a 3-level boot plus 2-level app architecture, which not only allows the boot and app to be upgraded at will, but also can be powered on immediately after an upgrade failure to work safely and stably again.
[0028] This method is: boot1+boot2+boot3+app1+app2, the hardware involved are MCU and external flash chip; the software involved are boot1, boot2 and app1. Boot1 is the first-level bootloader, mainly for backup file copy and jump to boot2; boot2 is the second-level bootloader, mainly for jump app verification and upgrade functions; boot3 is the backup bootloader; app1 is the normal app, running app; app2 is the backup app, the details are as follows.
[0029] In this embodiment, a millimeter wave radar software upgrade backup method includes the following steps:
[0030] Use the Sophie burning tool to directly burn the software package to the flash chip. The software package includes boot1, boot2 and app1.
[0031] When the radar is powered on for the first time, the software first enters boot1 and determines whether boot3 and app2 exist. Then the software performs a file integrity check on the boot2 file and copies the boot2 file to the boot3 file address. After the copy is completed, the software performs a file integrity check on the boot3 file, then sets the value of boot3Flag and saves it.
[0032] Specifically, when the radar is powered on for the first time, the software first enters boot1. In boot1, the software determines whether boot3 and app2 exist by reading boot3Flag and app2Flag in flash, that is, whether the value of boot3 existence flag boot3Flag is equal to 0x7EE7 and whether the value of app2 existence flag app2Flag is equal to 0x7EE7. Since it is the first time that the radar hardware is powered on, the values of boot3Flag and app2Flag are initial values (0x0 or 0xFFFF). At this time, the software determines that the values of boot3Flag are not equal to 0x7EE7, and then the software will perform a file integrity check on the boot2 file (whether the boot2 file can be started normally). After the check is successful, the boot2 file is copied to the boot3 file address. After the copy is completed, the software will perform a file integrity check on the boot3 file (whether the boot3 file can be started normally). After the check is successful, the value of boot3Flag is set to 0x7EE7 and saved (it will not be lost when it is powered on next time).
[0033] When it is determined that the value of app2Flag is different from the value of boot3Flag, the software will successfully perform a file integrity check on the app1 file and then copy the app1 file to the app2 file address. After the copy is completed, the software will perform a file integrity check on the app2 file and then set the value of app2Flag and save it.
[0034] Specifically, the app2Flag value is determined. At this time, the software determines that the app2Flag value is not equal to 0x7EE7, and then the software will perform a file integrity check on the app1 file (whether the app1 file can be started normally). After the file integrity check is successful, the app1 file is copied to the app2 file address. After the copy is completed, the software will perform a file integrity check on the app2 file (whether the app2 file can be started normally). After the file integrity check is normal, the app2Flag value is set to 0x7EE7 and saved (it will not be lost during power failure).
[0035] Through the above operations, you can back up the boot2 file and app1 file. The backup files are boot3 and app2 respectively.
[0036] The radar hardware completes the backup of boot2 and app1 through the first power-on. In the subsequent power-on process, since the files have been backed up, they will not be backed up again. The software directly enters boot2 from boot1 and then enters app1.
[0037] When the software receives the upgrade command in app1, it sets the upgrade flag once and resets it;
[0038] Specifically, the software receives an upgrade command in app1: an upgrade is required. At this time, the software will set the upgrade flag once and reset it: jump back to boot1, and determine in boot1 whether the value of boot3Flag is equal to 0x7EE7 or whether the value of app2Flag is equal to 0x7EE7.
[0039] Entering boot2 from boot1, the software determines whether there is an upgrade mark in boot2 and performs the upgrade operation; the upgrade can independently upgrade the new app1 file or independently upgrade the new boot2 file, or upgrade both together.
[0040] After app1 or boot2 is successfully upgraded, perform file integrity check and back up the app1 file to the app2 address;
[0041] Specifically, after app1 or boot2 is successfully upgraded, a new file integrity check is performed. If the check is normal, the app1 file will be backed up to the app2 address, and app2Flag will be set to 0x7EE7.
[0042] After upgrading boot2, compare the first two digits of the upgraded boot2 and boot3 version numbers. If they are different, erase the boot3 file and back up the boot2 file to the address where the boot3 file is located.
[0043] Specifically, after upgrading boot2, the first two digits of the version numbers of the upgraded boot2 and the file in the backup area (i.e., the boot3 file) will be compared. If they are different, the backup area file (i.e., the boot3 file) will be erased and the boot2 file will be backed up to the backup area (i.e., the address where the boot3 file is located).
[0044] After the above operations, the software upgrade backup is successful. If the app1 or boot2 upgrade fails due to unstable communication or power outage, the boot3 backup file will be copied to boot2 and the app2 backup file will be copied to app1 after boot1 is restarted. The machine can start normally quickly without waiting for the upgrade to start.
[0045] The new upgrade backup solution ensures that the radar can be re-upgraded after a safe and stable restart after the boot and app fail to flash under any circumstances (unstable communication, power failure, program reading and writing problems).
[0046] The above upgrade and backup methods are usually used to ensure system stability and availability, especially for critical systems and applications with high reliability requirements.
[0047] 1. Dual module redundancy: The method described in this article usually involves two modules, one is the active module (Active) and the other is the backup module (Backup). The active module is responsible for normal system operation, while the backup module is idle. If the active module fails or fails, the backup module can take over immediately to ensure the continuous operation of the system.
[0048] 2. Failure switching: This upgrade and backup method allows the system to switch to the backup module when a failure of the active module is detected. This switch is usually seamless to reduce system interruption time. In embedded systems, especially in some critical applications, reducing downtime is very important.
[0049] 3. Availability and fault tolerance: This method can significantly improve the availability and fault tolerance of the system. Whether it is a hardware failure or a software failure, the backup module can quickly take over, thus ensuring the continuous operation of the system.
[0050] 4. Real-time system: In embedded real-time systems, this method is usually used to ensure the continuous execution of tasks. If the main task or module fails, the backup task or module can take over to ensure that the system meets the real-time requirements.
[0051] In summary, using the above upgrade and backup method is an effective method in embedded systems, especially suitable for applications with high requirements on system reliability and stability.
[0052] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A millimeter wave radar software upgrade backup method, characterized in that: include: Burn the software package to the flash chip, the software package includes boot1, boot2 and app1; When the radar is powered on for the first time, the software first enters boot1 and determines whether boot3 and app2 exist. Then the software performs a file integrity check on the boot2 file and copies the boot2 file to the boot3 file address. After the copy is completed, the software performs a file integrity check on the boot3 file, then sets the value of boot3Flag and saves it. When it is determined that the value of app2Flag is different from the value of boot3Flag, the software will successfully perform a file integrity check on the app1 file and then copy the app1 file to the app2 file address. After the copy is completed, the software will perform a file integrity check on the app2 file and then set the value of app2Flag and save it. When the software receives the upgrade command in app1, it sets the upgrade flag once and resets it; Entering boot2 from boot1, the software determines whether there is an upgrade flag in boot2 and performs the upgrade operation; After app1 or boot2 is successfully upgraded, perform file integrity check and back up the app1 file to the app2 address; After upgrading boot2, compare the first two digits of the upgraded boot2 and boot3 version numbers. If they are different, erase the boot3 file and back up the boot2 file to the address where the boot3 file is located. The software first enters boot1 and determines whether boot3 and app2 exist, including: in boot1, the software determines whether boot3 and app2 exist by reading boot3Flag and app2Flag in flash through existence flags; The determination of the existence flag includes: whether the value of boot3Flag, the existence flag of boot3, is equal to 0x7EE7; whether the value of app2Flag, the existence flag of app2, is equal to 0x7EE7; After the radar is powered on for the first time, the backup of the boot2 file and the app1 file is completed, and the backup files are boot3 and app2 respectively; when the software receives the upgrade command in app1, the software sets the upgrade flag once and resets it, including: jumping back to boot1, judging whether the value of boot3Flag is equal to 0x7EE7 or whether the value of app2Flag is equal to 0x7EE7 in boot1; the upgrade operation includes: independently upgrading the new app1 file or independently upgrading the new boot2 file, or upgrading both together; It also includes: during the upgrade process, when app1 or boot2 fails to upgrade due to unstable communication or power failure, after boot1 is restarted, the boot3 backup file is copied to boot2, and the app2 backup file is copied to app1.
2. A millimeter wave radar software upgrade backup method according to claim 1, characterized in that: The value of the boot3Flag is set to 0x7EE7.
3. A millimeter wave radar software upgrade backup method according to claim 2, characterized in that: The value of the app2Flag is set to 0x7EE7.
Citation Information
Patent Citations
Application program starting method
CN105094919A
Bootloader updating method and device, equipment and medium
CN115993985A