Ecocoder Manual: All Rights Reserved
Ecocoder Manual: All Rights Reserved
EcoCoder Manual
V4.8.2
Contact us:
Website: http://www.ecotrons.com
Email: [email protected]
[email protected]
CONTENTS
EcoCoder is an advanced auto code generation library added on top of Simulink generic
libraries. It links the user’s Simulink models directly to Ecotrons target controller.
EcoCoder encapsulates the lower level driver software, or basic software, also abstracts
the specific hardware, like Freescale or Infineon microprocessor-based controllers. It
enables the controls engineer to develop their control systems completely in
Matlab/Simulink environment.
Plus, EcoCoder is only an add-on package on top of Simulink. It enables engineers to
maximize the usage of Simulink generic library. It adds the necessary library blocks which
bridge the gap between application software and the specific controller hardware.
Meaning the application software will not be dependent on the specific hardware, and
you can port your models to any other hardware which supports the Simulink. In short,
you are not stuck with EcoCoder by using it.
Features:
Auto-code generation of Simulink/Stateflow models using Embedded
Coder/Stateflow Coder
Calibration using EcoCAL or other CCP based software
Programming using EcoFlash through CAN bus
OTA upgrade of application software
Available for both prototyping and production
Manual C-code integration is available in addition to model based design (MBD)
with Simulink/EcoCoder
Benefits:
Memory 2 GB or higher
Mandatory Components:
MATLAB
Simulink
Simulink Coder
Embedded Coder
Optional Components:
Stateflow
Note: some of the MATLAB versions may require extra configurations to make the
EcoCoder work. Contact us if you have compatibility issues.
VCU
Test Harness*
USB-CAN Adapter*
* Test harness is available from Ecotrons, however, users could also make their own by using recommended
connector parts.
* USB-CAN adapter need to be compatible with CAN Calibration Protocol (CCP). Third party adaptor like
Kvaser and PeakCAN are compatible with Ecotrons products.
* Note: the above is an example tool chain for NXP MPC 56xx family
microcontrollers. For Infineon Aurix family or NXP MPC 57xx family, or other family
of microcontrollers, the tool chains will be different. But the installation process is
For a 32-bit system, the MATLAB comes with a ‘LCC’ compiler which supports Stateflow
automatic code generation. For 64-bit systems, MATLAB does not provide compiler. In
order to use Stateflow coder, it's necessary to install a third-party C++ Compiler that
supports MATLAB 64-Bit version.
https://www.mathworks.com/support/sysreq/previous_releases.html
4. After finishing the compiler installation, follow the steps in previous section to
Note: Please keep MATLAB closed during the entire installation and licensing process.
1. Double-click ‘EcoCoder 56xx Vx.x.x Setup.msi’, click ‘Next’ at the following screen.
3. Click ‘Next’.
4. Choose the version of MATLAB you want to install EcoCoder to, then select
‘Install EcoCoder to selected MATLAB version’, click ‘OK’. You could also install
5. Click ‘Close’.
6. After the installation is successful, the icon ‘EcoCoder Loader’ will appear on the
Copyright ECOTRONS LLC www.ecotrons.com Page 16
EcoCoder Manual V4.8.2
desktop. EcoCoder Loader will be used to generate the license file and activate
EcoCoder.
7. If you start MATLAB, it will prompt message ‘EcoCoder has been installed
installed to MATLAB.
After the installation of HighTec TriCore Tool Chain, users need to specify the
Then in the pop-up window, click ‘Browse’, locate the ‘make.exe’ in the HIGHTEC
1.1\bin\make.exe’
There are two ways to activate EcoCoder and other Ecotrons software.
1. Dongle
The hardware dongle released by Ecotrons could activate software once it is plugged in
PC.
2. .dat file
‘.dat’ file is linked to Windows SN, meaning the ‘.dat’ file is bound to a specific PC and not
allowed to be transferred to another PC. New ‘.dat’ file has to be issued if customer shift
to new PC.
Note: all Ecotrons software would ‘remember’ license once it is activated even after it is
upgraded to new version. It is mandatory to use Windows Add/Remove programs to
uninstall all previously installed versions of EcoCoder. For safety concern, please install
new version to same folder as previous EcoCoder.
3. Click ‘Export’.
3. Click ‘Browse’.
5. Open license file, for example, select ‘EcoCoder_license.dat’, then select ‘Open’.
6. Click ‘OK’. The activation is successful if the pop-up window is displayed as following.
The purpose of this chapter is to give users a quick start to use EcoCoder for control
system development. If you don’t have any Simulink models yet, and want to have
something to start with, or if you want to port your existing Simulink models into
EcoCoder platform, this is a quick start. Because EcoCoder will provide an outline (a
3. A model ‘DemoTest.mdl’, and a ‘.m’ file as shown in the following figure will be
button in Simulink task bar, ‘.a2l’, ‘.mot’, ‘.cal’ file would be generated.
If the ‘CodeWarrior’ window pops up, do not manually intervene, it will automatically
As shown in below picture, you can find the generated ‘mot’, ‘cal’, and ‘a2l’ files.
The EcoCoder library is an add-on library in Simulink. EcoCoder library mainly provides
interface for application software to handle I/Os, VCU power, communication and
calibration / measurement setup, etc.
Under the ‘General Parameters’ tab, this block defines the specific model of Ecotrons VCU
Place this block in application model, usually at the top level, to select the VCU model for
users’ application. The ‘Advanced Parameters’ tab enables the user to work with part of
the ROM and RAM memory addresses. If you would like to do the adjustment regarding
all the addresses, please contact Ecotrons Tech Support, otherwise, please keep it as
default.
Block Parameters:
trigger*
for adjustments
4.2 ADC
In most cases, there are voltage dividing and shifting circuits on the target VCU hardware
that map the physical voltage being measured into the range that the microcontroller
chip(s) can read, usually 0 to 5V. The resolution at which this pre-processed voltage by
dividing circuits can be measured depends on the controller chip, usually 10 or 12 bits
(1023 or 4095 maximum value, respectively). A reading of 0 represents the minimum
voltage specified for these external circuits and a maximum value (1023 or 4095)
represents the highest specified voltage.
This EcoCoder block outputs values of the A/D converter channel connected to
corresponded physical pin. The output value is a mapping of ratio of the voltage level of
the analog source to the Reference Voltage (usually 5V) to a 10 or 12 bits binary value.
EcoCoder has predefined input voltage range and resolution of each channel, please refer
to datasheet of the specific VCU.
1 10 500 000111110100
2 12 500 00000111110100
Block Parameters:
This block enables user to read the physical voltage at the physical pin on the connector,
and block output data type is fixed-point.
Block Parameters:
1. Analog input channel: Choose analog channel.
2. Input type: Channel type of the voltage input, 4 types are supported: ‘0-5V‘, ‘0-12V‘,
‘0-24V‘ and ‘Custom Voltage Ratio’.
3. AD Resolution: Please refer to the datasheet of VCU for resolution selection.
4. Custom Voltage Ratio: this option is available for fourth input type ‘Custom Voltage
Ratio’ only. Previously, every voltage input type has fixed resistor divider, as a result, the
user just need to select voltage type. Different resistor divider is introduced in new
hardware, which explain the introduction of new input type and this input option.
5. Reference Voltage: By default, it will be set as 5V. Please do not change.
Block Output:
Volt: physical value of input voltage of specified channel; unit: V; ‘single’ data type.
This block enables user to read the physical voltage at the physical pin on the connector,
and block output data type is float-point.
Block Parameters:
1. Analog input channel: Choose analog channel.
2. Input type: Channel type of the voltage input, 4 types are supported: ‘0-5V‘, ‘0-12V‘, ‘0-
24V‘ and ‘Custom Voltage Ratio’.
3. AD Resolution: Please refer to the datasheet of VCU for resolution selection, since
different VCUs have different AI channels setup.
4. Custom Voltage Ratio: this option is available for fourth input type ‘Custom Voltage
Ratio’ only. Previously, every voltage input type has fixed resistor divider, as a result, the
user just need to select voltage type. Different resistor divider is introduced in new
hardware, which explain the introduction of new input type and this input option.
5. Reference Voltage: By default, it will be set as 5V. Please do not change.
Block Output:
Volt: physical value of input voltage of specified channel.
Please Refer to Chapter 5, CAN theory of Ecotrons before using EcoCoder CAN blocks.
Chapter 5, combined with CAN bus communication protocol, will give the user
This block provides configuration interface for CAN lower level protocol parameters. It is
recommended to read through and understand CAN lower level protocol prior to
designing CAN related application software.
Block Parameters
CAN ID Mask (uint32 Hex) Not Configurable fixed at ‘7ff’, which means
only IDs with lower 11 bits
same as input of ‘CAN ID
Filter’ will be accepted by
VCU if ‘CAN ID Filter
Enable’ checked
*For principle of CAN bus filtering, please refer to some published literatures .
This block provides CAN messages receiving and unpacking function. It requires a .m file
of CAN message definition to help unpack CAN messages. The generation process of m
Block Parameters
Message counter, if
checked: every time the
Show Message Count Port Check box
message is received, the
counter increments by 1.
Input Data Type: Inherit Check box If checked: the data type of
the signal is inherited from
input data type.
If not checked: the signal
type is automatically
defined using fixed point
tool.
Block Inputs:
Signals to be sent out.
Block Outputs (if Disconnected is selected under Select CAN Channel State):
1. Remote: frame type- 1 is remote frame, 0 is standard frame
These two blocks are similar to previous two blocks which is generic version of CAN
read/send for customer who did not purchase fixed point toolbox of Simulink. However,
blocks.
This module can be used to count the number of frames received by specified CAN
channel.
Block Parameters
monitored
Block Output:
cnt: If the selected channel receives one frame, cnt value increments by 1.
This module can be used to switch CAN operating mode between ‘listen only’ and
‘normal’.
Block Parameters
Block Input:
Trigger signal: the signal input to trigger the execution of this block.
Block Parameters:
1. CAN Channel: CAN channel selection.
2. Data Length: Message data length, in bytes.
3. CANID: The ID of the message to be sent. HEX value.
4. Frame Type: Drop-down list for frame type selection.
Block Inputs:
data: The message data to be sent.
Block Parameter:
Signal (Array): the signal definition matrix of CAN frame.
Block Inputs:
Data: the message data to be unpacked.
Block Outputs:
Unpacked signals from the CAN data.
Pack CAN signals to CAN message, usually used together with Send CAN Data block.
Block Parameters:
Out Signal (Array): The definition array of the signals to be packed。
Block Inputs:
Signals to be packed, values are in HEX.
Block Output:
Data: the packed CAN message data.
Block Parameters:
1. CAN channel: CAN channel selection.
2. CAN ID: The ID of the message to be received.
3. Extended: Message type to be received. If checked: extended frame. Otherwise,
standard frame.
4. Data Length: The data length of the to-be-received message.
5. Sample Time: Define the task scheduling time of this block being triggered.
Block Outputs:
1. Message Available: Flag for message availability, 1 stands for message valid and
available.
2. Remote: Flag for frame type, 1 stands for remote frame. 0 stands for data frame.
3. Extended: Flag for frame type, 1 stands for extended frame. 0 stands for standard
frame.
4. ID: Message ID.
5. Length: Message data length.
6. Data: Message data.
Block Parameters:
1. CAN Channel: Channel selection
2. Sample Time: Define the task scheduling time of this block being triggered.
Block Inputs:
1. Remote: Flag for frame type, 1 stands for remote frame. 0 stands for data frame.
2. Extended: Flag for frame type, 1 stands for extended frame. 0 stands for standard
frame.
3. ID: Message ID.
4. Length: Message data length.
5. Data: Message data.
The SCI mode includes SCI_RxData and SCI_TxData. Currently, only SCI_A channel is
supported.
SCI Definition
Block Parameters:
1. SCI Channel: Communication channel selection.
2. SCI_Enable: Enable selected channel.
3. SCI Baudrate: Channel baudrate setup.
4. SCI Parity Mode: Parity check mode setup.
This block enables the VCU to read data from specific SCI port.
Block Parameter:
SCI_Channel: SCI communication channel selection.
Block Outputs:
1. f() : Flag for receiving data. If data received, the flag will be 1. This signal could
Block Parameter:
SCI_Channel: SCI channel selection.
Block Input:
Data: The 8-bit data to be sent out.
This block set is used for measuring digital input/output. Including Switch Input, Switch
Switch Input
This block reads the physical voltage level of digital input channels and output Boolean
Block Parameters:
KeyOn Input
KeyON signal is recommended to be used for power up and shutting down the VCU.
For different VCUs, KeyOn signal inputs are different (refer to the VCU datasheet to
confirm the KeyOn signal input type) - if KeyOn signal is digital input, leave the
configuration as default; If KeyOn signal is read through analog input channel, user will
have to configure factor according to voltage divider parameter - for this parameter,
please refer to VCU datasheet.
Block Parameters
‘0’.
threshold.
Switch Output
Block Parameters
IPM Read
This block measure the frequency of input PWM signal and returns the PWM signal
period.
Block Parameters
PWM Definition
This block enables channels for PWM output, initializes the PWM output parameters for
corresponding channels.
Channels with PWM output capability (H-bridge, LSO, HSO) could be found in the pinout
table of VCU datasheet.
Block Parameters:
channel
Recommended frequency
Hz.
Definition.
corresponding to 0-100%.
PWM Output
Block Parameters:
is 15 – 2000 Hz.
freq (input) Numeric
For the input value unit,
Range Definition.
corresponds to 0-100%.
WakeUp Input
Block Parameters
H-bridge Definition
Block Parameters
Copyright ECOTRONS LLC www.ecotrons.com Page 58
EcoCoder Manual V4.8.2
more information)
2000000 Hz.
is 15 – 2000 Hz.
H-bridge Initial Frequency Numeric (Hz)
Input value unit is
block.
0-10000 corresponds to 0-
H-bridge Initial Duty Cycle Numeric
100%.
H-bridge Output
Block Parameters
B;
curA2B (input) Numeric (bool)
‘0’ : currents flows from B
to A.
2000000 Hz.
is 15 – 2000 Hz.
block.
0-10000 corresponds to 0-
duty (input) Numeric
100%.
This block defines the frequency range and accuracy of PWM IOs. If it is not
implemented in the model, the accuracy will be default value, 1 Hz.
Block Parameters:
1. Frequency Range: Frequency range selection, changes in this option will alter the
frequency range and accuracy of all the frequency related block in the model.
2. Frequency Accuracy: Accuracy adjustment. Value in the box means the unit
frequency for outputs/inputs of frequency related blocks. For example, if the
Frequency Accuracy is 0.01 Hz, it means that when frequency related block
outputs/inputs value is 5, the actual physical frequency value is 5x0.01Hz = 0.05
Hz.
IPWM Read
Block Parameter:
Select IPWM Channel: PWM inputs channel selection
Block Outputs:
1. freq: the input PWM frequency of the signal
2. duty: the input PWM signal duty cycle
Task Trigger
Definition / initialization blocks need to be executed when the VCU power on, for
All other blocks/subsystems should be triggered by this block, for task prioritization and
scheduling.
Block Parameters
If two tasks are assigned to the same task type, then the user needs to specify priority of
the two tasks to determine execution order. Please refer to the example in the following
priority.html
Non-Volatile Memory (NVM) could be used to store critical data that is supposed not to
be lost, or altered during VCUs’ service life, such as vehicle odometer values. NVM
variables are stored in specified memory blocks and will be loaded to RAM when VCUs
start running, and written back to memory blocks during VCUs power-off process.
For more information, please refer to Chapter 6 for VCU memory management. Chapter
6, combined with Appendix A, will give user preliminary knowledge of implementing NVM
on Ecotrons VCU.
This Fixed NVM Definition block will only be executed once, during the first power-up
process of VCU application software, every time after the .mot file being flashed into
VCU.
Block Parameters
The .m file needs to be added under MATLAB path. The ‘init’ in the .m file is the flag
init = 1: The corresponding NVM variable value(s) will be loaded from .mot file during
the first time of VCU starting process, every time after .mot file being flashed into VCU.
init = 0: The corresponding NVM variable value(s) will be loaded from original VCU
NVM memory block during the first time of VCU starting process every time after .mot
If the VCU that you are operating is a brand new VCU and will be flashed for the very
first time, no matter what the ‘init’ value is, the NVM variables will be initialized
Description:
Block Parameters
Block Output:
The value of corresponding variables.
Block Parameters:
NVM Definition
This block is used to initialize NVM variables and specify the NVM variable initialization
method after every time the VCU being programmed by .mot file.
Block Parameters:
in .mot:
Block Parameters:
User-defined variable
Description Alpha-numeric text
description
Read NVM
Block Parameters:
Block Output:
The NVM variable value
Write NVM
This module is used for writing regular NVM variables into RAM. To save changed variables
into VCU flash between power cycles, user need to use another block ‘Store All NVM Data’.
Block Parameters:
If checked:
When this module is triggered, all NVM variable data will be written from RAM to flash,
It is recommended to call this block before VCU power-off. And please to not call this block
too frequently. For example, if a 5ms task is assigned to this block, flash would quickly
burn out because flash memory blocks have life span, and frequent programming/erasing
Block Parameters:
The module reads NVM data from ROM (flash) back to RAM.
It is recommended to call this block when VCU powers on. This block could be triggered
by ‘Task_ini’.
Block Parameter:
This block can realize the hardware diagnosis of supported LSO, HSO and H-bridge.
Please refer to VCU datasheet for the channels that support diagnostic functions.
Block Parameters:
Block Output:
DTC Parser
Block Parameters:
Block Input:
DTC: The diagnostic trouble code.
Block Output:
bool: If the output value is one, the specific fault selected in the Block Parameter
happened; If output value is 0, the fault did not happen.
Block Parameters:
This block can clear the H-bridge channel faults, the trigger type to trigger this block is
rising edge.
Block Parameters:
Calibration Definition
Block Parameters:
Read Calibration
Block Output:
Calibration variable value.
Write Measurement
Block Parameters:
variable
unit
Block Input:
To-be-measured variable.
variable
unit
Block Input:
To-be-measured variable.
Block Output:
Same as input. (This block is used for variable measurements, does not change variable
values).
Override Probe
Block Parameters:
1. Base Variable Name:user-defined name of the overriding variable.
2. Override Calibration Initial Value:initial value of the calibration variable.
3. Override Enable Initial Value:initial value of control signal.
4. Data Type: data type of calibration variable.
5. Unit: user-defined measurement variable unit
6. Description: the description of the variable.
Block Input:
Variable to be overridden.
Output:
If control signal is 1, the output of the block would be the overriding calibration variable
value;
If the control signal is 0, the output of the block would be the same as the block input. (No
overriding)
This block defines 1-D look-up table. 1-D look-up table supports online calibration.
Block Parameters
Description:
This block defines 2-D look-up table, 2-D look-up table supports online calibration.
Block Parameters:
Breakpoints 1
Numeric (Matrix) Breakpoints 1 variable data
data(Row)
Breakpoints 2
Numeric (Matrix) Breakpoints 2 variable data
data(Column)
This module is used for checking the calibration data at VCU power-on. If there is any
corrupted calibration data, the controller software will enter an infinite loop to avoid
potential catastrophic results due to corrupted calibration data.
Block Parameters:
Enable Calibration Data Check: If checked: enable the function.
Output:
f() : Flag for checking calibration data. If there is a problem with the calibration
data, the flag will be set to 1. This signal could be used as a trigger signal.
This block integrates power-off logic control and oeprations. It could be regarded as a
reference/demo design of VCU power-off logic. Users are encouraged to understand the
block first by looking down mask and then make necessary modification to the block for
customized implementations.
Block Parameters
Key Cycle Reset Enable Numeric (Boolean) key switch turns back on before
Key Off Threshold Volt(V) Numeric than this value, KeyOn signal is
interpreted as ‘0’.
process fails.
Shutdown Power
Block Parameters
Block Parameters
The block specifies the CAN channel that wakes up the VCU.
Block Parameters
VCU.
Watchdog Definition
Block Parameters
Software Reset
This block is used for triggering VCU software reset. If this block is called, the VCU software
Block Parameters
By calling the block, VCU main controller 32-bit free-running counter value will be read.
The value could be used to calculate time interval between certain events or to generate
random numbers, etc.
Block Output:
System free counter value.
Block Parameters
corresponding channel.
input Boolean
0: turning off power for
corresponding channel.
4.11 CCP
This block is used for setting up CCP related slave station definitions
Block Parameters
Simple:
CCP Type Drop-down list file. To use EcoCAL, both A2L and CAL
Configurable:
Data Acquisition (DAQ) PID Numeric The first PID in the DAQ list.
This block is used for the online programming parameter definition. Note that this block
can only work with some specific VCU models. If the VCU that the user is working on does
not support this function, there will be a pop-up notice when using this block.
Users can use more than 1 of this block in their Simulink model to make multiple CAN
channels support online programming function.
Block Parameters:
The module reads the Hex values of the angular acceleration of the three axes of the
gyroscope and outputs the raw data in uint16.
Raw data need to be multiplied by a slope of 0.05 and an accounted for an offset of -
819.15 to give the acceleration physical value in deg / sec.
The module reads the angular acceleration of the three axes of the gyroscope and the
output is physical value in deg / sec, data type is single.
Read OTP
Block Parameters:
Block Outputs:
data: The data read from OTP area.
st: Data reading status, 0 stands for data reading successfully.
Block Parameters:
Block Input:
Offset (byte): the start position offset.
Block Output:
data: The data that has been read from OTP area.
st: Data reading status, 0 stands for data reading successfully.
Write OTP
Block Parameters:
Block Parameters:
Block Input:
Data input
data
unsuccessful.
Block Parameters
Block Output:
Data output
Data
This block is the same as the “Read Data by Address” block, except for the method of
specifying the address is changed. For this block, the address is specified by block input
signal.
Block Parameters
Block Output:
Data output
data
Block Parameters
5.1 Introduction
Controller Area Network (CAN) nowadays is very widely used on the vehicle control system.
Ecotrons VCUs provide multiple CAN channels (3-5 channels, depending on the specific
VCU model) and enables the VCUs to communicate with multiple electronic control units
on the vehicle.
To use Ecotrons VCUs, the user need to convert DBC file into .m file and then use the .m
file to define and initialize the CAN communications. The process is intuitive, user-
friendly, and could give users more flexibility for CAN communication implementation.
User can convert DBC to .m file automatically using the software EcoCAN that could be
found in EcoCAL. If you want to know more about EcoCAL, please refer to the manual
EcoCAL manual for EV .
Process:
1. Open the DBC file to be converted in EcoCAN.
2. After DBC file being loaded, the following window will pop-up.
3. Click the indicated button and export the DBC file to m file, the user could specify
the saving path.
Please select ‘Read CAN Message’ or ‘Send CAN Message’ if fixed-point tool has not
been installed in Matlab.
Select m file
This m file could help parse out signals in messages. Users need to save the .m file under
Matlab path.
Select Message
This step will let users pick the specific CAN messages that need to be parsed.
Task_Inherit:
If ‘Task_Inherit’ is selected, the block will be executed every time when the subsystem
that includes this block is executed.
Task_ini:
The block will only be executed during the initialization process when VCU is powered
on.
Task_MDef:
The sample time will be decided according to the interval value in the .m file that is
shown below. (This value comes from DBC file, and is editable).
6.1 Introduction
When application software gets more complicated and larger, memory management will
become an important aspect of VCU software development.
Ecotrons VCU includes two types of storage device, Flash and RAM.
Flash is the memory which stores basic software, application software, constant,
calibration and NVM variable data, the data in Flash will not be lost after powering off the
VCU. Contents in Flash would be copied to RAM during VCU power-up process. NVM
variable data is recommended to be saved to Flash before VCU power off. Calibration
could be implemented ‘on the fly’, and calibration variable data could be burned back to
Flash manually through EcoCAL, the calibration software developed by Ecotrons.
RAM (Random Access Memory) directly works with CPU by storing software needed data
and code during VCU runtime. Different from Flash, the data in RAM would be lost when
VCU powers down.
Calibration/Measurement Variable
Please refer to section 4.9.1 to 4.9.4 for definition, initialization, reading and writing
calibration and measurement variables.
The only special part is writing of calibration variable. It is achieved through EcoCAL ‘burn
to’ function. EcoCAL is an advanced calibration tool developed by Ecotrons. ‘Save’ option
could save calibration data to RAM, while ‘Burn to’ option could write calibration data to
VCU flash. ‘Fetch from VCU’ could help extract existing calibration data in VCU flash.
Non-Volatile Variable
There are two types of NVM variables, Fixed NVM variables and NVM variables, for
different application purposes. Ecotrons Non-Volatile memory theory is described in
Appendix A.
EcoFlash is a user-friendly GUI for programming VCU. Please refer to EcoFlash manual for
operation of the software. The below picture provides a quick glance of EcoFlash.
2. Choose MATLAB version, and select ‘Uninstall EcoCoder from selected MATLAB
For EcoCoder update, the user will need to uninstall older version EcoCoder from
Note: You have to close all open MATLAB applications before uninstalling.
1. Click ‘Start’ and then click ‘settings’, follow steps in picture below
Chapter 10 FAQs
A1. The name of the m file must match to the C Language variable naming requirement.
1. Check if your MATLAB has Fixed-Point Tool license. If not, the use of fixed-point
‘ECU_Setting’ module is divided into independent configuration blocks. Please add CAN,
If CAN library blocks used in the model are disabled, you need to firstly resolve all blocks
and save the model before installing new EcoCoder, otherwise the original model will be
Yes. Please go through these steps, Configuration Parameters -> Code Generation ->
EcoCoder Debug Options -> Compiled Action. Then you could configure.
Compiled Action includes: No Prompt, OpenTarget, PopupBox.
No Prompt: There is no any prompt when it finishes generating file.
PopupBox: ‘Software has been compiled successfully!’ will pop up when it finishes generating files.
Non-volatile Variables
The NVM variables are stored in flash, which can maintain information even the VCU is
powered off (unlike RAM, which would lose data after the VCU power off). Furthermore,
the NVM variables will be kept the same even the VCU is programmed (unless it is required
to be changed by user configuration), so critical data such as odometer data will not be
lost even the VCU software update is performed.
NVM data values are read from flash and written into RAM when VCU is powered on. The
RAM variables could be read/written as many times as needed since RAM has high
Program/Erase cycle. When key off signal is detected, power off logic would trigger the
process of storing NVM variables from RAM to flash. An example power down block, which
includes this NVM variable storage logic, Power Management Example, is provided in
EcoCoder library.
Note: The power input to VCU BATT is required to be uninterrupted to make sure the
process of storing of NVM variables value is safe. If power is lost unexpectedly while
application is running, the value of the NVM variables on the next key-on will be the same
value as what had been saved into flash during the last controlled shutdown. If power is
lost unexpectedly during the controlled shutdown procedure (when the process of saving
NVM variables into flash is supposed to be happening), all NVM variables will revert to
their default values (defined in the application software).
The fixed NVM variables are stored in specific space of flash and arranged in the order
defined by definition block, which means specific addresses in flash are reserved for
specific variables.
Copyright ECOTRONS LLC www.ecotrons.com Page 124
EcoCoder Manual V4.8.2
Battery Input
As mentioned previously, power supply has to be maintained at least for a short period
after key-off, in order for the VCU to execute the shutdown process.
The shutdown process implemented by block ‘Power Management Example’ includes
stopping the application and saving NVM variables that have been temporarily stored in
RAM to flash, during the power-off delay, after key-off. This is the recommended way to
save nonvolatile variables to flash. If the frequency of calling ‘Store All NVM Data’ block is
too high, errors might occur.