== ECU Reprogramming == === Putting the ECU in programming mode === There are several possible methods to get the ECU into reprogramming mode. The one you need to use will depend on what application software is already programmed to the ECU. 1. If the application has both a [[doc_user/openecu_user_guide_simulink_chunk/pcp_ccp_config.html| CCP Configuration]] and a [[doc_user/openecu_user_guide_simulink_chunk/pcx_can_config.html|CAN Configuration]] block, then it should be able to be reprogrammed at any time by sending the reprogramming command from a [[CAN Calibration Protocol|CCP]] tool. 1. If the application does not have [[doc_user/openecu_user_guide_simulink_chunk/pcp_ccp_config.html| CCP Configuration]] and [[doc_user/openecu_user_guide_simulink_chunk/pcx_can_config.html|CAN Configuration]] blocks, then you have to use the [[ECU Recovery|FEPS]] pin to put the ECU into programming mode. 1. If your application has a [[doc_user/openecu_user_guide_simulink_chunk/pcp_inhibit_reprog.html| CCP Inhibit Reprogramming]] block, then the application may require certain conditions to be met before CCP reprogramming is enabled. If you need to bypass this, you can use the [[ECU Recovery|FEPS]] pin to put a module in reprogramming mode. 1. It is possible that an application software with an error can successfully enter application mode then cause a software reset, but not so quickly as to trigger the excessive reset handler to force the module into reprogramming mode. In this situation, the module will require [[ECU Recovery|FEPS]] to force reprogramming mode. ''Notes:'' * Positive FEPS uses the CAN settings specified in the application blocks in your model. * Negative FEPS uses the module default CCP settings. See [[ECU Recovery]] for details on how to use it. * If the ECU will not respond to programming commands, see [[Dead ECU]] for instructions to recover it. === Large vs. Small Image Files === When an OpenECU model is compiled, it will generate a large and a small image file (_image_large.s37 .hex, _image_small.s37 .hex). * The small image contains entries only for ECU memory addresses used by the application. * The large image fills all unused memory with 0xFF. Functionally, the 2 software images are identical. However differences in the unused memory portions may affect the checksums, which can cause an error after reprogramming. It is generally recommended to use the small image file, especially when using CANape to reprogram the ECU. === Programming Tools === OpenECU can be reprogrammed via CCP with any of the tools listed below. The OpenECU user guide explains how to set up each tool for programming an ECU. Each calibration / programming tool uses a slightly different format for the .a2l file. The [[doc_user/openecu_user_guide_simulink_chunk/rtw_options.html|build options]] allow the correct format to be generated for each of the supported tools. * [[doc_user/openecu_user_guide_simulink_chunk/tool_pisnoop.html|Pi Snoop]] * ASAP2 File: _generic.a2l * ATI Vision - [[doc_user/openecu_user_guide_simulink_chunk/creating_a_project.html|Setting up a Project]], [[doc_user/openecu_user_guide_simulink_chunk/downloading_with_ati_vision.html|Programming]] * ASAP2 File: _vision.a2l * [[doc_user/openecu_user_guide_simulink_chunk/tool_canape.html|CANape]] * ASAP2 File: _canape.a2l * Note: when programming with CANape, the memory range that will be programmed to the ECU is defined in the .a2l file. If the .a2l file memory range only covers the memory used by the application, but the Large memory image is flashed, then there could be an error. To program the Large image, you may have to edit the memory range in the .a2l settings. The small image should match the .a2l file settings, so it can be used without any changes. * [[doc_user/openecu_user_guide_simulink_chunk/tool_inca.html|ETAS INCA]] * ASAP2 File: _inca.a2l * OpenECU has been tested with INCA v7.1.9. No other versions are formally supported, however customers have successfully used v5.1, v5.3, v5.4, and v7. * To use INCA with OpenECU, the ProF files need to be installed. This must be done during OpenECU installation by enabling the ''INCA-ProF Integration'' option (disabled by default). {{attachment:IncaProFInstall.png}} <> === Running the Application === Once the application is programmed the ECU will remain in reprogramming mode. It can be reprogrammed many times with various applications. The ECU supply must be power-cycled to leave programming mode and switch back into application mode. * The ECU is intentionally left in reprogramming mode after programming occurs. This reduces the likelihood that the ECU will behave unexpectedly in the event of a problem. Thus, it is not planned that OpenECU should ever support the feature of automatically executing the application after reprogramming. === Useful links === * [[Calibration Tools]] * [[ECU Recovery]] * [[doc_user/openecu_user_guide_simulink_chunk/ch03s03s08.html|Reference Manual - Programming]] ----