Parameter calibration method and calibration device of Hex file, storage medium and electronic equipment

By determining the storage type and calculating the target offset according to the chip type, and combining the storage address in the A2L file, determining the target storage address in the Hex file and writing parameters, the problem of poor compatibility of chip storage types in the prior art is solved, and the universality and success rate of parameter calibration are improved.

CN120066843APending Publication Date: 2025-05-30CONTEMPORARY AMPEREX TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311617789.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing offline calibration method of parameter is unable to adapt to the storage types of different chips, resulting in poor compatibility and the inability to effectively calibrate dynamic storage addresses, affecting the success rate of parameter modification.

Method used

Determine the storage type of the chip according to different chip types, calculate the target offset through the algorithm, combine the storage address in the A2L file, determine the target storage address in the Hex file, and write the parameters to be calibrated to this address to realize offline calibration.

Benefits of technology

It improves the universality and scope of application of parameter calibration, can effectively adapt to the storage methods of different chips, realizes accurate calibration of dynamic storage addresses, and improves the success rate of parameter modification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066843A_ABST
    Figure CN120066843A_ABST
Patent Text Reader

Abstract

The invention discloses a parameter calibration method and device for a Hex file, a storage medium and electronic equipment. The method comprises the steps that the storage type of a chip is determined according to the Hex file; determining a target offset according to the storage type of the chip; determining a target storage address of the to-be-calibrated parameter in the Hex file according to the storage address of the to-be-calibrated parameter in the A2L file and the target offset; and writing the to-be-calibrated parameter into the target storage address. According to the parameter calibration method, the storage address of the to-be-calibrated parameter can be determined according to different chip types, so that off-line calibration is realized, and the universality is relatively high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of parameter calibration, and particularly relates to a method for calibrating parameters of a Hex file, a calibration device, a storage medium, and an electronic device. Background Art

[0002] The current off-line parameter calibration method parses the parameters at a fixed address and overwrites and modifies the original parameters in the program, which cannot achieve parameter calibration for some special chips and has poor compatibility. Summary of the Invention

[0003] In view of the above problems, the present application provides a method for calibrating parameters of a Hex file, a calibration device, a storage medium, and an electronic device. The storage type corresponding to the chip is determined according to different chip types, and then the corresponding algorithm is determined according to the storage type to calculate the target offset. The target storage address of the parameter to be calibrated in the Hex file is determined based on the storage address of the parameter to be calibrated in the A2L file and the target offset, and the parameter to be calibrated is written into the target storage address, thereby realizing off-line calibration with high versatility.

[0004] In a first aspect, the present application provides a method for calibrating parameters of a Hex file, the method including: determining the storage type of the chip according to the Hex file; determining the target offset according to the storage type of the chip; determining the target storage address of the parameter to be calibrated in the Hex file according to the storage address of the parameter to be calibrated in the A2L file and the target offset; and writing the parameter to be calibrated into the target storage address.

[0005] In the technical solution of the embodiment of the present application, the chip type is determined according to the Hex file, and the storage type of the chip is determined according to the chip type, that is, whether the parameter storage address changes dynamically or non-dynamically. Then, the corresponding algorithm is selected according to the storage type of the chip to calculate the target offset, and the storage address of the calibration parameter in the A2L file is obtained. Combining the target offset, the target storage address of the parameter to be calibrated in the Hex file can be obtained, and the parameter to be calibrated is written into the target storage address. Among them, the A2L file is a container that stores parameter information about the vehicle's electronic control system, usually generated during the development of the ECU (Electronic Control Unit). For example, when testing battery thermal management, if the set temperature threshold does not meet the conditions, the temperature threshold needs to be modified at this time. It can be directly modified on the host computer. This modification process only needs to determine the target storage address of the temperature threshold in the Hex file, input the new temperature threshold into this target storage address, generate a new Hex file, realize offline calibration, and then send the new Hex file to the vehicle ECU. Since different chips have different parameter storage methods for the corresponding Hex files, the storage address of the parameter to be calibrated is determined according to different chip types, and offline calibration is realized, with high versatility.

