Method and system for automatically implementing a backup of factory firmware for a mowing robot

CN115686945BActive Publication Date: 2026-10-20NANJING SUMEC INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211358019.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-01
Publication Date
2026-10-20
Estimated Expiration
2042-11-01

AI Technical Summary

Technical Problem

[0003]发明目的:针对出厂固件备份实现复杂的不足,本发明提供一种实现简单的割草机器人的自动实现出厂固件备份方法及系统

Benefits of technology

[0027]本发明首先根据需要的固件信息确定固件信息存储区的数据结构,机器运行在BOOT区域,读取APP区域汇总固件信息存储区的数据信息。根据读取到的存储信息进行存储信息特殊头校验、固件长度len校验、固件校验值校验,然后写入外部flash,本发明不需要借助任何外部工具即可写入外部flash,提升了出厂固件备份的易实现性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686945B_ABST
    Figure CN115686945B_ABST
Patent Text Reader

Abstract

The application discloses a kind of automatic implementation of mower robot factory firmware backup method and system, including firmware information storage module, data reading module, storage information special head check module, firmware length check module, check value check module, write-in module, according to the data structure of firmware information storage area determined by the firmware information required, machine runs in BOOT area, reads the data information of APP area summary firmware information storage area.According to the storage information read, storage information special head check, firmware length len check, firmware check value check are carried out, then write in external flash, the application does not need to write in external flash by any external tool, improves the easy implementation of factory firmware backup.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and system for automatically backing up factory firmware for a lawnmower robot, belonging to the field of robotics technology. Background Technology

[0002] When a machine leaves the factory, its firmware is typically backed up to allow users to roll back to factory settings. This backup firmware is usually stored in external flash memory, and there are generally two methods for writing it. One is to use a host computer to send data to the machine via a serial port or USB using a specific protocol; the machine then writes the received data to the external flash memory. The other is to prepare a copy of all the data to be written beforehand and use an external flash programming device to write the data into the external flash memory. Both methods require a host computer and an external flash programming device, increasing implementation complexity. Summary of the Invention

[0003] Purpose of the invention: To address the shortcomings of complex factory firmware backup implementation, this invention provides a simple method and system for automatically backing up the factory firmware of a lawnmower robot.

[0004] Technical solution: To achieve the above objectives, the technical solution adopted by this invention is as follows:

[0005] A method for automatically backing up the factory firmware of a lawnmower robot includes the following steps:

[0006] Step 1: Determine the data structure of the firmware information storage area according to the required firmware information. The data structure of the firmware information storage area is (Special header for storage information, firmware checksum, firmware length len, firmware name, firmware version, reserved area).

[0007] Step 2: The machine runs in the BOOT area and reads the data information from the APP area's summary firmware information storage area.

[0008] Step 3: Verify whether the special header of the stored information conforms to the rules based on the read special header. If it does, proceed to Step 4; otherwise, consider the current firmware to be invalid.

[0009] Step 4: Verify the firmware length len based on the read firmware length. If the firmware length len in the firmware information storage area is 0, or the firmware length len exceeds the length specified by FLASH, the firmware is considered invalid; otherwise, proceed to step 5.

[0010] Step 5: Calculate the firmware checksum CRC of the previous firmware based on the read firmware length len. The calculated firmware checksum CRC is CRC_CAL. Compare the read firmware checksum CRC_SAVE with the obtained firmware checksum CRC_CAL. If they are the same, proceed to step 6; otherwise, consider the current firmware invalid.

[0011] Step 6: Read the data from the APP area and write it to the external flash, then proceed to Step 7.

[0012] Step 7: Jump to the APP area to execute, and then proceed to step 8.

[0013] Step 8: Firmware backup writing complete.

[0014] Preferred method: The method for reading data from the APP region summary firmware information storage area in step 2:

[0015] The absolute address is obtained as FLASH_BASE + Addr_offset based on the firmware absolute address FLASH_BASE and the firmware information storage area's offset address Addr_offset. Data is then read from the firmware information storage area at the absolute address FLASH_BASE + Addr_offset.

