Firmware processing method and device, firmware verification method and beverage machine
By embedding length information and checksums into the firmware of embedded devices, self-describing target firmware generation and verification are achieved, solving the problems of write errors and data loss in the firmware generation process, improving the automation and reliability of verification, and reducing production line time.
Patent Information
- Application Number
- CN202611143069.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-11-20
AI Technical Summary
Existing technologies are prone to write errors and data loss during the firmware generation, delivery, and burning process of embedded devices, leading to inconsistencies in operation. Furthermore, existing verification methods require additional storage space and manual operation, increasing production line man-hours.
By embedding length information and checksums during the compilation process to generate self-describing target firmware, and performing self-verification before generation and burning, the firmware is compared using a predetermined verification algorithm to ensure its correctness and integrity, thus achieving automated verification.
It requires no additional storage space or manual intervention, can promptly detect anomalies in the generation process, improve verification reliability, reduce production line man-hours, and ensure firmware integrity after burning to prevent functional failure.
Smart Images

Figure CN123138017A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of firmware processing technology for embedded devices, and more specifically, to a firmware processing method and apparatus, a firmware verification method, and a beverage machine. Background Technology
[0002] The functionality of embedded devices (such as coffee makers and other beverage machines) is typically implemented by firmware. After being compiled by the compilation toolchain, this firmware is written to the embedded device's memory for execution via production line flashing or over-the-air (OTA) download. Throughout the firmware's lifecycle—from generation and delivery to flashing and operation—errors such as write errors and data loss can occur due to factors like compilation and packaging failures, flashing device malfunctions, and external signal interference. This can lead to inconsistencies between the running firmware and the original version, resulting in program malfunctions or functional failures.
[0003] In related technologies, an independent verification method is used, where verification information is separately burned into a fixed address area of the memory after the firmware is burned. However, this verification method requires additional fixed storage space; moreover, the preparation and separate burning of verification information often rely on manual operation, which is prone to errors and increases production line time.
[0004] Therefore, how to reliably ensure the integrity of firmware throughout the entire process from generation and delivery to burning and operation without occupying additional storage space and reducing production line time is an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides a firmware processing method, a firmware verification method, a firmware processing device, and a beverage machine. The firmware generation process performs self-verification, which can promptly confirm the correctness and integrity of the generated target firmware, thereby improving the reliability of verification and reducing production line time.
[0006] In a first aspect, embodiments of this application provide a firmware processing method, the method comprising: generating target firmware based on compiled original firmware, wherein the target firmware includes the original firmware, length information and a first checksum arranged sequentially, the length information indicating the length of the original firmware; reading the original firmware, the length information and the first checksum from the target firmware; performing a checksum operation on the original firmware and the length information based on a first predetermined checksum algorithm to obtain a first target checksum value; comparing the first checksum with the first target checksum value to obtain a first comparison result; determining whether the target firmware passes the checksum based on the first comparison result, wherein the condition for the target firmware to pass the checksum includes that the first comparison result is consistent.
[0007] Optionally, if the target firmware includes a checksum (i.e., the first checksum), the target firmware is deemed to have passed verification if the first comparison result is consistent.
[0008] Optionally, when the target firmware includes multiple check codes, the target firmware is deemed to have passed verification if all comparison results are consistent.
[0009] By sequentially embedding length information indicating its length and a first check code after the original firmware is compiled, a self-describing target firmware with an embedded check code is generated. After generation but before burning, the original firmware and the length information are read from the target firmware, and the same first predetermined check algorithm is used to re-perform the check operation. The first target check value obtained by the operation is compared with the embedded first check code, thereby performing self-check on the firmware generation process itself and promptly confirming that the generated target firmware is correct and complete.
[0010] Therefore, firmware generation, checksum embedding, and post-generation self-verification can all be completed automatically without manual intervention. This not only detects firmware anomalies generated during the generation process before firmware delivery, but also provides a self-describing comparison basis for integrity verification after flashing and before running the application.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, the target firmware further includes a second check code, which is located after the first check code.
[0012] In some embodiments, a second target verification value can be obtained by performing verification operations on the original firmware, the length information, and the first verification code based on a second predetermined verification algorithm, and the second verification code can be compared with the second target verification value to obtain a second comparison result. Further, it is determined whether the target firmware passes the verification based on the first comparison result and the second comparison result, wherein the condition for the target firmware to pass the verification includes that both the first comparison result and the second comparison result are consistent.
[0013] By adding a layer covering the original firmware, length information, and multiple check codes (e.g., a first check code and a second check code), and only when all comparison results are consistent (e.g., when there are two check codes, the first comparison result and the second comparison result are consistent), a multi-level check structure with hierarchical nesting and redundancy is formed, which can further improve the reliability of firmware integrity verification.
[0014] In conjunction with the first aspect, in some implementations of the first aspect, the method for generating the target firmware may include: reading the number of bytes of the original firmware as length information; appending the length information to the end of the original firmware by a first predetermined number of bytes to obtain a first firmware; generating a first checksum based on the first firmware using a first predetermined verification algorithm; appending the first checksum to the end of the first firmware by a second predetermined number of bytes to obtain a second firmware; generating a second checksum based on the second firmware using a second predetermined verification algorithm; appending the second checksum to the end of the second firmware by a third predetermined number of bytes to obtain a third firmware; and determining the third firmware as the target firmware.
[0015] By reading the current firmware level by level and appending a checksum to the end of the firmware by a predetermined number of bytes, each checksum is nested and covers all the firmware content before it. This generates a self-describing target firmware in a step-by-step recursive manner, which facilitates the location and extraction of each field by a fixed offset.
[0016] In some embodiments, the first predetermined verification algorithm is one of a cyclic redundancy check algorithm and a hash algorithm; and / or, the second predetermined verification algorithm is one of a cyclic redundancy check algorithm and a hash algorithm.
[0017] In some embodiments, the first predetermined verification algorithm and the second predetermined verification algorithm are the same, and the second predetermined byte number and the third predetermined byte number are the same, wherein the first predetermined verification algorithm and the second predetermined verification algorithm are cyclic redundancy check algorithms or hash algorithms.
[0018] By making the two-level verification algorithms the same and the first and second verification codes occupying the same number of bytes, each field is aligned with the same number of bytes in the target firmware. This facilitates quick location and extraction of each field at a fixed offset during verification, simplifies firmware parsing, and reduces the probability of errors.
[0019] In conjunction with the first aspect, in some implementations of the first aspect, if the target firmware passes verification, the target name of the target firmware can be automatically generated according to a predetermined naming rule, and the target firmware can be named using the target name.
[0020] By automatically generating and assigning a standardized target name to the target firmware according to a predetermined naming rule after verification, the standardization, traceability and maintainability of firmware management can be effectively improved.
[0021] In conjunction with the first aspect, in some implementations of the first aspect, the target name may include at least one of the following: the first checksum, the version number of the target firmware, the type of microcontroller to which the target firmware is applicable, the project name of the target firmware, the software type of the target firmware, and the generation date.
[0022] This allows for the automatic generation of firmware package names that conform to production line naming rules, eliminating the need for manual input and reducing production line time. By including information such as the first checksum, version number, microcontroller type, project name, software type, or generation date in the target name, the firmware file name itself reflects its checksum and key attributes, facilitating firmware identification and traceability.
[0023] In conjunction with the first aspect, in some implementations of the first aspect, reading the original firmware, the length information, and the first checksum from the target firmware includes: during the process of reading the target firmware, counting the bytes read to obtain a count value; when the count value reaches the length of the original firmware, obtaining the length information from the target firmware; and when the count value reaches the sum of the length of the original firmware and the first predetermined number of bytes occupied by the length information, reading the first checksum from the target firmware.
[0024] In conjunction with the first aspect, in some implementations of the first aspect, the method is executed automatically by a firmware processing script tool, which includes at least one of a post-build script of a compilation toolchain, a batch script, and a script program.
[0025] The firmware processing script tool automatically executes the firmware processing method after compiling the original firmware, generating and verifying the verification information along with the firmware, thus achieving full automation of the firmware processing process.
[0026] Secondly, embodiments of this application provide a firmware verification method for an embedded device. The method includes: after burning a target firmware to the application area of a memory, reading the original firmware and length information from the target firmware in the application area, wherein the target firmware includes the original firmware, the length information, and a first verification code arranged sequentially, the length information indicating the length of the original firmware; locating the first verification code according to the length information and reading the first verification code; performing a verification operation on the original firmware and the length information based on a first predetermined verification algorithm to obtain a first target verification value, comparing the first verification code with the first target verification value to obtain a first comparison result; and running the application if the target firmware verification passes, wherein the condition for the target firmware verification to pass includes the first comparison result being consistent.
[0027] By locating and reading the first checksum based on the length information embedded in the firmware after the target firmware is burned into the application area and before the application is run, the original firmware is re-verified and compared with the length information. The application is only run if the target firmware passes the verification. This intercepts devices with incomplete firmware before the device leaves the factory or is powered on, reducing the outflow of defective devices.
[0028] Optionally, if the target firmware includes a checksum (i.e., the first checksum), the target firmware is deemed to have passed verification if the first comparison result is consistent.
[0029] Optionally, when the target firmware includes multiple check codes, the target firmware is deemed to have passed verification if all comparison results are consistent.
[0030] In conjunction with the second aspect, in some implementations of the second aspect, the target firmware further includes a second verification code, which is located after the first verification code; before running the application, the method further includes: performing a verification operation on the original firmware, the length information, and the first verification code based on a second predetermined verification algorithm to obtain a second target verification value, and comparing the second verification code with the second target verification value to obtain a second comparison result; wherein, the condition for the target firmware to pass verification includes that both the first comparison result and the second comparison result are consistent.
[0031] By performing multi-level comparisons of multiple checksums before running the application, and only allowing the application to proceed when all comparison results are consistent, a hierarchical and progressive multi-level verification is achieved, further improving the reliability of firmware verification.
[0032] For example, if the target firmware includes two check codes, the application can be allowed to run only if the first check code and the second check code are compared at two levels before running. This achieves hierarchical and progressive dual verification, further improving the reliability of firmware verification.
[0033] In conjunction with the second aspect, in certain implementations of the second aspect, the length information occupies a first predetermined number of bytes, the first checksum occupies a second predetermined number of bytes, and the second checksum occupies a third predetermined number of bytes in the target firmware. In some embodiments, during the reading of the target firmware, the bytes read are counted to obtain a count value; when the count value reaches the sum of the length of the original firmware and the first predetermined number of bytes, the data read after the length information for the second predetermined number of bytes is determined as the first checksum; if the first comparison result is consistent, the data read after the first checksum for the third predetermined number of bytes is determined as the second checksum.
[0034] By determining the reading positions of the first and second check codes based on the predetermined number of bytes occupied by each field and the count value, it is possible to accurately locate and extract each check code with a fixed offset, thus achieving simultaneous reading and comparison.
[0035] In conjunction with the second aspect, in some implementations of the second aspect, the number of pages to be read in the target firmware can be determined as N, where N is an integer not less than 1, based on the size of the application area and the page size. When the number of pages read is less than N, page reading is performed on the target firmware, and the number of pages read is incremented until the number of pages read reaches N, at which point the page reading is considered complete. If the number of pages read reaches N but the first checksum has not been read, an error message is displayed.
[0036] By using page number N as the upper limit for page reading, it is possible to avoid reading failures due to firmware anomalies, and to promptly report an error if the first checksum is not read after reading N pages, thereby further improving the reliability of the verification process.
[0037] Thirdly, embodiments of this application provide a firmware processing apparatus, which includes a processor and a memory, the processor and the memory being interconnected via a bus; the memory is used to store program instructions; the processor is used to read the program instructions from the memory to execute the firmware processing method described in the first aspect.
[0038] The firmware processing device can execute the firmware processing method described in the first aspect, generate a self-describing target firmware with an embedded check code after compiling the original firmware, and perform integrity verification on it, thereby realizing the integration of firmware generation and embedded verification information.
[0039] Fourthly, embodiments of this application provide a beverage machine, which includes a controller and a memory, the controller and the memory being interconnected via a bus; the memory is used to store target firmware and program instructions, the target firmware being burned into the application area of the memory; the controller is used to read the program instructions in the memory to execute the firmware verification method described in the second aspect.
[0040] Before running the application, the controller of the beverage machine performs the firmware verification method described in the second aspect to verify the integrity of the target firmware burned into the application area, thereby preventing incomplete firmware from being run, avoiding functional failures caused by firmware abnormalities, and improving the operational reliability of the beverage machine.
[0041] It should be understood that the solutions in the third and fourth aspects mentioned above correspond to the solutions in the first and second aspects. The technical effects that the third and fourth aspects can achieve can be referred to the first and second aspects, and will not be repeated here. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a schematic flowchart of a firmware processing method provided in an embodiment of this application.
[0044] Figure 2 This is a schematic diagram of the data structure of the target firmware provided in the embodiments of this application.
[0045] Figure 3 This is a schematic flowchart of a firmware generation stage provided in an embodiment of this application.
[0046] Figure 4 This is a schematic flowchart of a firmware verification stage provided in an embodiment of this application.
[0047] Figure 5 This is a schematic flowchart of a firmware verification method for an embedded device provided in an embodiment of this application.
[0048] Figure 6 This is a schematic flowchart of another firmware verification method for embedded devices provided in the embodiments of this application.
[0049] Figure 7 This is a schematic structural block diagram of the firmware processing device provided in the embodiments of this application.
[0050] Figure 8 This is a schematic structural block diagram of the beverage machine provided in the embodiments of this application. Detailed Implementation
[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0052] It should be understood that the terms "first," "second," and "third," etc., used in the embodiments of this application are only for distinguishing descriptions and should not be construed as indicating or implying relative importance, nor should they constitute any limitation on this application. It should also be understood that "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A existing alone, A and B existing simultaneously, and B existing alone.
[0053] This application's embodiments can be applied to firmware generation and verification of embedded devices. The embedded device described in this application's embodiments can be a device that requires firmware to be burned or downloaded, and can be any device with a processor such as a microcontroller. This embedded device can include, but is not limited to, one or more of the following: smart home appliances (e.g., coffee machines, rice cookers, or robot vacuum cleaners), control devices (e.g., programmable logic controllers, robot controllers, data acquisition terminals, sensors, or instruments), in-vehicle devices (e.g., in-vehicle electronic control units, in-vehicle infotainment systems, or in-vehicle communication terminals), or consumer electronic devices. It should be understood that the above-described embedded devices are merely exemplary, and this application's embodiments do not limit the specific type of embedded device.
[0054] In the embodiments of this application, firmware refers to a series of program codes burned into the memory of a hardware device (such as a coffee machine or other types of beverage machines) to implement various functions of the device.
[0055] To facilitate understanding, the following will be combined with Figures 1 to 8 The firmware processing method, firmware verification method for embedded devices, and firmware processing apparatus provided in the embodiments of this application will be described in detail.
[0056] Figure 1 This is a schematic flowchart of the firmware processing method provided in an embodiment of this application. See also... Figure 1 The firmware processing method can be executed by a firmware processing device, such as a host computer or production line equipment running a firmware processing script tool, and includes the following steps.
[0057] 101. Generate target firmware based on the compiled original firmware, wherein the target firmware includes the original firmware, length information and a first checksum arranged in sequence, and the length information is used to indicate the length of the original firmware.
[0058] 102. Read the original firmware, the length information, and the first checksum from the target firmware.
[0059] 103. Based on the first predetermined verification algorithm, the original firmware and the length information are verified to obtain a first target verification value, and the first verification code is compared with the first target verification value to obtain a first comparison result.
[0060] 104. Determine whether the target firmware passes the verification based on the first comparison result, wherein the condition for the target firmware to pass the verification includes that the first comparison result is consistent.
[0061] In this embodiment of the application, a self-descriptive target firmware with an embedded verification code is generated by sequentially embedding length information indicating its length and a first verification code after the original firmware is compiled; and after generation and before burning, the original firmware and the length information are read from the target firmware, and the verification operation is performed again according to the same first predetermined verification algorithm and compared with the embedded first verification code, so that the firmware generation process itself can be self-verified to confirm that the generated target firmware is correct and complete.
[0062] The firmware generation and self-verification process can be automatically completed by the firmware processing script tool without manual intervention, thereby reducing production line time; and it provides a self-describing comparison basis for subsequent integrity verification (such as after the firmware is burned into the memory and before the application is run), improving the reliability of subsequent firmware verification.
[0063] In some embodiments, the original firmware refers to an executable program, such as a series of machine codes that can be programmed onto hardware, which is obtained by compiling the functional algorithms of the embedded device using a compiler. Exemplarily, the original firmware, the first firmware, and the target firmware can all be binary files (e.g., .bin files), such as the original firmware being app1.bin. It should be understood that the compiler and file formats described above are merely exemplary, and the embodiments of this application do not limit their scope.
[0064] In some embodiments, when the target firmware includes only one check code (i.e., the first check code), if the first comparison result is consistent, the target firmware is determined to pass the verification; or if the first comparison result is inconsistent, the target firmware is determined to fail the verification.
[0065] In some embodiments, when the target firmware includes multiple check codes, the target firmware is determined to have passed verification only if all comparison results are consistent, or if any comparison result is inconsistent, the target firmware is determined to have failed verification.
[0066] In one specific embodiment, the target firmware further includes a second checksum, which is located after the first checksum. Accordingly, before step 104, a second target checksum can be obtained by performing a checksum operation on the original firmware, the length information, and the first checksum based on a second predetermined checksum algorithm. The second checksum is then compared with the second target checksum to obtain a second comparison result. Further, the condition for the target firmware to pass checksum verification includes that both the first comparison result and the second comparison result are consistent. For example, if the target firmware includes two checksums, the target firmware is determined to pass checksum verification if both the first and second comparison results are consistent.
[0067] In this way, by nesting the second checksum to cover all the firmware content before it, a multi-level check structure with hierarchical nesting and redundancy is formed, which can further improve the reliability of firmware integrity verification.
[0068] In some embodiments, in step 101, the number of bytes of the original firmware can be read as the length information, and the length information can be appended to the end of the original firmware by a first predetermined number of bytes to obtain the first firmware. Optionally, a first checksum can be generated based on the first firmware according to the first predetermined verification algorithm, and the first checksum can be appended to the end of the first firmware by a second predetermined number of bytes to obtain the second firmware; a second checksum can be generated based on the second firmware according to the second predetermined verification algorithm, and the second checksum can be appended to the end of the second firmware by a third predetermined number of bytes to obtain the third firmware, which is the target firmware. A possible implementation of this step-by-step generation can be found below. Figure 3 The illustrated embodiment.
[0069] In some embodiments, the number of bytes in the original firmware can be read as the length information, and the length information can be appended to the end of the original firmware by a first predetermined number of bytes (e.g., 4 bytes). It should be understood that the above-mentioned first predetermined number of bytes is only exemplary, and the length information may also occupy other byte lengths. The embodiments of this application do not limit the number of bytes occupied by the length information.
[0070] In some embodiments, the first predetermined verification algorithm and the second predetermined verification algorithm may be one of a Cyclic Redundancy Check (CRC, such as CRC32 or CRC16) or a hash algorithm (such as MD5). The first predetermined verification algorithm and the second predetermined verification algorithm may be the same or different.
[0071] For example, when the predetermined verification algorithm is a cyclic redundancy check algorithm (e.g., CRC32), the checksum can occupy 4 bytes; while when the predetermined verification algorithm is a hash algorithm, the number of bytes occupied by the checksum can vary depending on the algorithm, for example, when using the MD5 algorithm, the checksum can occupy 16 bytes. That is, the number of bytes occupied by each checksum can vary depending on the verification algorithm used. Optionally, the first predetermined verification algorithm and the second predetermined verification algorithm are the same, and the second predetermined byte number and the third predetermined byte number are the same, so that the first checksum and the second checksum are aligned with the same number of bytes in the target firmware, facilitating rapid location and extraction of each field with a fixed offset. It should be understood that the above verification algorithms and their corresponding byte numbers are merely exemplary, and the embodiments of this application do not limit them.
[0072] For ease of understanding, Figure 2A schematic diagram of the data structure of the target firmware provided in an embodiment of this application is shown. See also Figure 2 The target firmware includes, in sequence, original firmware, length information, a first checksum, and a second checksum. The length information follows the original firmware and indicates its length; the first checksum follows the length information; and the second checksum is located at the end of the target firmware. It should be understood that the number of bytes in each field and the number of checksums in the target firmware's data structure are merely exemplary, and this application embodiment does not limit them.
[0073] In one specific implementation, the length information, the first checksum, and the second checksum can occupy the same number of bytes M (e.g., M is 4 bytes) in the target firmware. Of course, the number of bytes occupied by the length information can also be different from the number of bytes occupied by the checksum, and different checksums can occupy the same or different number of bytes.
[0074] It should also be understood that the target firmware may embed one or more checksums. In some embodiments, the target firmware may embed only the first checksum, thereby achieving firmware integrity self-verification in a simpler way; in other embodiments, the target firmware may embed both the first checksum and the second checksum, or even three or more checksums, in a hierarchical manner so that each checksum covers all the firmware content before it, forming a multi-level, redundant verification structure that is scalable, further improving the reliability of firmware integrity verification. The embodiments of this application do not limit the number of checksums embedded in the target firmware.
[0075] In some embodiments, if the target firmware is determined to pass verification, a target name for the target firmware can be automatically generated according to a predetermined naming rule, and the target firmware can be named using the target name.
[0076] For example, the target name may include the first checksum (e.g., CRC value), and at least one of the following: the version number of the target firmware, the type of microcontroller unit (MCU) to which the target firmware is applicable (e.g., MCU model), the project name of the target firmware, the software type of the target firmware, and the generation date. For instance, the verified target file can be renamed to a standardized filename containing information such as the project name, MCU model, software type, version number, CRC value, and generation date. This automatically generates firmware package names that conform to production line naming rules, eliminating the need for manual input, reducing production line man-hours, and effectively improving the standardization, traceability, and maintainability of firmware management. It should be understood that the specific fields and their combination order included in the target name are merely exemplary and can be adjusted according to production line requirements; this application embodiment does not limit this.
[0077] In some embodiments, in step 102, during the reading of the target firmware, the number of bytes read can be counted to obtain a count value; when the count value reaches the length of the original firmware, the length information is obtained from the target firmware; when the count value reaches the sum of the length of the original firmware and the first predetermined number of bytes occupied by the length information, the first checksum is read from the target firmware. Thus, when reading the target firmware, the original firmware, the length information, and the first checksum can be obtained sequentially based on the count of the bytes read.
[0078] In some embodiments, the firmware processing method can be automatically executed by a firmware processing script tool, which includes script programs, such as at least one of the following: a post-build script of a compilation toolchain, a batch script, a Python script, etc. Different scripts in the firmware processing script tool can be used at different stages; for example, the firmware generation stage is automatically executed by a batch script, and the firmware self-verification stage is automatically executed by a Python script.
[0079] Therefore, after compiling the original firmware, the firmware processing script tool can automatically generate target firmware with embedded checksums and verify it, thus achieving full automation of firmware processing. This application does not limit the specific form of the firmware processing script tool.
[0080] The following is combined Figure 3 A detailed implementation of the firmware generation method described above is presented. In the following description, the predetermined verification algorithm is cyclic redundancy check (CRC32) as an example; it should be understood that the embodiments of this application are not limited thereto.
[0081] Figure 3 This is a schematic flowchart of a firmware generation stage provided in an embodiment of this application. The flowchart shows the process by which a firmware processing script tool sequentially embeds length information and two check codes at the end of the firmware to generate the target firmware after the original firmware is compiled.
[0082] In some embodiments, Figure 3 The original firmware, first firmware, second firmware, and target firmware in the process shown can all be binary files (e.g., .bin files), and can be renamed level by level.
[0083] See Figure 3 The firmware generation phase includes the following steps.
[0084] 301, Determine if there is any raw firmware to be processed.
[0085] For example, if the original firmware is app1.bin, determine if app1.bin exists; if app1.bin exists, proceed to step 302; otherwise, end the process.
[0086] 302. Calculate the length of the original firmware, add length information to the end of the original firmware, and obtain the first firmware.
[0087] For example, calculate the byte length of app1.bin and add length information to its end, then save it as app2.bin, which is the first firmware.
[0088] 303. Calculate the first cyclic redundancy check value and add it to the end of the first firmware to obtain the second firmware.
[0089] For example, calculate the first cyclic redundancy check value for the entire app2.bin file and append it to the end of the file, then save it as app3.bin, which is the second firmware.
[0090] 304. Calculate the second cyclic redundancy check value and add it to the end of the second firmware to obtain the target firmware.
[0091] For example, calculate the second cyclic redundancy check value for the entire app3.bin file and append it to the end, then save it as app4.bin, which is the target firmware.
[0092] With the above scheme, after the original firmware is compiled, the firmware processing script tool automatically generates the first firmware, the second firmware and so on up to the target firmware, completing the embedding of length information and two cyclic redundancy check values, without the need for manual secondary burning of verification information.
[0093] This firmware generation method allows a firmware processing script tool (such as a batch script) to embed length information and two checksums sequentially at the end of the original firmware after the compiler generates the original firmware, thus obtaining the target firmware with embedded checksums.
[0094] In other embodiments, length information and each cyclic redundancy check value can be sequentially appended to the end of the same file or memory buffer, and the target firmware can be output at once. It should be understood that the above-mentioned file name, file format, and the use of two cyclic redundancy check calculations are merely exemplary, and the embodiments of this application do not limit the file format of the firmware or the number of check codes.
[0095] Figure 4 This is a schematic flowchart illustrating a firmware verification stage provided in an embodiment of this application. The flowchart illustrates the self-verification and standardized naming process after firmware generation. See also... Figure 4 The firmware verification phase includes the following steps.
[0096] 401, check if the target firmware exists in the directory; if not, end.
[0097] For example, if the target firmware is app4.bin, check if app4.bin exists in the directory; if it exists, proceed to step 402, otherwise end.
[0098] 402, Read the length information and two checksums at the end of the target firmware.
[0099] Optionally, the length information field at the end of app4.bin can be read, as well as the first and second check codes located after the length information.
[0100] 403, recalculate the checksum for the target firmware.
[0101] Optionally, the first operation result (e.g., the first CRC32 value) and the second operation result (e.g., the second CRC32 value) corresponding to the first check code and the second check code can be recalculated for the app4.bin file according to the Cyclic Redundancy Check algorithm.
[0102] 404 indicates a problem; check if the recalculated checksum matches the read checksum.
[0103] For example, the first checksum is compared with the first CRC32 value. If they do not match, the target firmware verification fails. If the first checksum and the first CRC32 value match, the second checksum is compared with the second CRC32 value. If the second checksum and the second CRC32 value do not match, the target firmware verification fails.
[0104] If the first check code matches the first CRC32 value, and the second check code matches the second CRC32 value, the target firmware is determined to have passed verification, and step 405 is executed.
[0105] 405, read the version number from the configuration file.
[0106] In some embodiments, a configuration file may refer to a file used to store configuration information such as the software version number. For example, the software version number may be automatically extracted from a configuration header file (such as a version configuration header file).
[0107] 406. Modify the name of the target firmware according to the predetermined naming rules.
[0108] For example, app4.bin can be renamed by one or any combination of project name, processor model (e.g., MCU model), software type, version number, checksum, and generation date.
[0109] The above solution enables automatic self-verification after firmware generation, requiring no manual intervention. It not only detects firmware anomalies generated during the generation process before delivery but also provides a self-describing comparison basis for integrity verification after flashing and before running the application. Furthermore, automatically generating and assigning a standardized target name to the target firmware according to predetermined naming rules effectively improves the standardization, traceability, and maintainability of firmware management.
[0110] In related technologies, after the target firmware is burned into the application (App) area of an embedded device, the following situations typically occur: First, no bootloader is set, and the device boots directly without any verification, making it impossible to determine the integrity of the firmware. Second, a bootloader is used, but only the validity of the MainStack Pointer (MSP) is verified. This means that even if some firmware data is lost, the device will still boot as long as the MSP remains valid, making defects difficult to detect and easily leading to defective devices being released. Third, after burning the App area, verification information is burned a second time into a fixed area of the flash memory. This consumes memory space, is prone to errors, and increases production line time.
[0111] This application provides a firmware verification method for embedded devices, which can provide self-describing location for firmware integrity verification, and does not require secondary flashing, thereby improving the reliability of verification, reducing the outflow of defective devices, and reducing production line time.
[0112] Figure 5 This is a schematic flowchart illustrating a firmware verification method for an embedded device provided in an embodiment of this application. This firmware verification method, in conjunction with the aforementioned firmware processing method, is used to perform integrity verification on the target firmware burned into the embedded device. See also... Figure 5 The firmware verification method can be performed by the processor of the embedded device (e.g., via the bootloader) before the bootloader runs the application, and includes the following steps.
[0113] 501. After burning the target firmware to the application area of the memory, the original firmware and length information are read from the target firmware in the application area. The target firmware includes the original firmware, the length information and the first check code arranged in sequence. The length information is used to indicate the length of the original firmware.
[0114] 502, Locate the first checksum based on the length information, and read the first checksum.
[0115] 503. Based on the first predetermined verification algorithm, the original firmware and the length information are verified to obtain a first target verification value, and the first verification code is compared with the first target verification value to obtain a first comparison result.
[0116] 504. If the target firmware verification passes, run the application.
[0117] The above firmware verification method locates and reads the first verification code based on the length information embedded in the firmware after the target firmware is burned to the application area and before the application is run. The original firmware is then re-verified and compared with the length information. Only the complete firmware that passes the verification is run. This method can detect incomplete firmware as soon as the firmware is burned or downloaded, preventing defective devices from being released. It overcomes the shortcomings of existing technologies, such as the inability to directly detect when some data is lost, as the device can still be turned on normally.
[0118] In some embodiments, in step 501, the firmware verification method is executed after the target firmware has been burned into the application area of the processor's (e.g., MCU, etc.) memory (e.g., flash memory). Exemplarily, a bootloader refers to a boot loader that executes before the application runs. Before running the application, it can read the original firmware and length information of the target firmware from the application area. Since the length information immediately follows the original firmware, a predetermined number of bytes (e.g., 4 bytes) of fields located after the original firmware can be read from the target firmware as the length information. It should be understood that the bootloader, memory type, and number of bytes described above are merely exemplary, and this application embodiment does not limit them.
[0119] In some embodiments, in step 502, the bytes read can be counted during the reading of the target firmware to obtain a count value. For example, let the length of the original firmware be L, and the length information occupy a first predetermined number of bytes be M. When the count value reaches L, the length information is read; when the count value reaches the sum of L and M (i.e., L+M), the starting position of the first checksum is after the length information, and the first checksum is read after the length information. For example, if the first checksum occupies a second predetermined number of bytes (e.g., 4 bytes when using the CRC32 algorithm), then the data of the second predetermined number of bytes after the length information is read as the first checksum. It should be understood that the above positioning and reading methods are merely exemplary, and the embodiments of this application do not limit them.
[0120] In some embodiments, in step 503, the first predetermined verification algorithm used for the verification operation is the same as the first predetermined verification algorithm used to determine the first verification code when generating the target firmware. For example, both use a 32-bit cyclic redundancy check algorithm or a hash algorithm (e.g., MD5 algorithm). The data segment corresponding to the first verification code is the original firmware and the length information; the data segment is verified according to the first predetermined verification algorithm to obtain a first target verification value (e.g., a first CRC32 value), and the read first verification code is compared with the first target verification value to obtain a first comparison result. It should be understood that the above verification algorithm and data segment division method are merely exemplary, and the embodiments of this application do not limit this.
[0121] In some embodiments, in step 504, if the target firmware includes a checksum, and the first comparison result is consistent, the target firmware is determined to be complete, and the bootloader jumps to run the application corresponding to the target firmware; if the first comparison result is inconsistent, the target firmware is determined to be incomplete, and an error message can be displayed to prevent the application from running.
[0122] In some embodiments, the target firmware may include multiple checksums. For example, the target firmware includes two checksums, specifically, it further includes a second checksum, which is located after the first checksum. Accordingly, before running the application, a second target checksum is obtained by performing a checksum operation on the original firmware, the length information, and the first checksum based on a second predetermined checksum algorithm. The second checksum is then compared with the second target checksum to obtain a second comparison result. The application is only run if both the first and second comparison results are consistent. For example, in the target firmware, the length information occupies a first predetermined number of bytes, the first checksum occupies a second predetermined number of bytes, and the second checksum occupies a third predetermined number of bytes. If the first comparison result is consistent, the third predetermined number of bytes of data are read after the first checksum as the second checksum, and the data segment including the original firmware, the length information, and the first checksum is re-checked to obtain the second target checksum (such as a second CRC32 value) for comparison. In this way, by first comparing the first checksum and then comparing the second checksum, a hierarchical and progressive dual verification is achieved, further improving the reliability of firmware integrity verification.
[0123] In some embodiments, before reading the original firmware and length information from the target firmware in step 501, the number of pages to be read in the target firmware can be determined as N, where N is an integer not less than 1, based on the size of the application area and the page size. For example, the size of the application area can be divided by the page size and rounded up to obtain N. When the number of pages read is less than N, paging is performed on the target firmware, and the number of pages read is accumulated. Each page of data read is stored in a buffer, and the data in the buffer is accumulated byte by byte until the number of pages read reaches N, at which point the paging is considered complete. Optionally, if the number of pages read reaches N but the first checksum has not been read, an error message is displayed. Thus, using the number of pages N as the upper limit for paging can prevent reading from failing to terminate normally due to firmware abnormalities. An illustrative process of the above paging can be seen below. Figure 6 The illustrated embodiment.
[0124] In some embodiments, since each check code used for comparison is embedded in the tail of the target firmware and is self-describingly located based on the length information carried by the firmware itself, the above firmware verification method does not require occupying a fixed address in the memory to store the check value separately, thereby reducing the occupation of the processor's storage area and being compatible with various types of processors; and the firmware generation and verification process can be completed completely automatically without the need for manual re-burning of the check information.
[0125] The following is combined Figure 5 and Figure 6 This paper describes the specific implementation of the firmware verification method according to the embodiments of this application during the firmware delivery and operation phases. In the following description, the predetermined verification algorithm is illustrated by Cyclic Redundancy Check (CRC32) and two check codes as an example. It should be understood that the embodiments of this application are not limited to this, and different check codes may employ different predetermined verification algorithms, or one or more check codes may be used for verification.
[0126] Figure 6 This is a schematic flowchart of another firmware verification method for embedded devices provided in the embodiments of this application. Figure 6 The following is a schematic process for the bootloader to perform an integrity check on the target firmware before running the application, including the following steps.
[0127] 601, Check if a program exists in the application area.
[0128] For example, the bootloader determines whether the target firmware has been burned into the application area of the memory; if it exists, it executes step 602; otherwise, it terminates.
[0129] 602, calculate the number of read operations required by the program, which is N.
[0130] For example, based on the size of the application area and the page size read in each pagination, the number of times N is required to read the entire application area of the target firmware can be calculated. For example, N can be obtained by dividing the size of the application area by the page size and rounding up.
[0131] 603, Determine if the current number of reads is less than N.
[0132] For example, if the current number of reads is less than N, proceed to step 604 to continue reading; if the storage location indicated by the length information or checksum is not located after N reads, it indicates that the firmware is abnormal and an error message is displayed.
[0133] 604. When the current number of reads is less than N, the read data is put into the buffer.
[0134] For example, read a page of data from the application area and store it in the buffer.
[0135] 605, calculate the checksum by accumulating the data in the buffer. The count is incremented by 1 for each byte read.
[0136] Optionally, the data in the buffer is incremented byte by byte using a cyclic redundancy check (e.g., CRC32), with the count incremented by 1 for each byte read.
[0137] 606, Determine whether the count value is equal to the length indicated by the length information.
[0138] Optionally, determine whether the count value is equal to the length L of the original firmware indicated by the length information; if not, return to step 603 to continue reading the next page of data.
[0139] 607. When the read position reaches the storage location indicated by the length information, extract the two check codes in the target firmware and compare them.
[0140] For example, when the count value reaches L, indicating that the reading position has reached the storage location indicated by the length information, the first checksum after the length information is extracted from the target firmware. A first target checksum is obtained by performing a checksum calculation on the original firmware and the length information based on a first predetermined checksum algorithm. The first checksum is then compared with the first target checksum to obtain a first comparison result. Optionally, if the first comparison result matches, a second checksum is read; if the first comparison result does not match, an error message is displayed.
[0141] When the first comparison result is consistent, the original firmware, length information and first verification code can be verified based on the second predetermined verification algorithm to obtain the second target verification value. The second verification code and the second target verification value are then compared to obtain the second comparison result.
[0142] 608, determine whether the cyclic redundancy check has passed.
[0143] For example, if both checksums match their corresponding calculation results, the verification is considered successful, and the bootloader jumps to run the application corresponding to the target firmware. Otherwise, the target firmware is deemed incomplete, and an error message is displayed to prevent the application from running.
[0144] Using the firmware verification method described above, the bootloader calculates the checksum of the target firmware page by page in the entire application area before jumping to run the application. It then locates and extracts the two embedded checksums based on the firmware's embedded length information and compares them. Only complete firmware that matches both checksums is allowed to run. This allows for immediate detection of incomplete firmware after burning or downloading, preventing defective devices from being released.
[0145] It should be understood that Figure 6 The pagination reading, byte-by-byte accumulation calculation, and number of reads N in the embodiments are merely exemplary, and the embodiments of this application do not limit them.
[0146] This application embodiment locates two checksums at the end of the firmware using length information embedded in the firmware, forming a multi-level, redundant checksum structure, which further improves the reliability of firmware integrity verification. Furthermore, the aforementioned firmware processing method and firmware verification method can share the same verification convention, enabling firmware generation and verification to match each other, thereby achieving full automation and integrity control of the firmware from generation to delivery and operation.
[0147] Figure 7 This is a schematic structural block diagram of a firmware processing apparatus for performing the above-described firmware processing method, provided in an embodiment of this application. See also... Figure 7 The firmware processing device 700 includes a processor 701 and a memory 702, which are interconnected via a communication bus 710.
[0148] The memory 702 is used to store program instructions; the processor 701 is used to read the program instructions from the memory 702 and then execute the firmware processing method described above. In some embodiments, the firmware processing device 700 can be a host computer or production line equipment running the firmware processing script tool described above, used to automatically generate a self-describing target firmware with an embedded checksum after compiling the original firmware, and to perform integrity verification on the target firmware. The tail of the target firmware has length information and at least one checksum. The firmware processing device 700 can implement the operations involved in the firmware processing method embodiments described above, therefore, to avoid repetition, it will not be described again.
[0149] In some embodiments, the processor 701 may be an integrated circuit chip with signal processing capabilities. By way of example and not limitation, the processor 701 may be a general-purpose processor, a digital signal processor (DSP), an ASIC, an FPGA, or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor, etc. For example, the processor 701 may be a central processing unit (CPU).
[0150] In some embodiments, memory 702 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile storage medium may be, for example, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory is random access memory used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory, dynamic random access memory, synchronous dynamic random access memory, double data rate synchronous dynamic random access memory, enhanced synchronous dynamic random access memory, synchronous linked dynamic random access memory, and direct memory bus random access memory.
[0151] Figure 8 This is a schematic structural block diagram of a beverage machine used to perform the above-described firmware verification method, provided in an embodiment of this application. See also... Figure 8 The beverage machine 800 includes a controller 801 (such as an MCU) and a memory 802, which are interconnected via a communication bus 810.
[0152] The memory 802 stores program instructions and the target firmware to be burned, which is burned into the application area of the memory 802. The controller 801 reads the program instructions from the memory 802 and then executes the firmware verification method described above. In some embodiments, the beverage machine 800 can be a beverage preparation device with a microcontroller, such as a coffee machine. The memory 802 is the non-volatile memory (e.g., Flash memory) of the microcontroller. Before running the application corresponding to the target firmware, the controller 801 executes the firmware verification method described above by the bootloader to perform integrity verification on the target firmware burned into the application area. The application is only run when the verification passes, thereby preventing incomplete firmware from being run. The beverage machine 800 can implement the operations involved in the firmware verification method embodiments of the embedded devices described above, so to avoid repetition, it will not be described again.
[0153] In some embodiments, the controller 801 may be any one or more of a microcontroller, microprocessor, digital signal processor (DSP), field programmable gate array (FPGA), system on chip (SoC), and microcontroller, and the embodiments of this application do not limit this.
[0154] In a specific implementation, the beverage machine 800 typically includes a controller 801 and a memory 802 coupled to the controller 801. The memory 802 can store firmware, which can be any one or more of non-volatile memories such as read-only memory (ROM), flash memory, and electrically erasable programmable read-only memory (EEPROM). The beverage machine can obtain or update the firmware through methods such as burning, downloading, or over-the-air downloading.
[0155] Currently, the verification method described in this application embodiment can be applied to devices with microcontrollers, such as coffee machines. Incomplete firmware can be detected immediately on production line machines, thereby preventing defective machines from being released.
[0156] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0157] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0158] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A firmware processing method, characterized in that, The method includes: The target firmware is generated based on the original firmware obtained by compilation, wherein the target firmware includes the original firmware, length information and a first check code arranged in sequence, and the length information is used to indicate the length of the original firmware; Read the original firmware, the length information, and the first checksum from the target firmware; The original firmware and the length information are verified using a first predetermined verification algorithm to obtain a first target verification value. The first verification code is then compared with the first target verification value to obtain a first comparison result. The target firmware is determined to pass the verification based on the first comparison result, wherein the condition for the target firmware to pass the verification includes that the first comparison result is consistent.
2. The method as described in claim 1, characterized in that, The target firmware further includes a second checksum, wherein the second checksum is located after the first checksum. Before determining whether the target firmware passes the verification based on the first comparison result, the method further includes: The original firmware, the length information, and the first verification code are verified using the second predetermined verification algorithm to obtain a second target verification value. The second verification code is then compared with the second target verification value to obtain a second comparison result. The step of determining whether the target firmware passes verification based on the first comparison result includes: The target firmware is determined to pass the verification based on the first comparison result and the second comparison result, wherein the conditions for the target firmware to pass the verification include that the first comparison result and the second comparison result are consistent.
3. The method as described in claim 2, characterized in that, The step of generating the target firmware based on the compiled original firmware includes: The number of bytes read from the original firmware is used as the length information; The length information is appended to the end of the original firmware according to a first predetermined number of bytes to obtain the first firmware; Based on the first predetermined verification algorithm, the first verification code is generated according to the first firmware, and the first verification code is appended to the end of the first firmware by a second predetermined number of bytes to obtain the second firmware. Based on the second predetermined verification algorithm, the second verification code is generated according to the second firmware. The second verification code is appended to the end of the second firmware by a third predetermined number of bytes to obtain the third firmware, wherein the third firmware is the target firmware.
4. The method as described in claim 3, characterized in that, in, The first predetermined verification algorithm is one of a cyclic redundancy check algorithm and a hash algorithm; and / or the second predetermined verification algorithm is one of a cyclic redundancy check algorithm and a hash algorithm.
5. The method as described in claim 4, characterized in that, The first predetermined verification algorithm and the second predetermined verification algorithm are the same, and the second predetermined byte number and the third predetermined byte number are the same, wherein the first predetermined verification algorithm and the second predetermined verification algorithm are cyclic redundancy check algorithms or hash algorithms.
6. The method according to any one of claims 1-5, characterized in that, in, The method further includes: If the target firmware passes verification, a target name for the target firmware is automatically generated according to a predetermined naming rule, and the target firmware is named using the target name.
7. The method as described in claim 6, characterized in that, The target name includes the first checksum, and at least one of the following: the version number of the target firmware, the type of microcontroller to which the target firmware is applicable, the project name of the target firmware, the software type of the target firmware, and the generation date.
8. The method according to any one of claims 1-7, characterized in that, The step of reading the original firmware, the length information, and the first verification code from the target firmware includes: During the process of reading the target firmware, the number of bytes read is counted to obtain a count value; When the count value reaches the length of the original firmware, the length information is obtained from the target firmware; When the count value reaches the sum of the length of the original firmware and the first predetermined number of bytes occupied by the length information, the first checksum is read from the target firmware.
9. The method according to any one of claims 1-8, characterized in that, The method is executed automatically by a firmware processing script tool, wherein the firmware processing script tool includes at least one of a post-build script of a compilation toolchain, a batch script, and a script program.
10. A firmware verification method for an embedded device, characterized in that, The method includes: After the target firmware is burned into the application area of the memory, the original firmware and length information are read from the target firmware in the application area, wherein the target firmware includes the original firmware, the length information and the first check code arranged in sequence, and the length information is used to indicate the length of the original firmware; The first verification code is located based on the length information, and the first verification code is read. The original firmware and the length information are verified using a first predetermined verification algorithm to obtain a first target verification value. The first verification code is then compared with the first target verification value to obtain a first comparison result. If the target firmware verification passes, the application is run, wherein the condition for passing the target firmware verification includes that the first comparison result is consistent.
11. The method as described in claim 10, characterized in that, The target firmware further includes a second verification code, wherein the second verification code is located after the first verification code. Before running the application, the method further includes: The original firmware, the length information, and the first verification code are verified using a second predetermined verification algorithm to obtain a second target verification value. The second verification code is then compared with the second target verification value to obtain a second comparison result. The condition for the target firmware to pass verification includes that both the first comparison result and the second comparison result are consistent.
12. The method as described in claim 11, characterized in that, in, In the target firmware, the length information occupies a first predetermined number of bytes, the first checksum occupies a second predetermined number of bytes, and the second checksum occupies a third predetermined number of bytes. During the reading of the target firmware, the number of bytes read is counted to obtain a count value; When the count value reaches the sum of the length of the original firmware and the first predetermined number of bytes, the second predetermined number of bytes of data after the length information is read and determined as the first check code; If the first comparison result is consistent, the third predetermined number of bytes of data are read after the first check code to determine the second check code.
13. The method according to any one of claims 10-12, characterized in that, Before reading the original firmware and length information from the target firmware, the method further includes: Based on the size of the application area and the page size, the number of pages to be read from the target firmware is determined to be N, where N is an integer not less than 1; If the number of pages read is less than N, perform pagination reading on the target firmware and increment the number of pages read until the number of pages read reaches N, then determine that the pagination reading is complete. An error message is displayed when the number of pages read reaches N and the first checksum has not been read.
14. A firmware processing device, characterized in that, The device includes a processor and a memory, which are interconnected via a bus; the memory is used to store program instructions; the processor is used to read the program instructions from the memory to execute the firmware processing method as described in any one of claims 1 to 9.
15. A beverage machine, characterized in that, The beverage machine includes a controller and a memory, which are interconnected via a bus; the memory is used to store target firmware and program instructions, and the target firmware is burned into the application area of the memory. The controller is used to read the program instructions in the memory to execute the firmware verification method as described in any one of claims 10 to 13.