[0006] In some embodiments, determining the target offset according to the storage type of the chip includes: when the storage type of the chip is dynamic storage, obtaining the start address and end address of the storage area where the parameter to be calibrated is located through the Map file; determining the target offset according to the difference between the end address and the start address. Thus, the situation where the calibration address size and the start address change dynamically can be considered, expanding the applicable range of parameter calibration.

[0007] In some embodiments, determining the target offset according to the storage type of the chip includes: when the storage type of the chip is static storage, determining a fixed offset according to the identifier of the chip, and using the fixed offset as the target offset. Thus, the corresponding algorithm can be selected according to the storage type of the chip to calculate the target offset, improving the versatility of parameter calibration.

[0008] In some embodiments, determining the target storage address of the parameter to be calibrated in the Hex file according to the storage address of the parameter to be calibrated in the A2L file and the target offset includes: using the difference between the storage address of the parameter to be calibrated in the A2L file and the target offset as the target storage address of the parameter to be calibrated in the Hex file. Thus, the target storage address of the parameter to be calibrated in the Hex file can be obtained according to the difference between the storage address of the parameter to be calibrated in the A2L file and the target offset determined according to the storage type of the chip, realizing offline calibration.

[0009] In some embodiments, writing the parameter to be calibrated into the target storage address includes: performing format conversion on the parameter to be calibrated; writing the parameter to be calibrated after format conversion into the target storage address, thereby converting the parameter to be calibrated into data conforming to the Hex file storage format, which is convenient for writing.

[0010] In some embodiments, the above-mentioned parameter calibration method for Hex files further includes: when the value of the parameter to be calibrated in the parameter list is the same as the value of the parameter to be calibrated written in the target storage address, confirming that the writing is successful. Thus, it is possible to judge in advance whether the modification is successful, without waiting until the flashing is completed to know the modification result.

[0011] In some embodiments, the above-mentioned parameter calibration method for Hex files further includes: when the Hex file has CRC (Cyclic Redundancy Check) check protection, writing the CRC check value into the target address; when the Hex file does not have CRC check protection or after the CRC check value is written, generating a new Hex file and outputting a Log file. Thus, the correctness of the written parameters can be ensured, and the check result and the parameter to be calibrated are displayed through the Log file.

[0012] In some embodiments, the above-mentioned parameter calibration method for Hex files further includes: when the Log file shows that the calibration is successful, determining that the parameter to be calibrated is calibrated; when the Log file shows that the calibration fails, after re-modifying according to the failure prompt, writing the calibration parameter into the target storage address again.

[0013] In a second aspect, the present application provides a parameter calibration device for a Hex file, including: a first determination module, configured to determine the storage type of the chip according to the Hex file; a second determination module, configured to determine the target offset according to the storage type of the chip; a third determination module, configured to determine the target storage address of the parameter to be calibrated in the Hex file according to the storage address of the parameter to be calibrated in the A2L file and the target offset; a writing module, configured to write the parameter to be calibrated into the target storage address.

[0014] In the technical solution of the embodiment of the present application, the first determination module determines the chip type according to the Hex file, and determines the storage type of the chip according to the chip type, that is, whether the parameter storage address is dynamically changed or not dynamically changed. Then the second determination module selects a corresponding algorithm to calculate the target offset according to the storage type of the chip, and the third determination module obtains the storage address of the calibration parameter in the A2L file. Combining with the target offset, the target storage address of the parameter to be calibrated in the Hex file can be obtained, and the writing module writes the parameter to be calibrated into the target storage address. Among them, the A2L file is a container that stores parameter information about the vehicle electronic control system, usually generated during the development of the ECU (Electronic Control Unit). For example, when testing the battery thermal management, if the set temperature threshold does not meet the conditions, the temperature threshold needs to be modified at this time. It can be directly modified on the host computer. This modification process only needs to determine the target storage address of the temperature threshold in the Hex file, input the new temperature threshold into this target storage address, generate a new Hex file, realize offline calibration, and then send the new Hex file to the vehicle ECU. Since different chips have different parameter storage methods for the corresponding Hex files, the storage address of the parameter to be calibrated is determined according to different chip types to realize offline calibration, and the generality is relatively high.

[0015] In a third aspect, the present application provides a computer-readable storage medium, on which a parameter calibration program for the Hex file is stored. When the parameter calibration program for the Hex file is executed by a processor, the above-mentioned parameter calibration method for the Hex file is implemented.

