Skip to main content

vFlashReprogram

Valid for: CANoe DE Note
This function replaces the function vFlashStart. With the following function(s) a CAPL program can use vFlash to program an ECU. vFlash has to be installed on the system running the RT kernel.
See also: vFlash Automation (Sample Configuration).

Function Syntax

void vFlashReprogram();

Description

Starts the flashing procedure. The progress will be indicated by calls to the optional callback vFlashProgramProgressCallback. The procedure has finished when CAPL callback vFlashReprogramCompleted is called. Note: This event-driven API is only needed outside of test modules or test units.

Parameters

Return Values

  1. Flashing was started

Example

FlashReprogram();
}

void vFlashProgramProgressCallback(dword progressInPercent, dword remainingTimeInS)
{
  // Do not print on every progress callback, but only in 10% steps
  DWORD sProgress = 0;
  if (progressInPercent < sProgress)
    sProgress = 0; // reset progress stored
  if (progressInPercent < 100 && (progressInPercent - sProgress) >= 10)
  {
    write("Progress: %3u%%, %us remaining", progressInPercent, remainingTimeInS);
    sProgress = progressInPercent - (progressInPercent % 10);
  }
}

void vFlashReprogramCompleted(long status)
{
  write("Reprogramming completed with status %d", status);
}