4.5. Programming an ECU

The OpenECU is programmed with any CCP compliant tool. Specific instructions for ATI Vision, Vector CANape and ETAS INCA calibration tools are provided in Appendix 2, Supporting tools. If you have another CCP compliant tool, please refer to the manufacturer's instructions for further details in programming and refer to Appendix 6, CCP compliance which details how OpenECU complies with the CCP 2.1 standard.

At a minimum, the OpenECU device will need to be powered and be connected to the CCP tool over CAN 0 or CAN A (whichever the target ECU makes available). In some cases the OpenECU module will need to have the FEPS line connected to a power supply capable of up to 19 volts (depending on target), as shown in the following diagram.

Note

The FEPS voltage must be asserted before the ECU is powered up. Powering the FEPS input and ECU simultaneously (i.e. shorting the FEPS and VPWR inputs) may result in reprogramming mode not being detected.

OpenECU operates in three system modes:

Boot mode

This is the mode initiated when the ECU is turned on (or recovering from a powered reset). Boot mode choose whether to enter reprogramming mode or application mode.

Reprogramming mode

This is the mode required to reprogram the OpenECU with the CCP tool. This mode is entered differently depending on the ECU. All OpenECU modules can be made to enter this mode by asserting the FEPS pin with a positive voltage (above the required threshold) and power cycling the OpenECU device.

Application mode

This is the mode required to run the application on OpenECU. Start this mode by grounding the FEPS pin and power cycle the OpenECU device.

How reprogramming and application mode is entered differs slightly between groups of ECUs due to differences in the electronics. For the M220, M250, M460 and M461 targets, the next illustration shows how each mode is entered.

Figure 4.10. System modes for M220, M250, M460 and M461

System modes for M220, M250, M460 and M461

For the M221 and M670 targets, the next illustration shows how each mode is entered.

Figure 4.11. System modes for M110, M221 and M670

System modes for M110, M221 and M670

There are a number of ways in which an ECU can be reprogrammed:

Reprogramming — ECU not previously programmed

Reprogramming the ECU without an application can be done with or without FEPS on the M110, M220, M221, M250, M460, M461 and M670.

Without a programmed application, reprogramming mode will use the default CCP settings as defined in Table 5.3, “CCP defaults”. As explained in the table, these settings will vary depending on the version of firmware that is programmed into the ECU.

Reprogramming without FEPS — ECU previously programmed (M110, M220, M221, M250, M460, M461 and M670 only)

Once an M110, M220, M221, M250, M460, M461 or M670 ECU has been programmed with a valid application, that ECU can be reprogrammed without having to apply FEPS.

With a programmed application, reprogramming mode will use the CCP settings defined by the application already programmed. If an application with different CCP settings is programmed then the new CCP settings are used after the ECU is power cycled.

Reprogramming with FEPS — ECU previously programmed (M220, M221, M250, M460, M461 and M670 only)

All OpenECU targets can be programmed by first applying FEPS and then cycling power to the ECU to enter reprogramming mode.

Furthermore, if the application is running and the application is not inhibiting programming then, without cycling power, the ECU can be programmed by applying FEPS and starting programming.

With a programmed application, reprogramming mode will use the CCP settings defined by the application already programmed. If an application with different CCP settings is programmed then the new CCP settings are used after the ECU is power cycled.

Forced reprogramming with negative FEPS (M110, M220, M221, M250, M460, M461 and M670 only)

The M220, M221, M250, M460, M461 and M670 ECUs can be made to use the default CCP settings instead of the application settings by applying a negative voltage to FEPS and then cycling power to the ECU. Reprogramming mode will then use the default settings for CCP.

The defined CCP settings are defined in Table 5.3, “CCP defaults”. As explained in the table, these settings will vary depending on the version of firmware that is programmed into the ECU.

Once programmed, an ECU will remain in reprogramming mode until the power is cycled. After the power cycle, the ECU will determine which mode to enter based on the FEPS voltage. To start the application after programming, ensure FEPS is grounded and power cycle the ECU.

The FEPS pin is asserted by applying a voltage to the pin. The required voltage varies between ECUs.

Table 4.7. FEPS voltages

M110 M221 M250 M220 M460 M461 M670 Result
0V0V0V0V FEPS pin is grounded. On power up, the ECU attempts to run the last programmed application in application mode. If a application has not been programmed, the ECU enters reprogramming mode.
> +36V> +13V> +17V FEPS pin is positive. On power up, the ECU enters reprogramming mode. If a application has previously been programmed, the ECU uses the CCP settings of the application. Otherwise, the ECU uses the default CCP settings.
< -16V< -16V< -18V< -16V FEPS pin is negative. On power up, the ECU enters reprogramming mode. The ECU uses the default CCP settings and ignores any CCP settings stored in any programmed application.

As a shortcut, the device can be reprogrammed via a CCP compliant tool without cycling the power to the ECU (FEPS may or may not been to be applied depending on the ECU). When reprogramming starts, the OpenECU device switches from application mode to reprogramming mode. It may be undesirable to allow this method due to safety reasons, so the pcp_CCPInhibitReprogramming block can switch this method off.

If the OpenECU device has never been programmed before, it uses the CCP settings given in Table 5.3, “CCP defaults”. The CCP compliant tool must use the same settings. Once the OpenECU device has been reprogrammed with an application that uses different CCP settings, the CCP compliant tool must be changed to use these settings.

Certain OpenECU devices might require different protocols for programming than CCP such as J1939 or ISO 15765. Please consult the technical specification of your device to determine the supporting protocols.