Professional Documents
Culture Documents
Presented by:
SHANKU KAK
Crevavi Technologies Pvt. Ltd.
EcuM Overview
• The ECU Manager module is a basic software module that
manages common aspects of ECU states.
• ECU initialization in AUTOSAR application is handled by the
EcuM module of BSW. After the initialization sequence in
boot-loader and C Init Code has been completed, the first
API to be called from the “main()” is EcuM_Init().
• ECU Manager(EcuM) module
1. Initializes and de-initializes the OS and RTE, the SchM and
the BswM, as well as some basic software driver modules.
2. Configures the ECU for SLEEP and SHUTDOWN when
requested.
3. Manages all wakeup events on the ECU
OFF
Power ON
Wa
STARTUP k
pow eup w
er c ith i
ont n
rol tegrat
ed
Normal
Startup
Reset Other
RUN WAKEUP
keup
Wa nt
All Applications Eve II Wakeup
have Shutdown / TT
e? Event
tru
p ==
e
Sle
SHUTDOWN Other
SLEEP
Power OFF
OFF
POWER ON
WAKEUP WITH POWER
CONTROL
STARTUP I
WAKEUP I
STARTUP II
WAKEUP
VALIDATION
WAKEUP RUN II
REACTION No RUN RUN Request
RESET
VALID INVALID RUN III
WAKEUP II
WAKEUP EVENT PRE SHUTDOWN
SLEEP
HALT GO OFF I
SLEEP I
GO SLEEP GO OFF II
SLEEP II
POLLING
POWER OFF
STARTUP
The startup is divided into two parts, first part being StartPreOs
sequence and the second part being StartPostOs sequence.
ResetVector()
Reset Jump()
Setup
Stack()
EcuM_Init()
Ecum_AL_DriverInitZero()
Ecum_DeterminePbConfiguration()
Ecum_AL_DriverInitOne() StartPreOS
StartOS() sequence
StartupHook()
ActivateTask()
EcuM_StartupTwo()
Ecum_AL_DriverInitTwo()
Ecum_AL_Driver
InitThree()
SchM_Init()
StartPostOS
sequence
BswM_Init()
• The very first step once the ECU is powered up is the MCU initialization. As the microcontroller unit
receives power it jumps to the Reset vector in order to run the bootloader code. The bootloader is
where the basic controller hardware initialization takes place like memory, timers, etc. Further, all the C
code initialization takes place. A stack area is set up and all the C variables are initialized. After this a
call to EcuM_Init() API invokes the ECU State Manager and it carries on the rest of the startup
sequences.
• The following modules will usually be initialized in the BlockZero drivers callout
Det_Init() – Default Error Tracer
Det_Start()
Dem_MasterPreInit(). – Diagnostic Event Manager
• The following modules will usually be initialized in the BlockOne drivers callout
Mcu_Init()
Gpt_Init() – General Purpose Timer
Wdg_Init() – Watchdog
WdgM_Init() – Watchdog Manager
Adc_Init()
Icu_Init() – Input Capture Unit
Pwm_Init()
• The last step of the StartPreOs Sequence is always to start the OS. At this point EcuM gives up the
STARTUP ctd.
• Initializations done in BlockZero and BlockOne drivers are low
level initializations that are not dependent on the OS.
• AUTOSAR provides callouts for the initialization of interrupts,
BlockZero and BlockOne drivers. These callouts are part of the
initialization sequence by default, but the actual
implementation inside these callouts are target dependent.
AUTOSAR and the tool chain vendors provide
recommendations only. What exactly is done in these callouts,
is upto the system designers discretion.
• There are two variants of the EcuM module, flex and fixed.
Flex is the more advanced of the two. It supports multi-core
ECUs along with partial or fast wake-up, interleaved wake-ups
of BSW, RTE, APPL and even multiple running states.
module Integration module module
EcuM Code MCU OS
Ecum_AL_DriverInitZero()
Ecum_DeterminePbConfiguration()
StartPreOS sequence
Ecum_ErrorHook()
Ecum_AL_DriverInitOne()
Mcu_GetResetReason()
EcuM_SelectShutdownTarget()
Ecum_LoopDetection()
StartOS()
STARTUP II
After the OS has started, EcuM_StartupTwo() is called from
an Init_OsTask and it hands over the control back to the
EcuM module. Then the StartPostOs Sequence starts and
following steps are handled by EcuM_StartupTwo().
• SchM_Init() — BSW scheduler is initialized
• BswM_Init() — BSW Mode Manager is initialized
• BSW is notified about the wake-up events raised
received during the startup.
In case of multi-core ECU, SchM_Init() and BswM_Init() on
the master core is called first followed by the same steps in
the slave core. After the BswM has been initialized, RTE is
started and then the rest of the initialization continues.
Startup Two Initializations
• Initialization of BlockTwo drivers [EcuM_AL_DriverInitTwo()]. The
following modules will usually be initialized in the BlockTwo drivers
callout(These don’t rely on their personal NVRam data):
– EEPROM, Flash, NVRam Manager
– CAN/ LIN/ Flexray/ Ethernet Driver, Interface, State manager, TP
– DCM
– Network Manager
• GO OFF I:
– In the GO OFF I state, the ECU is preparing for shutdown and initiating the shutdown sequence.
– In this state, the EcuM module performs various operations such as stopping non-critical services, releasing
resources, and notifying other modules about the impending shutdown.
– The GO OFF I state allows time for critical tasks and services to complete before moving to the next state.
– Once the GO OFF I state is completed, the ECU transitions to the GO OFF II state.
• GO OFF II:
– In the GO OFF II state, the ECU is in the final stage of the shutdown process.
– This state involves the deinitiation of critical services and the final release of resources.
– The EcuM module ensures that all critical operations are stopped, and the ECU is in a safe state for
complete shutdown. Once the GO OFF II state is completed, the EcuM transitions the ECU to the
SHUTDOWN target state (RESET OR OFF).