[0016] In a fourth aspect, the present application provides an electronic device, including a memory, a processor, and a parameter calibration program for the Hex file stored on the memory and executable on the processor. When the processor executes the parameter calibration program for the Hex file, the above-mentioned parameter calibration method for the Hex file is implemented.

[0017] The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the following specifically illustrates the specific embodiments of the present application. Description of the Drawings

[0018] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application. And in all the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0019] Figure 1 Flow chart of the parameter calibration method for the Hex file in some embodiments of the present application;

[0020] Figure 2 Schematic diagram of the parameter calibration method for the Hex file in some embodiments of the present application;

[0021] Figure 3 Schematic diagram of the parameter calibration method for the Hex file in some embodiments of the present application;

[0022] Figure 4 Schematic diagram of the parameter calibration method for the Hex file in some embodiments of the present application;

[0023] Figure 5 Block diagram of the parameter calibration device for the Hex file in some embodiments of the present application;

[0024] Figure 6 Block diagram of the electronic device in some embodiments of the present application. Detailed implementation manners

[0025] Hereinafter, embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical solution of the present application more clearly, and thus are only examples and should not be used to limit the protection scope of the present application.

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion.

[0027] In the description of the embodiments of this application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of this application, "a plurality" means two or more unless otherwise specifically defined.

[0028] Referring to "embodiments" herein means that a particular feature, structure, or characteristic described in connection with the embodiments can be included in at least one embodiment of this application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0029] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, the character " / " in this text generally indicates that the associated objects before and after are in an "or" relationship.

[0030] In the description of the embodiments of the present application, the term "plurality" refers to two or more (including two). Similarly, "multiple groups" refers to two or more groups (including two groups), and "multiple pieces" refers to two or more pieces (including two pieces).

[0031] In the description of the embodiments of the present application, the orientation or positional relationship indicated by technical terms such as "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the embodiments of the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation on the embodiments of the present application.

[0032] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installation", "connection", "connection", "fixation", etc. should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can also be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.

[0033] The current parameter offline calibration method is to parse the parameters at a fixed address and overwrite the original parameters in the program without considering the storage type of the chip, and it cannot calibrate specific chips (such as chips with dynamically adjusted parameter storage addresses), that is, the compatibility is insufficient. Additionally, the offline calibration directly writes the parameters into the Hex file, and it is necessary to wait until the flashing is completed to confirm whether the parameter modification is successful. Moreover, when flashing the Hex file, the situation of CRC check protection is not considered, and after writing, the program verification fails and the program cannot be flashed. At this time, the reason for the flashing failure cannot be known.

[0034] This application determines the storage type corresponding to the chip according to different chip types, then determines the corresponding algorithm to calculate the target offset according to the storage type, determines the target storage address of the parameter to be calibrated in the Hex file based on the storage address of the parameter to be calibrated in the A2L file and the target offset, and writes the parameter to be calibrated to the target storage address, thereby realizing offline calibration with high versatility.

[0035] For the convenience of description, the following embodiments are described in conjunction with Figure 1 this application.

[0036] Referring to Figure 1 , the following steps may be included in this application:

[0037] S101, determine the storage type of the chip according to the Hex file.

[0038] S102, determine the target offset according to the storage type of the chip.

[0039] S103, determine the target storage address of the parameter to be calibrated in the Hex file based on the storage address of the parameter to be calibrated in the A2L file and the target offset.

[0040] S104, write the parameter to be calibrated to the target storage address.

