Abstract: A DEVICE AND A METHOD FOR UPDATING SOFTWARE IN A TARGET DEVICE ABSTRACT The invention discloses a tool 100 and a method for updating software in a target device 40. The method involves generating a patch file 10. The patch file 10 comprises difference between a previous version 20 of the software and a new version 30 of the software. The patch file 10 is generated as per the sector size of flash memory of the target device 40. . (FIGURE 1)
Description:Complete Specification:
The following specification describes and ascertains the nature of this invention and the manner in which it is to be performed:
Field of the invention:
[0001] The present invention relates to a method and a device for updating software in a target device. More particularly, it relates to Firmware-Over-The-Air (FOTA) update in a target electronic device.
Background of the invention:
[0002] Delta download is a software update method in which only a delta file is sent to the target device. The target device can be any electronic device e.g., Electronic Control Units (ECUs) of vehicles. The delta file contains the difference between the old software and the new software. For example, the delta file is provided to a packaging tool in case of an OTA update or to a diagnostic tool for an update of software or firmware of ECUs of vehicles at the garage. The target device deploys a delta installer which reconstructs the new software from the delta file and the old image that is present in the target device.
[0003] BSdiff utility is one of the tools which generates the patch file over the entire binary file. In such patch file, the control block, differential block, and extra block are kept separately. As a result, the ECU must wait until the entire patch file is received before it can start processing of the contents. When decompressed, the file is mostly larger than the target file. Hence RAM must be large enough to hold the entire decompressed patch file, which is very unlikely in embedded systems.
[0004] The compression algorithm, gzip, used in BSdiff for compressing the Diff and Extra Block cannot be used in automotive embedded environment since it requires dynamic memory allocation. If the reprogramming was interrupted due to some reason, then it might lead to partial update and a full update is required next time.
Brief description of the invention:
[0005] The invention discloses a method for updating software in a target device. The method involves generating a patch file. The patch file comprises difference between a previous version of the software and a new version of the software. The patch file is generated as per the sector size of flash memory of the target device.
[0006] The method involves further adding a file header to the patch file. The patch file also has one or more sector data. The sector data comprises a sector header and payload to be processed for that sector.
[0007] The file header includes one more of the following: a version information, a base image version, a new CRC, number of sectors, a differential type, reserved byte, a target image version, length of old file, length of new file and one or more sector data.
[0008] Each sector header comprises one or more of a sector number, sector size, number of control blocks, flag for differential blocks or erase sector, number of bytes to be processed in the sector. The payload comprises a control block, a differential block and an extra block.
[0009] The patch file is compressed fully and transmitted to the target device, thereby freedom of choosing different compression algorithms is enabled. Only required target sectors of the flash memory in the target device are updated using the patch file. Thereby software update is done quickly and reliably
[0010] Data corresponding to the target sectors are also stored in one or more backup sector of the flash memory. Data is recovered from the one or more backup sectors after an interruption for resuming the software update in the target device.
[0011] The invention also discloses a tool for updating software in a target device. The tool generates a patch file comprising difference between a previous version of the software and a new version of the software. The patch file is generated as per the sector size of flash memory of the target device. The tool adds a file header to the patch file. The patch file also has one or more sector data. The sector data comprises a sector header and a payload to be processed for that sector.
[0012] Brief description of the accompanying drawings:
[0013] An embodiment of the disclosure is described with reference to the following accompanying drawing,
[0014] Fig. 1 shows schematic block diagram of a tool for updating software in a target device, according to an embodiment of the present invention; and
[0015] Fig. 2 shows a schematic view of a header of a patch file and a sector header, according to an embodiment of the present invention.
[0016] Detailed description of the embodiments:
[0017] Fig. 1 shows schematic block diagram of a tool for updating software in a target device, according to an embodiment of the present invention. The method for updating software involves generating a patch file 10. The patch file 10 may be generated using a tool 100. The patch file 10 comprises difference between a previous version 20 of the software and a new version 30 of the software. The software may be software or firmware required to be updated in the target device 40. The target device 40 may be any electronic device. For example, it may be an ECU in a vehicle 50 or an embedded device. The software or firmware update may be done directly using FOTA or any known methods through a cloud server. During service or repair of a vehicle 50 in a garage, the necessary software update may be done using a diagnostic tool 60.
[0018] The patch file 10 is generated as per the sector size of flash memory of the target device 40. The sector is the smallest storage block of the flash memory of the target device 40. The size of the sector is termed as the sector size, and it is pre-known to the tool 10. Generally, the software provider knows the model or type of the target device 40 and its specifications including the flash memory of the target device 40. Based on the sector size of the flash memory, the patch file 10 is generated.
[0019] The method involves further adding a file header to the patch file 10. Fig. 2 shows a schematic view of file header and sector data of the patch file, according to an embodiment of the present invention. The patch file 10 also has sector data. The sector data comprises a sector header 300 and payload (360, 370, 380…) to be processed for that sector.
[0020] The file header 200 includes one more of the following: a version information 210, a base image version 220, a new CRC 230, number of sectors 240, a differential type 250, reserved byte 260, a target image version 270, length of old file 280, length of new file 290 and one or more sector data.
[0021] The version information 210 gives the version of the algorithm which is used to generate the patch file 10. The base image version 220 is used to check the required base image in the target device 40. The new CRC 230 is used to verify if the image was recreated correctly. The number of sectors 240 gives the information regarding the number of sectors addressed in the patch file 240. The differential type 250 describes the algorithm used for generating the patch file 10.
[0022] Each sector data comprises sector header 300 and payload corresponding to that sector. Each sector header 300 comprises one or more of a sector number 310, sector size 320, number 330 of control blocks, flag 340 for differential blocks or erase sector, number 350 of bytes to be processed in the sector. The payload comprises one or more control blocks 360, differential blockss 370 and extra blocks 380. The payload comprises repetitive series of control blocks 360, differential blocks 370, and extra blocks 370. The repetition count or the number of these blocks are dependent on the number of control blocks 360
[0023] The sector number 310 is used for identifying the sector that is being updated. The flag 340 indicates if the sector contents are to be erased. The differential blocks 370 are added to the existing data in the target device 40. The extra blocks 380 are appended to the differential data.
[0024] The patch file 10 is generated without compressing the differential block 370 and the extra block 380 separately. Instead, the entire patch file 10 is compressed fully before transferring to the target device 40. This adds an extra flexibility for the customers to select customer specific compression methods. Thereby freedom of choosing different compression algorithms as per the customer need is enabled. Only required target sectors of the flash memory in the target device 40 are updated using the patch file 10. Thereby software update is done quickly and reliably
[0025] Data corresponding to the target sectors are also stored in one or more backup sector of the flash memory. Data is recovered from the one or more backup sectors after an interruption for resuming the software update in the target device. Thereby, problems and delay in the software update due to interruptions are avoided completely.
[0026] The tool 100 generates a patch file 10 comprising difference between a previous version 20 of the software and a new version 30 of the software. The patch file 10 is generated as per the sector size of flash memory of the target device 40. The tool 100 adds a file header 200 to the patch file 10. The patch file 10 also has one or more sector data. Each sector data has sector header 300 and a payload (360, 370, 380…) to be processed for that sector.
[0027] The file header 200 includes one more of the following: a version information 210, a base image version 220, a new CRC 230, number of sectors 240, a differential type 250, reserved byte 260, a target image version 270, length of old file 280, and length of new file 290.
[0028] Each sector header 300 comprises one or more of a sector number 310, sector size 320, number 330 of control blocks, flag 340 for differential blocks or erase sector, number 350 of bytes to be processed in the sector. The payload comprises a control block 360, a differential block 370 and an extra block 380.
[0029] The tool 100 compresses the patch file 10 fully and transmits to the target device 40 instead of compressing the differential block 370 and the extra block 380 separately. Hence different compression algorithms can be chosen according to customer’s requirements.
[0030] Only required target sectors of the flash memory in the target device 40 are updated using the patch file. Thereby software update is done quickly and reliably. Data corresponding to the target sectors are also stored in one or more backup sector of the flash memory. Data is recovered from the one or more backup sectors after an interruption for resuming the software update in the target device. Thereby, problems and delay in the software update due to interruptions are avoided completely.
[0031] Since the new file is reconstructed in a sector-by-sector manner the memory requirement is very low compared to processing the patch file 10 as a whole. Only the changed sectors will be updated with the proposed solution. This will reduce the overall reprogramming time. With the proposed restructuring of patch file, it is possible to process the control blocks one by one without the need to wait for the file to be received.
[0032] It should be understood that embodiments explained in the description above are only illustrative and do not limit the scope of this invention. Many such embodiments and other modifications and changes in the embodiment explained in the description are envisaged. The scope of the invention is only limited by the scope of the claims.
, Claims:
We claim: -
1. A method for updating software in a target device (40), said method comprises:
- generating a patch file (10) comprising difference between a previous version (20) of said software and a new version (30)of said software;
- characterized in said method,
- said patch file (10) is generated as per the sector size of flash memory of said target device (40).
2. The method according to claim 1, wherein said patch file (10) comprises a file header (200) and at least one sector data.
3. The method according to claim 1, wherein said file header (200) comprises at least one of a a version information (210), a base image version (220), a new CRC (230), number of sectors (240), a differential type (250), reserved byte (260), a target image version (270), length of old file (280), and length of new file (290).
4. The method according to claim 1, wherein said at least one sector data comprises at least one sector header (300) and payload to be processed for that sector.
5. The method according to claim 1, wherein said sector header (300) comprises sector number (310), sector size (320), number (330) of control blocks, flag (340) for differential blocks or erase sector, number (350) of bytes to be processed for that sector.
6. The method according to claim 1, wherein said comprises at least one control block (360), at least one differential block (370) and at least one extra block (380).
7. The method according to claim 1, wherein said patch file (10) is compressed fully and transmitted to said target device (40).
8. The method according to claim 1, wherein only required target sectors of said flash memory in said target device (40) are updated using said patch file (10).
9. The method according to claim 8, wherein data corresponding to said target sectors are also stored in at least one backup sector of said flash memory of said target device (10).
10. The method according to claim 9, wherein data is recovered from said at least one backup sector after an interruption for resuming said software update in said target device (10).
11. A tool (100) for updating software in a target device, said tool (100)
- generates a patch file (10) comprising difference between a previous version (20) of said software and a new version (30) of said software;
- characterized in that,
- said patch file (10) is generated as per the sector size of flash memory of said target device (40)
12. The method according to claim 1, wherein said patch file (10) comprises a file header (200) and at least one sector data.
| # | Name | Date |
|---|---|---|
| 1 | 202341012617-POWER OF AUTHORITY [24-02-2023(online)].pdf | 2023-02-24 |
| 2 | 202341012617-FORM 1 [24-02-2023(online)].pdf | 2023-02-24 |
| 3 | 202341012617-DRAWINGS [24-02-2023(online)].pdf | 2023-02-24 |
| 4 | 202341012617-DECLARATION OF INVENTORSHIP (FORM 5) [24-02-2023(online)].pdf | 2023-02-24 |
| 5 | 202341012617-COMPLETE SPECIFICATION [24-02-2023(online)].pdf | 2023-02-24 |