[0016] Preferably, in step 5, before calculating the firmware checksum (CRC) of the previous firmware, the firmware name is verified. The method for verifying the firmware name is as follows:

[0017] The firmware name in the firmware information storage area is checked to determine if it is valid. If it is valid, the CRC checksum of the previous firmware is calculated. Otherwise, the firmware is considered invalid.

[0018] An automated firmware backup system for a lawnmower robot includes a firmware information storage module, a data reading module, a storage information special header verification module, a firmware length verification module, a verification value verification module, and a writing module, wherein:

[0019] The firmware information storage module is used to store firmware information with the following data structure: (storage information special header, firmware checksum, firmware length len, firmware name, firmware version, reserved area).

[0020] The data reading module is used when the machine is running in the BOOT area to read data information from the APP area summary firmware information storage area in the firmware information storage module.

[0021] The storage information special header verification module is used to verify whether the storage information special header read from the storage information conforms to the rules. If it conforms, the firmware length is verified; otherwise, the current firmware is considered invalid.

[0022] The firmware length verification module is used to verify the firmware length len based on the read firmware length. If the firmware length len in the firmware information storage area is 0, or the firmware length len exceeds the length specified by FLASH, the firmware is considered invalid; otherwise, a verification value is performed.

[0023] The verification module calculates the firmware checksum CRC of the previous firmware based on the read firmware length len. The calculated firmware checksum CRC is CRC_CAL. The read firmware checksum CRC_SAVE is compared with the obtained firmware checksum CRC_CAL. If they are the same, a write operation is performed; otherwise, the current firmware is considered invalid.

[0024] The writing module is used to read data from the APP area and write it to the external flash.

[0025] Preferably, the firmware name verification module is included. The firmware name verification module is used to determine whether the firmware name in the firmware information storage area is valid based on the firmware name. If it is valid, the firmware verification value CRC of the previous firmware is calculated; otherwise, the firmware is considered invalid.

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

[0027] This invention first determines the data structure of the firmware information storage area based on the required firmware information. The machine runs in the BOOT area and reads the data information from the firmware information storage area summarized in the APP area. Based on the read storage information, it performs special header verification, firmware length (len) verification, and firmware checksum verification, and then writes it to external flash. This invention can write to external flash without the need for any external tools, improving the ease of factory firmware backup. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of the firmware structure of this method.

[0029] Figure 2 This is a schematic diagram of the composition structure of the firmware information storage area used in this method.

[0030] Figure 3 This is a method for performing firmware verification based on the firmware information storage area.

[0031] Figure 4 This is a flowchart of the factory firmware backup process for this method. Detailed Implementation

[0032] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.

[0033] A method for automatically backing up the factory firmware of a lawnmower robot includes the following steps:

[0034] Step 1, as follows Figure 1 , 2 As shown, the data structure of the firmware information storage area is determined according to the required firmware information. The data structure of the firmware information storage area is (special header for storage information, firmware checksum, firmware length len, firmware name, firmware version, reserved area). Therefore, firmware information can be written to a specific area of ​​the firmware. In addition, the firmware information written has special requirements. Because if the flash has not been used, it is generally assumed to be 0x00 (00000000b), 0xFF (11111111b), 0x55 (01010101b), or 0xAA (10101010b). Even if the flash has been used, the probability of 0 and 1 mixed alternation as described in the text is almost zero, thus avoiding the possibility of random data.

[0035] First, the data format of the firmware information storage area is defined.

[0036] (1) A special header for storing information is used in this paper, which consists of alternating bytes of 0 and 1.

[0037] 0x55,0x55,0x55,0x5A,0x55,0xA5,0x55,0xAA,

[0038] 0x5A,0x55,0x5A,0x5A,0x5A,0xA5,0x5A,0xAA,

[0039] 0xA5,0x55,0xA5,0x5A,0xA5,0xA5,0xA5,0xAA,

[0040] 0xAA,0x55,0xAA,0x5A,0xAA,0xA5,0xAA,0xAA,

