Purpose

Prepares the programming of non volatile memory. Format

mcTypeStatus mcXCPProgramPrepare(
mcTypeTaskRef ECURefNum,
mcAddress Address,
u16 CodeSize);

Input

ECURefNum

ECURefNum is the task reference which links to the selected ECU. This reference is originally returned from .

Address

Address Configures the target address to be cleared in the ECU. mcAddress is a C struct consisting of:

Address

Specifies the address part of the target address.

Extension

Contains the extension part of the target address.

CodeSize

CodeSize determines the size of data to be downloaded. Output

Return Value

The return value indicates the status of the function call as a signed 32-bit integer. Zero means the function executed successfully. A negative value specifies an error, which means the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.

Use the function of the ECU M&C API to obtain a descriptive string for the return value.

Description

may be used to indicate a data download as a pre-condition for non-volatile memory reprogramming. The Memory Transfer address (MTA) pointer is set to the volatile memory location specified by the parameters Address and Extension. The download itself is done by using subsequent standard commands like . The slave device must ensure that the target memory area is available and it is in an operational state which permits the download of code. If not, an error will be returned.

implements the optional XCP PROGRAM_PREPARE command defined by the XCP specification. For further information on how to program non-volatile ECU memory refer to the ASAM XCP Part 2 Protocol Layer Specification.