[0041] Specifically, when it is determined that a parameter needs to be modified, the chip type corresponding to the Hex file is obtained, and the storage type of the chip is determined according to the chip type, that is, whether the parameter storage address changes dynamically or not. Then, according to the storage type of the chip, the corresponding algorithm is selected to calculate the target offset, and the storage address of the calibration parameter in the A2L file is obtained. Combining the target offset, the target storage address of the parameter to be calibrated in the Hex file can be obtained, and the parameter to be calibrated is written to the target storage address. Among them, the types of chips (microcontrollers, vehicle ECUs, etc.) can be chips from different manufacturers. For example, Renesas Electronics, Infineon, Freescale, ARM and other manufacturers have their own chips; they can also be different chips from the same manufacturer, such as based on performance, cost, power consumption, packaging, availability, etc. Due to the different types of chips, the Hex software needs to be developed based on the chips. The A2L file is a container that stores parameter information about the vehicle's electronic control system, usually generated during the development of the ECU (Electronic Control Unit). For example, when testing battery thermal management, if the set temperature threshold does not meet the conditions, the temperature threshold needs to be modified. At this time, the temperature threshold can be directly modified on the host computer. This modification process only needs to determine the target storage address of the temperature threshold in the Hex file, input the new temperature threshold into this target storage address, generate a new Hex file to achieve offline calibration, and then send the new Hex file to the vehicle ECU. Since different chips have different parameter storage methods for the corresponding Hex files, the storage address of the parameter to be calibrated is determined according to different chip types to achieve offline calibration, and the versatility is relatively high.

[0042] In some embodiments, determining the target offset according to the storage type of the chip includes: when the storage type of the chip is dynamic storage, obtaining the start address and end address of the storage area where the parameter to be calibrated is located through the Map file; determining the target offset according to the difference between the end address and the start address. Among them, the Map file is a mapping relationship automatically generated when generating the Hex file, and the Map file includes the start address, end address, etc. of the storage areas where different parameters are located.

[0043] Specifically, different types of chips have different corresponding storage types, and the storage types can include dynamic storage and static storage. When the storage type of the chip is dynamic storage, that is, the parameter storage address changes dynamically, by reading the Map file, the storage area where the parameter to be calibrated is located is found, and the start address and end address of the storage area of the parameter to be calibrated are determined. Then, subtracting the start address from the end address can obtain the target offset. Thus, the situation where the calibration address size and the start address change dynamically can be considered, and the applicable range of parameter calibration is expanded.

[0044] In some embodiments, determining a target offset according to the storage type of a chip includes: when the storage type of the chip is static storage, determining a fixed offset according to the identification of the chip, and using the fixed offset as the target offset.

[0045] Specifically, when the storage type of the chip is static storage, that is, the parameter storage address is fixed and unchanged, a corresponding fixed offset is determined according to the type of the chip. The identification of the chip is the identity identification of the chip. According to the identity identification of the chip, the type of the chip can be determined. When the type of the chip is determined, the corresponding fixed offset can be obtained, and the fixed offset is used as the target offset. Thus, the corresponding algorithm can be selected according to the storage type of the chip to calculate the target offset, improving the generality of parameter calibration.

[0046] In some embodiments, determining the target storage address of a parameter to be calibrated in a Hex file according to the storage address of the parameter to be calibrated in an A2L file and the target offset includes: using the difference between the storage address of the parameter to be calibrated in the A2L file and the target offset as the target storage address of the parameter to be calibrated in the Hex file.

[0047] That is to say, the target storage address of the parameter to be calibrated in the Hex file can be obtained by the difference between the storage address of the parameter to be calibrated in the A2L file and the target offset determined according to the storage type of the chip, realizing offline calibration.

[0048] In some embodiments, writing the parameter to be calibrated into the target storage address includes: performing format conversion on the parameter to be calibrated; writing the parameter to be calibrated after format conversion into the target storage address.

[0049] Specifically, generally, the parameter to be calibrated is in decimal data. The parameter to be calibrated is subjected to format conversion to be converted into hexadecimal data, and then the hexadecimal parameter to be calibrated is written into the target storage address. Thus, the parameter to be calibrated is converted into data conforming to the storage format of the Hex file, which is convenient for writing.

[0050] In some embodiments, the above-mentioned parameter calibration method for the Hex file further includes: when the value of the parameter to be calibrated in the parameter list is the same as the value of the parameter to be calibrated written in the target storage address, confirming that the writing is successful.

[0051] Specifically, after writing the parameter to be calibrated into the Hex file, the written value is also compared with the value stored in the parameter list. If they are different, the writing is considered to have failed; if they are the same, the writing is considered to have succeeded. For example, if the parameter to be calibrated is a temperature value, the temperature value in the parameter list is 25°C, and the value written to the target storage address in the Hex file is also 25°C, the writing is considered to have succeeded; if it is determined that the temperature value after writing is different from the temperature value in the parameter list, the writing is considered to have failed. Thus, it is possible to determine in advance whether the modification is successful, without having to wait until the flashing is completed to know the modification result.

