Purpose

Uploads data from an ECU. Format

mcTypeStatus mcUpload(
mcTypeTaskRef ECURefNum,
mcAddress Address,
u32 BlockSize,
u8 *Data);

Input

ECURefNum

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

Address

Configures the source address for the upload operation in the ECU. mcAddress is a C struct consisting of:

Address

Specifies the address part of the source address.

Extension

Extension contains the extension part of the address.

BlockSize

BlockSize is the size of the data block in bytes to be uploaded. Output

Data

Data is a byte array which receives the uploaded data information from the ECU.

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

If you are using the CCP protocol, mcUpload implements the CCP command UPLOAD. A data block of the specified length starting at the specified address is uploaded from the ECU. This function sets the Memory Transfer Address pointer MTA0 to the appropriate value as defined in the Address struct.

If you are using the XCP protocol, mcUpload implements the XCP command UPLOAD. A data block of the specified length starting at the specified address is uploaded from the ECU. The Memory Transfer Address pointer MTA0 is post-incremented by the given number of data elements. If the slave device does not support block transfer mode, all uploaded data is transferred in a single response packet. If block transfer mode is supported, the uploaded data is transferred in multiple responses on the same request packet. There are no limitations allowed concerning the maximum block size for the master.

Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to upload data and to use the mcUpload command.