Many ECUs reserve an area of memory for adjustable (calibration) parameters. OpenECU Calibrator supports the upload of such parameter values by name, so that they can be downloaded or flashed later into a new build where those parameters have new memory addresses.
See also the OpenECU application note for worked examples of altering and reflashing calibration values.
An area of memory can be defined for calibrations in terms of one or more memory section names, or numeric address ranges. This area is the default area for upload to a new file, so that adjusted values can be saved.
By default OpenECU Calibrator attempts to identify the calibration area by looking for memory section names that match known ECUs. However, the area can also be set manually.
Note: the file used to identify the ECU based on the section names loaded is snoop_cal_area_lookup.xml in the program folder.
On the ECU window, click the “Calibration Area…” button to bring up this window. There is a similar button in the upload settings tab for each file associated with an ECU.
Changing Calibrations — Live
If your ECU copies adjustable parameters to RAM, so that download-to-RAM operations are allowed, they can be edited live using Watch and Lookup windows. Changing values will cause a download to the ECU. This is called “calibration on the fly”or “live calibration”. You can operate in online mode.
Perform the “Upload and Save” operation to pull all calibrations (including the adjusted values) out of the ECU and into a file (described further below). Use CalSync Up or CalSync Down to synchronise all calibration values between the ECU and the PC without saving to a file.
Use the Commit operation to immediately flash the ECU with the current PC memory values for the whole calibration area, so that they are fixed (non-volatile).
The colour of parameter values changes to indicate if the value differs from previously known values (loaded from a file). See Memory help for details. For example, stpc_lookup_x here has been edited, but stpc_lookup_y still has the default value loaded from the image file:
Changing Calibrations — Offline
It is also possible to edit calibration values offline, for example if you have no ECU available or if it stores values only in flash which cannot be changed live (only flash and upload operations allowed).
To work offline, click the Go Offline button in the memory access protocol section of the ECU window. Deselect “Auto start” if you generally wish to work offline.
Then load symbols and constant data (e.g. from a .HEX file). This will usually include the base calibration file values. You may also load a parameter (.C) file with previously saved modified values to PC scratchpad memory. OpenECU Calibrator will display offline values in Watch, Memory and Lookup windows. You may edit values, and any changes from the base values will be highlighted in colour.
Alternatively, if your ECU is already flashed with a calibration you wish to use as a starting point, use the CalSync Up button to copy all calibration values to PC scratchpad memory. The upload operation is allowed even if the ECU is generally offline. The current ECU software version must match the symbol files you have loaded.
Perform the “Save” operation to save the adjusted values out into a file (described further below). You can edit and save values with no ECU present at all if working offline.
Use the Commit operation to immediately flash the ECU with the current PC memory values for the whole calibration area.
Nudging Calibration Values
A meaningful amount depends on your application. Therefore it is possible to change the default amounts added or subtracted by a nudge for specific parameters, or all parameters matching a pattern. To do this, right-click and choose Nudge Selection… Nudge Settings. For example, here all parameters containing the text “temperature_thresh” and “proportional_term” have custom nudge amounts set:
You can also nudge values by using the up and down buttons on the controls toolbar. (Windows… Controls Toolbar to display it if it is not currently shown.) This toolbar may be dragged near the window you are working with:
Saving Calibrations — as image data
Parameter values can be saved as an image file (e.g. in .HEX format). The disadvantage of this is that if the software is rebuilt, parameter addresses are likely to change. Attempting to use the .HEX file saved from a previous build (by Download or Flash operations) is then likely to corrupt ECU memory, causing a crash. The advantage is that if the whole area containing parameters is saved, it can be flashed directly back onto the ECU to make those values persistent, and may be supplied to third parties who do not have the symbol data (e.g. for manufacturing).
To do this, use the “New image file…” button on the ECU window.
Saving Calibrations — by name
Parameter values can be saved in .c or .m format as described in the ECU help by clicking “New parameter file…”. The advantage of this is that the file can be used together with a complete image (e.g. .HEX file) with a new build of software, where the parameters may reside at new addresses.
Usually it is best to upload or save only changed calibration values, so that any other parameters take their default build values if a new build of software is made. Otherwise you may run into problems if (for example) array sizes change for parameters that are not of interest for adjustment. This is the default:
Values can be loaded from a parameter file to PC scratchpad memory so that they appear like new edits, and those edits can be re-saved as “differences”. See Load tab.
Note: click the spanner (wrench) button next to the file in the ECU window to adjust the file settings later.
Here is an example fragment of the file created in C format:
/* SNOOP_CONST_PARAM_ASSIGNMENTS_BELOW */
stpc_lookup_x = 99.99;
/* SNOOP_CONST_PARAM_ASSIGNMENTS_ABOVE */
Reflashing calibrations by name
Here the files are selected for different roles:
- The .ELF file provides the symbols (current address for each parameter). It is selected only for symbol load here.
- The .S3 file is a complete image providing the code and values for all areas of memory required for flash reprogramming. It is selected for data load here, allowing the “original” values for calibration values to be known, and changes highlighted.
- The .C file (as above) contains only the values that have been affected by adjustment. It is selected for flash reprogramming also.
With this combination, a new build of software can be loaded into the tool and flashed to the ECU by clicking the Load and Flash button, and all calibration values will have their default values from the build except those loaded from the .C file by name. This is the quickest way to update an ECU to a new build while using preferred calibration values saved previously.
Use the Resync Options button to bring up this window. It also appears automatically on ECU reset if some options are chosen.
Some protocols (e.g. CCP) can detect if the ECU has been through a reset or power cycle. Depending on the ECU, such a reset is likely to mean the ECU has “lost” any changes to its calibration values which were altered only in ECU RAM.
When calibrating an ECU, it is convenient to have any recent calibration edits automatically downloaded again to the ECU if it has reset. Choose one of the download sync cals options to achieve this. During this process, all other live updates are halted, to avoid overwriting calibrations in active Watch and Lookup windows with the post-reset ECU values.
However, detecting and restoring a mismatch of calibrations is slow, because a verify and download operation are involved. This means that there is a delay in restoring live value updates. Therefore for analysing or debugging startup behaviour, it is better to Continue without prompt.
If you choose Prompt to go offline, the program will stop communicating with the ECU after a reset is detected. While in the offline state, you may choose to use other ECU operations such as Committing calibration edits to ECU flash memory.