[0052] In some embodiments, the above parameter calibration method for the Hex file further includes: when the Hex file has CRC check protection, writing the CRC check value to the target address; when the Hex file does not have CRC check protection or after the CRC check value is written, generating a new Hex file and outputting a Log file.

[0053] That is to say, if there is no CRC check protection, a new Hex file is directly output, and a calibration Log file is output, where the Log file will display the calibration result. If there is CRC check protection, the CRC check value is recalculated, written to the target address storing the CRC check value, a new Hex file is output, and a calibration Log file is output. Thus, the correctness of the written parameters can be ensured, and the check result and the parameter to be calibrated are displayed through the Log file.

[0054] In some embodiments, the above parameter calibration method for the Hex file further includes: when the Log file shows that the calibration is successful, determining that the parameter to be calibrated is calibrated; when the Log file shows that the calibration fails, after modifying it again according to the failure prompt, rewriting the calibration parameter to the target storage address.

[0055] That is to say, after the Log file is output, it is also confirmed according to the Log file whether the parameter to be calibrated is successfully written to the target storage address in the Hex file. If the Log file shows that the writing fails, it is modified again according to the failure prompt, and then the parameter to be calibrated is written to the target storage address, and the subsequent judgment process is executed; if the Log file shows that the writing fails, the parameter calibration of the current Hex file is completed. For example, if the calculation of the target storage address of the parameter to be calibrated in the Hex file is incorrect, a calibration failure will occur. At this time, it is prompted that the target storage address is incorrect, the target storage address of the parameter to be calibrated in the Hex file is recalculated, and the parameter to be calibrated is written to the new target storage address.

[0056] As a specific example, as Figure 2 shown, the parameter calibration method of the present application may include:

[0057] Step1: Modify the configuration parameters, and output the list of changed parameters according to requirements, that is, determine the parameters to be calibrated.

[0058] Step2: Select the chip: Select the chip type corresponding to the Hex software.

[0059] Step3: According to the chip type selected in Step2, determine whether the storage address of the parameter to be calibrated is dynamically stored (whether the storage type of the chip is dynamic storage or static storage), and confirm the calculation method of the target offset.

[0060] If it is not dynamically stored, calculate the target storage address of the parameter in the Hex file through the address of the parameter in the A2L and the fixed offset, that is, the target storage address can be obtained by subtracting the fixed offset from the address of the parameter to be calibrated in the A2L.

[0061] If it is dynamically changing, obtain the start address and end address of the storage area of the parameter to be calibrated through the Map file, subtract the end address from the start address to get the target offset, and calculate the target storage address of the parameter in the Hex file through the address of the parameter to be calibrated in the A2L and the target offset calculated through the Map.

[0062] Step4: Parse the parameter to be calibrated: Perform format conversion on the loaded parameter to be calibrated, and convert the decimal data to hexadecimal data.

[0063] Step5: Write the parameter to be calibrated: Write the data after format conversion in Step4 into the new Hex (the target storage address for writing is calculated in Step3).

[0064] Step6: Verify whether the writing is successful: Confirm whether the writing is successful by comparing the parameter to be calibrated in the parameter list and the parameter to be calibrated after writing to the Hex.

[0065] Step7: Confirm whether the Hex has CRC check protection. If so, the CRC function needs to be checked and the target address for writing CRC needs to be filled in, specifically as Figure 3 shown.

[0066] Step8: If there is no CRC check protection, directly output the new Hex file and output the calibration log.

[0067] Step9: If there is CRC check protection, recalculate the CRC and write it to the target address for storing the CRC.

[0068] Step10: View the log file to confirm whether the writing is successful. If not, the reason for the error needs to be confirmed, and after modification, go back to Step5 to rewrite the parameter to be calibrated.

[0069] Step 11: If the calibration is successful as shown in the log file, the calibration is completed, specifically as shown in Figure 4 below.

