Function Calls EcuM
Function Calls EcuM
A. STARTUP PHASE
1. void EcuM_Init (void): Initializes the ECU state manager and carries out the
startup procedure. The function will never return (it calls StartOS)
Port Driver
Watchdog Driver Internal watchdogs only, external ones may need SPI
Watchdog Manager
ADC Driver
ICU Driver
PWM Driver
OCU Driver
void EcuM_ErrorHook (uint16 reason): The ECU State Manager will call
the error hook if fatal errors occur. In this situation it is not possible to
continue processing and the ECU must be stopped. The integrator may
choose the modality how the ECU is stopped, i.e. reset, halt, restart, safe
state etc.
B. RUN
D. SLEEP PHASE
EcuMValidationTimeout : The validation timeout (period for which the ECU State
Manager will wait for the validation of a wakeup event) can be defined for each wakeup
source independently. The timeout is specified in seconds. When the timeout is not
instantiated, there is no validation routine and the ECU Manager shall not validate the
wakeup source
F. SHUTDOWN PHASE
4. void EcuM_AL_SwitchOff (void): This callout shall take the code for
shutting off the power supply of the ECU. If the ECU cannot unpower itself, a
reset may be an adequate reaction. The ECU Manager module invokes
EcuM_AL_SwitchOff as the last activity in the OffPostOS Sequence. In some
cases of HW/SW concurrency, it may happen that during the power down in
EcuM_AL_SwitchOff (endless loop) some hardware (e.g. a CAN transceiver)
switches on the ECU again. In this case the ECU may be in a deadlock until the
hardware watchdog resets the ECU. To reduce the time until the hardware
watchdog fixes this deadlock, the integrator code in EcuM_AL_SwitchOff as last
action can limit the endless loop and after a sufficient long time reset the ECU
using Mcu_PerformReset().
7. Std_ReturnType EcuM_SelectShutdownTarget
(EcuM_ShutdownTargetType shutdownTarget, EcuM_ShutdownModeType
shutdownMode): EcuM_SelectShutdownTarget selects the shutdown target
and is part of the ECU Manager Module port interface. The parameter mode of
the function EcuM_SelectShutdownTarget shall be the identifier of a sleep or
reset mode. The mode parameter shall only be used if the target parameter
equals ECUM_SHUTDOWN_TARGET_SLEEP or
ECUM_SHUTDOWN_TARGET_RESET. In all other cases, it shall be ignored. Only
sleep or reset modes that are defined at configuration time and are stored in
the EcuMCommonConfiguration container are allowed as parameter. The ECU
Manager module does not define any mechanism to resolve conflicts arising
from requests from different sources. The shutdown target is always the last
value set.
Std_ReturnType
8. Std_ReturnType EcuM_GetShutdownTarget
(EcuM_ShutdownTargetType* shutdownTarget, EcuM_ShutdownModeType*
shutdownMode): EcuM_GetShutdownTarget returns the currently selected
shutdown target as set by EcuM_SelectShutdownTarget.
EcuM_GetShutdownTarget is part of the ECU Manager Module port interface.
Std_ReturnType
E_NOT_OK: The service has failed, e.g. due to NULL pointer being passed
9. Std_ReturnType EcuM_GetLastShutdownTarget
(EcuM_ShutdownTargetType* shutdownTarget, EcuM_ShutdownModeType*
shutdownMode): EcuM_GetLastShutdownTarget returns the shutdown target
of the previous shutdown process. EcuM_GetLastShutdownTarget is part of
the ECU Manager Module port interface. EcuM_GetLastShutdownTarget shall
return the ECU state from which the last wakeup or power up occurred in the
shutdownTarget parameter. EcuM_GetLastShutdownTarget shall always return
the same value until the next shutdown. The EcuM_GetLastShutdownTarget
function is intended primarily for use in the ECU STARTUP or RUN states. To
simplify implementation, it is acceptable if the value is set in late shutdown
phase for use during the next startup.