7.7.1. Calibration verification number (CVN) (psc_CvnCalc)

Calculates the calibration verification number of the code and calibration memory regions.

7.7.1.1. Supported targets

All targets

7.7.1.2. Required license

EXT_DIAG (Extended diagnostics library). (See Section 2.3, “Licensed Features”.)

7.7.1.3. Description

The CVN is calculated using CRC-16-CCITT. The reported CVN is composed of the code area CRC and calibration area CRC. The calibration area CRC occupies the 2 most significant bytes. The code area CRC occupies the 2 least significant bytes. Memory regions which are expected to change during normal ECU operation have been omitted from both code and calibration CRCs. The code area CRC excludes the file storage area. DTCs, freeze frames, etc, are stored in the file storage memory region. The calibration area CRC excludes adaptive calibrations. Unused memory areas have been omitted from both code and calibration CRCs.

Note that when the calibrations are mapped to RAM on development ECUs (i.e. whenever one can actually calibrate on-the-fly), changing those calibrations will affect the CVN. This is not the case for production units when the calibration is fixed and stored in non-volatile memory (NVM). When runtime calibration changes are made via CCP, the currently calculated CVN will be invalidated, and the available outport will be set to FALSE until the CVN is recalculated with a rising edge on the trigger inport.

The calibration verification number (CVN) is computed in the background task. Multiple invocations of the background task are used to calculate the CRC so as to prevent a watchdog timeout. At each invocation the CRC is calculated for a relatively small chunk of memory.

Background checking for code or calibration corruption works through the Calibration Verification Number computation on supported targets with the OBD library option. Ensure that the CVN is recomputed continually if run-time corruption checking is required. If it is detected, an unrecoverable error is raised (resulting in ECU reset). This is in addition to boot-time checksum validation.

After the CVN has been calculated for the first time, it will be automatically stored in NVM and recalled by the block during initialization on the next reset. The available and cvn outports will be updated with the previously calculated results after a power cycle.

7.7.1.4. Inports

  • trigger

    A boolean flag to trigger the CVN calculation, apply a rising edge to this inport.

    Value type:Boolean

7.7.1.5. Outports

  • cvn

    The calculated CVN is supplied to the application from this port. The supplied CVN is composed of the code area CRC and calibration area CRC. The calibration area CRC occupies the 2 most significant bytes. The code area CRC occupies the 2 least significant bytes.

    Value type:Integer
  • available

    This port indicates the availability of the CVN.

    • FALSE - CVN not available.

    • TRUE - CVN available.

    Once a CVN has been calculated returns TRUE until ECU reset, i.e. triggering further CVN calculations does not alter this value.

    Value type:Boolean
  • calculating

    True if the CVN is currently being calculated, otherwise false.

    Value type:Boolean

7.7.1.6. Mask parameters

7.7.1.7. Notes

None.