[0070] In summary, determine the chip type according to the Hex file, and determine the storage type of the chip according to the chip type, that is, whether the parameter storage address is dynamically changed or not. Then select the corresponding algorithm according to the storage type of the chip to calculate the target offset, and obtain the storage address of the calibration parameter in the A2L file. Combining the target offset, the target storage address of the parameter to be calibrated in the Hex file can be obtained, and the parameter to be calibrated is written into the target storage address. Among them, the A2L file is a container that stores parameter information about the vehicle's electronic control system and is usually generated during ECU development. For example, when testing the battery thermal management, if the set temperature threshold does not meet the conditions, the temperature threshold needs to be modified at this time. The modification can be directly performed on the host computer. This modification process only needs to determine the target storage address of the temperature threshold in the Hex file, input the new temperature threshold into the target storage address, generate a new Hex file to achieve offline calibration, and then send the new Hex file to the vehicle ECU. Since different chips have different parameter storage methods for the corresponding Hex files, the storage address of the parameter to be calibrated is determined according to different chip types to achieve offline calibration, and the generality is relatively high.

[0071] Corresponding to the above embodiments, the present application also proposes a parameter calibration device for the Hex file.

[0072] As Figure 5 shown, the parameter calibration device 100 of the embodiment of the present application may include: a first determination module 110, a second determination module 120, a third determination module 130, and a writing module 140.

[0073] Among them, the first determination module 110 is used to determine the storage type of the chip according to the Hex file. The second determination module 120 is used to determine the target offset according to the storage type of the chip. The third determination module 130 is used to determine the target storage address of the parameter to be calibrated in the Hex file according to the storage address of the parameter to be calibrated in the A2L file and the target offset. The writing module 140 is used to write the parameter to be calibrated into the target storage address.

[0074] Specifically, when it is determined that a parameter needs to be modified, the first determination module 110 obtains the chip type corresponding to the Hex file, and determines the storage type of the chip according to the chip type, that is, whether the parameter storage address changes dynamically or non-dynamically. Then, the second determination module 120 selects a corresponding algorithm to calculate the target offset according to the storage type of the chip, and the third determination module 130 obtains the storage address of the calibration parameter in the A2L file. Combining the target offset, the target storage address of the parameter to be calibrated in the Hex file can be obtained, and the writing module 140 writes the parameter to be calibrated to the target storage address. Among them, the types of chips (microcontrollers, vehicle ECUs, etc.) can be chips from different manufacturers. For example, Renesas Electronics, Infineon, Freescale, ARM and other manufacturers have their own chips; they can also be different chips from the same manufacturer, for example, based on performance, cost, power consumption, packaging, supply, etc. Since the types of chips are different, the Hex software needs to be developed based on the chips. The A2L file is a container that stores parameter information about the vehicle's electronic control system and is usually generated during the development of the ECU (Electronic Control Unit). For example, when testing the battery thermal management, if the set temperature threshold does not meet the conditions, the temperature threshold needs to be modified. At this time, the temperature threshold can be directly modified on the host computer. This modification process only needs to determine the target storage address of the temperature threshold in the Hex file, input the new temperature threshold into this target storage address, generate a new Hex file to achieve offline calibration, and then send the new Hex file to the vehicle ECU. Since different chips have different parameter storage methods for the corresponding Hex files, the storage address of the parameter to be calibrated is determined according to different chip types to achieve offline calibration, and the versatility is relatively high.

[0075] In some embodiments, the second determination module 120 determines the target offset according to the storage type of the chip, specifically: when the storage type of the chip is dynamic storage, obtain the start address and end address of the storage area where the parameter to be calibrated is located through the Map file; determine the target offset according to the difference between the end address and the start address. Among them, the Map file is a mapping relationship automatically generated when the Hex file is generated, and the Map file includes the start address, end address, etc. of the storage areas where different parameters are located.

[0076] Specifically, for different types of chips, the corresponding storage types are different, and the storage types may include dynamic storage and static storage. When the storage type of the chip is dynamic storage, that is, the parameter storage address changes dynamically, the second determination module 120 reads the Map file to find the storage area where the parameter to be calibrated is located, and determines the start address and end address of the storage area of the parameter to be calibrated. Then, by subtracting the start address from the end address, the target offset can be obtained. Thus, it is possible to consider the situation where the calibration address size and the start address change dynamically, expanding the applicable range of parameter calibration.

