Professional Documents
Culture Documents
Autosar Memory Stack (Memstack)
Autosar Memory Stack (Memstack)
Introduction to MemStack
3
Introduction
MemStack Architecture
7
NvM overview:
NvM Manager manages all data requests to the EEPROM/Flash used as
non-volatile memory
• NvM offers the following features:
- Each block can be synchronized with a permanent RAM
area
- The block consistency can be guaranteed by CRC16 or
CRC32
- The blocks can be single (no redundancy), redundant (block
duplicated) or Dataset
(n different values of the same block with no redundancy).
- Priorization scheme: a priority can be assigned to each block
- Protection scheme: some blocks can be Write-protected or
Write-once
- Immediate protects important data
9
Bank
3 Bank 3 – End Address
Bank Footer Bank End
Address
15
• Bank counter -> Used to identify the newest and the oldest banks
• FEE10xx -> Marker (with version xx) for bank recognition
Bank Footer
• Invalidate field -> Banks marked before erase
• Last Block Address -> Speed up initialization of full banks
16
Bank Header
Blocks are recognized thanks to their footer:
Block A
Id ➔ Fee Block Id
Size ➔ NvM data length (Appli data + CRC)
Block B
Invalidate ➔ Flag indicating if the block is valid
Block C
46 ➔ Fixed marker used to search block footer
DataStorage
Area
Switched ➔ Flag indicating if the block instance is switched
Bank Footer
Each block is chained to the previous one:
Offset ➔ Address offset to previous block
Fee Footer
NvM Data
Offset Id Size Invalidate 46 Checksum Switched
17
APIs
18
• Synchronous APIs
-These requests are processed immediately
-They return a status reflecting the completion of the requested action (success/failure)
• Asynchronous APIs
-Requests that need a long processing time
-These requests are queued and are processed in “background”
-The API returns a status that indicate if the operation was accepted (queued) or rejected
-If the operation is accepted, the application is informed of the result through
19
- NvM_SetDataIndex - NvM_ReadBlock
-NvM_GetDataIndex -NvM_WriteBlock
-NvM_SetBlockProtection
-NvM_GetErrorStatus -NvM_RestoreBlockDefaults
-NvM_GetVersionInfo
-NvM_SetRamBlockStatus -NvM_EraseNvBlock
-NvM_CancelWriteAll
The useful ones:
-NvM_InvalidateNvBlock
- NvM_SetDataIndex -NvM_ReadAll
- NvM_GetErrorStatus
- NvM_SetRamBlockStatus -NvM_WriteAll
- NvM_ReadBlock
- NvM_WriteBlock
- NvM_InvaliddateNvBlock
20
Thank you ☺