Memory Stack Overview

Micael Coutinho,autosarbswmem

The ability to read and write data persistently over multiple driving cycles is crucial for ECU functions. Learn how the Autosar memory stack works here

During the lifecycle of a vehicle, there are many variables that need to be written and read persistently. This ranges from calibrating a new sensor or actuator after replacing a defective one, storing and reading out error memory every time a vehicle is serviced, among other things. We already explored one way to change parameters in runtime, through calibration (you can read about this process here, in our article Calibration Overview (opens in a new tab)), but this is only available during development, and it requires you to re-Flash your ECU for the parameter set to persist, which is not an option all the time.

So, one might be wondering, can we not use non-volatile RAM to achieve this? And the answer is a resounding yes. The question is, with all the protection mechanisms present in the OS, and the indirection Autosar allows, how do we use the NVRAM properly within the layered architecture? This is a precious resource that needs special care, as, for example, there is a very limited number of writing cycles, in comparison with other types of memory, and there is the need to verify this data is valid, with checksums, for instance. Of course, this is just not limited to RAM. One might also want to write to Flash memory in runtime, without the possibility to re-Flash your ECU. The same problem arises, we need a mechanism to do this the "Autosar" way, with levels of abstraction that make these functionalities seamless at the application layer.

Now that we know the reason why one needs the memory stack, it's time to check its main components:

Modules involved in the Autosar memory stack { w: 393, h: 660 }

Modules involved in the Autosar memory stack

In the picture, you can see all the modules involved in the memory mapping, from the place where you decide to use non-volatile memory in a Software Component to how it maps to the EEPROM and Flash memories within your ECU. Lucklily, the memory stack is a bit less complicated than the communication stack (which we covered on the article Communication Stack Overview (opens in a new tab), if you want to take a look), but it's still present in all Autosar-based ECU's, even if your application layer does not require them. Let's go through all the modules, one by one, to make this statement clear:

After this overview of the memory stack, we hope it helped you understand the modules involved. In the near future, we'll look at them in greater detail, specially the NvM, which is the module you are most likely to deal with directly, as the other modules are usually automatically configured by your Autosar tooling provider.

Author: Micael Coutinho (opens in a new tab)

References:

© AutosarToday —@LinkedIn