[0077] In some other embodiments, the second determination module 120 determines the target offset according to the storage type of the chip, specifically: when the storage type of the chip is static storage, determine a fixed offset according to the identifier of the chip, and use the fixed offset as the target offset.

[0078] Specifically, when the storage type of the chip is static storage, that is, the parameter storage address is fixed and unchanged, the second determination module 120 determines the corresponding fixed offset according to the type of the chip. Among them, the identifier of the chip is the identity identifier of the chip. According to the identity identifier of the chip, the type of the chip can be determined. When the type of the chip is determined, the corresponding fixed offset can be obtained, and the fixed offset is used as the target offset. Thus, it is possible to select the corresponding algorithm to calculate the target offset according to the storage type of the chip, improving the generality of parameter calibration.

[0079] In some embodiments, the third determination module 130 determines the target storage address of the parameter to be calibrated in the Hex file according to the storage address of the parameter to be calibrated in the A2L file and the target offset, specifically: using the difference between the storage address of the parameter to be calibrated in the A2L file and the target offset as the target storage address of the parameter to be calibrated in the Hex file.

[0080] That is to say, the third determination module 130 can obtain the target storage address of the parameter to be calibrated in the Hex file by taking the difference between the storage address of the parameter to be calibrated in the A2L file and the target offset determined according to the storage type of the chip, realizing offline calibration.

[0081] In some embodiments, the writing module 140 writes the parameter to be calibrated to the target storage address, specifically: performing format conversion on the parameter to be calibrated; writing the parameter to be calibrated after format conversion to the target storage address.

[0082] Specifically, generally, the parameter to be calibrated is in decimal data. The parameter to be calibrated is subjected to format conversion to be converted into hexadecimal data, and then the hexadecimal parameter to be calibrated is written to the target storage address. Thus, the parameter to be calibrated is converted into data conforming to the storage format of the Hex file, which is convenient for writing.

[0083] In some embodiments, the writing module 140 is further configured to: confirm successful writing when the value of the parameter to be calibrated in the parameter list is the same as the value of the parameter to be calibrated written in the target storage address.

[0084] Specifically, after the writing module 140 writes the parameter to be calibrated into the Hex file, it also compares the written value with the previously stored value. If they are the same, it is considered that the writing fails; if they are different, it is considered that the writing is successful. For example, if the parameter to be calibrated is a temperature value, the temperature value in the parameter list is 25°C, and the value in the target storage address of the written Hex file is also 25°C, it is considered that the writing is successful; if it is determined that the temperature value after writing is different from the temperature value in the parameter list, it is considered that the writing fails. Thus, it is possible to judge in advance whether the modification is successful, without having to wait until the flashing is completed to know the modification result.

[0085] In some embodiments, the writing module 140 is further configured to: write the CRC check value into the target address when the Hex file has CRC check protection; generate a new Hex file and output a Log file when the Hex file does not have CRC check protection or after the CRC check value is written.

[0086] That is to say, if there is no CRC check protection, the writing module 140 directly outputs a new Hex file and outputs a calibration Log file, where the Log file will display the calibration result. If there is CRC check protection, the writing module 140 recalculates the CRC check value, writes it into the target address for storing the CRC check value, outputs a new Hex file, and outputs a calibration Log file. Thus, it is possible to ensure the correctness of the written parameters, and the check result and the parameter to be calibrated are displayed through the Log file.

[0087] In some embodiments, the writing module 140 is further configured to: determine that the parameter to be calibrated is calibrated when the Log file shows successful calibration; rewrite the calibration parameter into the target storage address after re-modifying according to the failure prompt when the Log file shows calibration failure.

[0088] That is to say, after the Log file is output, the writing module 140 also confirms whether the parameter to be calibrated is successfully written into the target storage address in the Hex file according to the Log file. If the Log file shows that the writing fails, the parameter to be calibrated is rewritten into the target storage address, and the subsequent judgment process is executed; if the Log file shows that the writing fails, the parameter calibration of the current Hex file is completed. For example, if the calculation of the target storage address of the parameter to be calibrated in the Hex file is incorrect, a calibration failure will occur. At this time, it is prompted that the target storage address is incorrect, the target storage address of the parameter to be calibrated in the Hex file is recalculated, and the parameter to be calibrated is written into the new target storage address.

