mcClearMemory
- Updated2023-02-21
- 1 minute(s) read
Purpose
Clears the contents of the specified ECU memory.
Format
mcTypeStatus | mcClearMemory(
|
Input
ECURefNum
ECURefNum is the task reference which links to the selected ECU. This reference is originally returned from mcECUSelectEx.
Address
Configures the target address for the checksum operation in the ECU. mcAddress is a C struct consisting of:
Address
Specifies the address part of the target address.
Extension
Extension contains the extension part of the target address.
BlockSize
BlockSize determines the size of the block on which the checksum must be calculated.
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 mcStatusToString function of the ECU M&C API to obtain a descriptive string for the return value.
Description
mcClearMemory can be used to clear the contents of the non-volatile memory prior to reprogramming it. The Memory Transfer Address 0 (MTA 0) is set to the start of the memory block automatically by this function. The size parameter is the size of the block to be erased.
If you are using the XCP protocol, mcClearMemory implements the PROGRAM_CLEAR command. Refer to the ASAM XCP specification for further information on how to clear parts of non-volatile memory in the ECU.