[0041] (2) Check the APP firmware verification values ​​(CRC check value, etc.) outside the storage information area.

[0042] (3) APP firmware length len

[0043] (4) APP firmware name

[0044] (5) APP firmware version

[0045] (6) Reserved area

[0046] Step 2, as follows Figure 3 , 4 As shown, the machine runs in the BOOT area, reads the data information from the summary firmware information storage area in the APP area, and obtains the absolute address as FLASH_BASE + Addr_offset based on the firmware absolute address FLASH_BASE and the firmware information storage area stored at the firmware offset address Addr_offset.

[0047] Step 3: Read the data from the firmware information storage area from the absolute address FLASH_BASE+Addr_offset.

[0048] Step 4: Verify whether the special header of the stored information conforms to the rules based on the read special header. Here, verification means that it is consistent with the preset value of the special header of the stored information. If it conforms, proceed to step 5; otherwise, consider the current firmware to be invalid.

[0049] Step 5: Verify the firmware length len based on the read firmware length. If the firmware length len in the firmware information storage area is 0, or the firmware length len exceeds the length specified by FLASH, the firmware is considered invalid; otherwise, proceed to step 6.

[0050] Step 6: Determine the validity of the firmware name in the firmware information storage area based on the firmware name. This determination is generally based on the specific circumstances and includes, but is not limited to, checking the first letter of the filename and the file extension. For example, if the firmware name is H_2_0_1.bin, the rule can be set as follows: the first letter of the name must be 'H' and the file extension must be ".bin" to be considered valid. If valid, proceed to step 7; otherwise, the firmware is considered invalid.

[0051] Step 7: Calculate the firmware checksum CRC (excluding firmware information storage area) of the previous firmware based on the read firmware length len. len bytes of data from the FLASH memory starting at address FLASH_BASE (excluding firmware information storage area) participate in the checksum calculation. len is the data read from the firmware information storage area. The calculated firmware checksum CRC is CRC_CAL. Compare the read firmware checksum CRC_SAVE with the obtained firmware checksum CRC_CAL. If they are the same, proceed to step 8; otherwise, consider the current firmware invalid.

[0052] Step 8: Read the data from the APP area and write it to the external flash, then proceed to step 9.

[0053] Step 9: Jump to the APP area to execute, and then proceed to step 10.

[0054] Step 10: Firmware backup writing complete.

[0055] An automated firmware backup system for a lawnmower robot includes a firmware information storage module, a data reading module, a storage information special header verification module, a firmware length verification module, a firmware name verification module, a verification value verification module, and a writing module, wherein:

[0056] The firmware information storage module is used to store firmware information with the following data structure: (storage information special header, firmware checksum, firmware length len, firmware name, firmware version, reserved area).

[0057] The data reading module is used when the machine is running in the BOOT area to read data information from the APP area summary firmware information storage area in the firmware information storage module.

[0058] The storage information special header verification module is used to verify whether the storage information special header read from the storage information conforms to the rules. If it conforms, the firmware length is verified; otherwise, the current firmware is considered invalid.

[0059] The firmware length verification module is used to verify the firmware length len based on the read firmware length. If the firmware length len in the firmware information storage area is 0, or the firmware length len exceeds the length specified by FLASH, the firmware is considered invalid; otherwise, firmware name verification is performed.

[0060] The firmware name verification module is used to determine whether the firmware name in the firmware information storage area is valid based on the firmware name. If it is valid, the firmware verification value CRC of the previous firmware is calculated; otherwise, the firmware is considered invalid.

[0061] The verification module calculates the firmware checksum CRC of the previous firmware based on the read firmware length len. The calculated firmware checksum CRC is CRC_CAL. The read firmware checksum CRC_SAVE is compared with the obtained firmware checksum CRC_CAL. If they are the same, a write operation is performed; otherwise, the current firmware is considered invalid.

[0062] The writing module is used to read data from the APP area and write it to the external flash.