[0089] It should be noted that for the details not disclosed in the parameter calibration device of the Hex file in the embodiments of the present application, please refer to the details disclosed in the parameter calibration method of the Hex file in the embodiments of the present application, and will not be elaborated here specifically.

[0090] Corresponding to the above embodiments, the present application also provides a computer-readable storage medium.

[0091] The computer-readable storage medium of the present application stores a parameter calibration program for the Hex file. When the parameter calibration program for the Hex file is executed by a processor, the above-mentioned parameter calibration method for the Hex file is implemented.

[0092] Corresponding to the above embodiments, the present application also provides an electronic device.

[0093] As Figure 6 shown, the electronic device 200 of the present application includes a memory 210, a processor 220, and a parameter calibration program for the Hex file stored in the memory 210 and operable on the processor 220. When the processor executes the parameter calibration program for the Hex file, the above-mentioned parameter calibration method for the Hex file is implemented.

[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and they should all be covered by the scope of the claims and the specification of the present application. In particular, as long as there is no structural conflict, the technical features mentioned in each embodiment can be combined in any way. The present application is not limited to the specific embodiments disclosed in the text, but includes all technical solutions falling within the scope of the claims.

Claims

1. A method for parameter calibration of a Hex file, characterized in that, the method includes: determining the storage type of the chip according to the Hex file; determining the target offset according to the storage type of the chip; determining the target storage address of the parameter to be calibrated in the Hex file according to the storage address of the parameter to be calibrated in the A2L file and the target offset; writing the parameter to be calibrated to the target storage address.

2. The parameter calibration method according to claim 1, characterized in that, determining the target offset according to the storage type of the chip includes: in the case where the storage type of the chip is dynamic storage, obtaining the start address and end address of the storage area where the parameter to be calibrated is located through the Map file; determining the target offset according to the difference between the end address and the start address.

3. The parameter calibration method according to claim 1, characterized in that, determining the target offset according to the storage type of the chip includes: in the case where the storage type of the chip is static storage, determining a fixed offset according to the identifier of the chip, and using the fixed offset as the target offset.

4. The parameter calibration method according to any one of claims 1-3, characterized in that, determining the target storage address of the parameter to be calibrated in the Hex file according to the storage address of the parameter to be calibrated in the A2L file and the target offset includes: using the difference between the storage address of the parameter to be calibrated in the A2L file and the target offset as the target storage address of the parameter to be calibrated in the Hex file.

5. The parameter calibration method according to claim 4, characterized in that, writing the parameter to be calibrated to the target storage address includes: performing format conversion on the parameter to be calibrated; writing the parameter to be calibrated after format conversion to the target storage address.

6. The parameter calibration method according to claim 1, characterized in that, further includes: when the value of the parameter to be calibrated in the parameter list is the same as the value of the parameter to be calibrated written in the target storage address, confirming that the writing is successful.

7. The parameter calibration method according to claim 1, characterized in that, further includes: when the Hex file has CRC check protection, writing the CRC check value to the target address; when the Hex file does not have CRC check protection or after the CRC check value is written, generating a new Hex file and outputting a Log file.

8. The parameter calibration method according to claim 7, characterized in that, further includes: when the Log file shows that the calibration is successful, determining that the parameter to be calibrated is calibrated; when the Log file shows that the calibration fails, after re-modifying according to the failure prompt, re-writing the calibration parameter to the target storage address.

9. A parameter calibration device for a Hex file, characterized in that, includes: a first determination module for determining the storage type of the chip according to the Hex file; a second determination module for determining the target offset according to the storage type of the chip; A third determination module, configured to determine a target storage address of the parameter to be calibrated in the Hex file according to a storage address of the parameter to be calibrated in the A2L file and the target offset; A writing module, configured to write the parameter to be calibrated into the target storage address.

10. A computer-readable storage medium, characterized in that, it stores a parameter calibration program for a Hex file, and when the parameter calibration program for the Hex file is executed by a processor, it implements the parameter calibration method for the Hex file according to any one of claims 1-8.

11. An electronic device, characterized in that, it includes a memory, a processor, and a parameter calibration program for a Hex file stored on the memory and executable on the processor. When the processor executes the parameter calibration program for the Hex file, it implements the parameter calibration method for the Hex file according to any one of claims 1-8.