0% found this document useful (0 votes)
223 views30 pages

01 - AUTOSAR Memory Stack

Autosar Memory Stack

Uploaded by

kasyapacom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
223 views30 pages

01 - AUTOSAR Memory Stack

Autosar Memory Stack

Uploaded by

kasyapacom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Automotive Industry

AUTOSAR Memory Stack

This material is developed by IMTSchool for educational use only


All copyrights are
reserved
Agenda

●● AUTOSAR Intro stack


Need of memory
●● Overview of Software Layers/Stacks
Memory types
●● BSW Architecture
Memory stack main functionalities
●● BSW Integration
Structure of memory stack
● Memory stack modules roles
● Memory stack main concepts
Need of memory stack

● Memory stack provides access to Non-volatile memory

● Kinds of stored information


○ Seat Position
○ A/C Temperature
○ Radio Preferences

● Information are stored in Blocks

● A Block is an array of bytes

● Each application defines the blocks it needs


○ Length
○ Protection
Memory Types

● RAM

● ROM

● Non-Volatile Memory
○ EEPROM
○ FLASH

● Difference between EEPROM and FLASH


○ Erasing access
○ Speed
○ Cost
○ Lifetime
Memory stack main
functionalities

● Scheduling of accesses to any NV block for data saving/loading

● Access to blocks through BlockId , with optional queuing and priority management

● NV data safety through:


○ CRC checking
○ Redundancy management
○ Default data recovery

● Automatic multi-block loading/saving for ECU startup/shutdown modes


Memory stack main
functionalities

● NV Jobs priority management

● Explicit NV block invalidation services


Memory stack main
functionalities

● Write operation ● Read/Restore operation

Application update RAM Application request read/restore

Memory stack copy data from


Application request write
NV/ROM to RAM

Memory stack copy data from


Application read data from RAM
RAM to NV
Structure of memory
stack
Memory stack modules
roles

● EEP module

● It is responsible for abstraction of MC registers used to control on-chip EEPROM


peripheral

● It provides services for reading , writing, erasing to/from EEPROM

● It also provides a service for comparing data

● The EEPROM driver shall not buffer data


Memory stack modules
roles

● FLS module

● It is responsible for abstraction of MC registers used to control on-chip FLASH


peripheral

● It provides services for reading , writing, erasing to/from FLASH

● It also provides a service for comparing data

● The EEPROM driver shall not buffer data


Memory stack modules
roles

● EA module

● It is responsible of providing an abstraction of internal/external EEPROM devices

● It provides the upper layers with a virtual addressing scheme

● It provides “virtually” unlimited number of erase cycles


Memory stack modules
roles

● FEE module

● It is responsible of providing an abstraction of internal/external FLASH devices

● It provides the upper layers with a virtual addressing scheme

● It provides “virtually” unlimited number of erase cycles


Memory stack modules
roles

● MEMIF module

● It allows the NVRAM manager to access several memory abstraction modules ( FEE
or EA modules)
Memory stack modules
roles

● NVM module

● Scheduling of accesses to any NV block for data saving/loading

● Access to blocks through BlockId , with optional queuing and priority management

● Nv data safety through


○ CRC checking
○ Redundancy management
○ Default data recovery

● Automatic multi-block loading/saving for ECU startup/shutdown modes


● Explicit NV block invalidation services
Memory stack main
concepts

● NV blocks

○ The NV block is a basic storage object in NV memory

○ The NV block consist of


■ Optional NV block header (Static block ID)
■ Data
■ Optional CRC
Memory stack main
concepts

● Different types of NV block management

○ Native NV block
○ Redundant NV block
○ Dataset NV block

● Related configuration parameters :


○ NVM_BLOCK_MANAGEMENT_TYPE
○ NVM_NV_BLOCK_NUM
○ NVM_DATASET_SELECTION_BITS
Memory stack main
concepts

● ROM blocks

○ The ROM block is a basic storage object in ROM

○ It provides default data in case of an empty or damaged NV BLOCK

○ The ROM block consists of


■ Constant data

○ Related configuration parameters :


■ NVN_ROM_BLOCK_DATA_ADDRESS
Memory stack main
concepts

● RAM blocks

○ The RAM block is a basic storage object in RAM

○ Used to allow applications to write and read freely

○ It consists of
■ Optional NV block header (Static block ID)
■ Data
■ Optional CRC
Memory stack main
concepts
● CRC calculations

○ CRC shall be recalculated and updated in the RAM block upon each write
request from application

○ During read operation


■ CRC bytes are read from NV
■ CRC is calculated over the data read from NV
■ The read value and the calculated value are compared

○ Related configuration parameters :


■ NVM_BLOCK_USE_CRC
■ NVM_BLOCK_CRC_TYPE
■ NVM_CRC_NUM_OF_BYTES
Memory stack main
concepts

● Priority management

○ The memory stack supports a priority based job processing (in case of multiple
write/read requests from application)

○ Two queues exists in memory stack


■ one for immediate write jobs
■ another for all other jobs

○ A write with immediate priority shall preempt the running job

○ The preempted job shall be resumed/restarted by the memory stack


Memory stack main
concepts
● Polling and Callbacks

○ The memory stack can use either polling or callback to get the status of current
write/read job requested from application

○ Mixed configuration can be used along the memory stack

○ The applications also can use polling or callback

○ Related configuration parameters


■ NVM_POLLING_MODE
■ EA/FEE_POLLING_MODE
■ EEP/FLS_USE_INTERRUPTS
■ NVM_SINGLE_BLOCK_CALLBACK
Memory stack main
concepts

● Write verification

○ When a Ram block is written to NV memory the NV block shall be immediately


read back and compared with the original content in RAM block

○ Write verification shall be performed in steps so that the number of bytes read
specified by a configuration parameter
■ NVM_WRITE_VERIFICATION_DATA_SIZE

○ If write verification failed then write retires shall be performed by a


configuration parameter
■ NVM_MAX_NUM_OF_WRITE_RETRIES
Memory stack main
concepts

● Protection of NV block

○ Memory stack provides functionality of protecting the NV block from being


overwritten

○ Related configuration parameters :


■ NVM_BLOCK_WRITE_PROT
■ NVM_WRITE_BLOCK_ONCE

○ Application could use “Nvm_SetBlockProtection” API to activate/deactivate


block protection during runtime
Memory stack main
concepts

● Write all blocks / Read all blocks

○ Nvm_WriteAll() writes data to all NV blocks witty attributes


■ Block is selected for WriteAll (by configuration)
■ Block has a permanent RAM block

○ Nvm_ReadAll() reads data from al NV Blocks with attributes


■ Block is selected for ReadAll (by configuration)
■ Block has a permanent RAM block

○ Nvm_WriteAll() and Nvm_ReadAll() are called in shutdown and startup


respectively
Memory stack main
concepts

● Write operation

○ Test block protection

○ Calculate CRC (if configured)

○ Copy data from RAM to NV


Memory stack main
concepts

● Write sequence diagram - Callbacks


Memory stack main
concepts

● Read operation

○ Copy from NV to RAM

○ CRC calculation and comparison


■ Match
■ Mismatch

○ Reading redundant blocks

○ Loading default values


Memory stack main
concepts

● Read sequence diagram - Callbacks

You might also like