[0063] The entire backup process of this invention does not require any external device intervention and is automatically implemented by the machine, which improves the ease of backup of factory firmware.

[0064] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for automatically backing up the factory firmware of a lawnmower robot, characterized in that, Includes the following steps: Step 1: Determine the data structure of the firmware information storage area according to the required firmware information. The data structure of the firmware information storage area is (special header of storage information, firmware check value, firmware length len, firmware name, firmware version, reserved area); the special header of storage information is 32 bytes of data, including four types of bytes: 0x55, 0x5A, 0xA5, and 0xAA. Step 2: The machine runs in the BOOT area and reads data from the APP area's summary firmware information storage area; Step 3: Verify whether the special header of the stored information read conforms to the rules. If it does, proceed to Step 4; otherwise, consider the current firmware to be invalid. Step 4: Verify the firmware length len based on the read firmware length. If the firmware length len in the firmware information storage area is 0, or the firmware length len exceeds the length specified by FLASH, the firmware is considered invalid; otherwise, proceed to step 5. Step 5: Calculate the firmware checksum CRC of the current firmware based on the read firmware length len. The calculated firmware checksum CRC is CRC_CAL. Compare the read firmware checksum CRC_SAVE with the obtained firmware checksum CRC_CAL. If they are the same, proceed to step 6; otherwise, consider the current firmware to be invalid. Step 6: Read the data from the APP area and write it to the external flash, then proceed to Step 7; Step 7: Jump to the APP area to execute, and then proceed to step 8; Step 8: Firmware backup writing complete.

2. The method for automatically backing up factory firmware for a lawnmower robot according to claim 1, characterized in that: The method for reading data from the APP region summary firmware information storage area in step 2: The absolute address is obtained as FLASH_BASE+Addr_offset based on the firmware absolute address FLASH_BASE and the firmware information storage area stored at the firmware offset address Addr_offset; data in the firmware information storage area is read from the absolute address FLASH_BASE+Addr_offset.

3. The method for automatically backing up factory firmware for a lawnmower robot according to claim 2, characterized in that: In step 5, the firmware name is verified before calculating the firmware checksum CRC of the current firmware. Methods for verifying firmware names: The firmware name in the firmware information storage area is checked to determine if it is valid. If it is valid, the CRC checksum of the current firmware is calculated; otherwise, the firmware is considered invalid.

4. A backup system employing the automatic factory firmware backup method for the lawnmower robot described in claim 1, characterized in that: It includes a firmware information storage module, a data reading module, a storage information special header verification module, a firmware length verification module, a verification value verification module, and a writing module, wherein: The firmware information storage module is used to store firmware information with the following data structure: (storage information special header, firmware check value, firmware length len, firmware name, firmware version, reserved area). The data reading module is used when the machine is running in the BOOT area to read data information from the APP area summary firmware information storage area in the firmware information storage module. The storage information special header verification module is used to verify whether the storage information special header read from the storage information special header conforms to the rules. If it conforms, the firmware length is verified; otherwise, the current firmware is considered invalid. The firmware length verification module is used to verify the firmware length len based on the read firmware length. If the firmware length len in the firmware information storage area is 0, or the firmware length len exceeds the length specified by FLASH, the firmware is considered invalid; otherwise, a verification value is performed. The verification module is used to calculate the firmware verification value CRC of the current firmware based on the read firmware length len. The calculated firmware verification value CRC is CRC_CAL. The read firmware verification value CRC_SAVE is compared with the obtained firmware verification value CRC_CAL. If they are the same, a write operation is performed; otherwise, the current firmware is considered invalid. The writing module is used to read data from the APP area and write it to the external flash.

5. The backup system according to claim 4, characterized in that: It includes a firmware name verification module, which is used to determine whether the firmware name in the firmware information storage area is valid based on the firmware name. If it is valid, the firmware verification value (CRC) of the current firmware is calculated; otherwise, the firmware is considered invalid.

Citation Information

Patent Citations

  • Dual backup achieving method of remote network system

    CN103731301A

  • Backing up firmware during initialization of device

    US20140325203A1