RTA Knowledge Base

Table of Content

Introduction

Scope

This Application Note describes how to add a PIM to an existing RTA-CAR project, and consequently how to configure the Memory Stack.

Definitions and Abbreviations

BSW: AUTOSAR Basic Software, Hardware independent service layer

RTE: AUTOSAR Real Time Environment

OS: AUTOSAR Operating System

SWC: Software Component

Toolchain

It is assumed you are using the RTA-CAR 7.0.1 toolchain:

RTA-CAR 7.0.1 toolchain

ISOLAR-ABv 7.0.1
RTA-RTEv 7.1
RTA-BSW5.1
RTA-OSv 6.0.0

Prerequisites

In order to successfully follow this guide, you must have the RTA-CAR toolchain installed and you must be familiar with the AUTOSAR specifications, terminology and methodology.

It is recommended that Memory Stack configuration is added to an existing project, with Application Software, Basic Software and System Configuration.

Workflow

ASW Configuration and PIM creation

The first step is to create a new SWC or to configure your existing SWC and add the memory configuration to it.

In order to add a PIM  (Per Instance Memory) configuration to your SWC, from the Component Editor switch to Tab "Others" and select the sub-tab "PerInstanceMemory". Press the button Create PerInstanceMemory; a new element will be added to the table below, edit the ShortName and set the initial value (InitValue column), type and type definition. The final result of the two PIMs created is shown below:


For each PIM, a new software data definition proposal must be created. To do that right click on the PIM and select New Child --> Sw Data Def Props | Sw Data Def Props Conditional

Open the created element and set the BaseType parameter to the desired Type.

Repeat these steps for all the required PIMs.

Create NvM Service Needs

Open the SWC containing the PIMs with the service needs Editor; to do that right click on the SWC and select Open with --> Service Needs Editor.


Switch to Tab NvM Service Needs and select Add NvM Service Needs; the table below will be filled with a new element named "SrvNvM0"; edit the name and the service needs attributes, below is an example of how to configure the attributes to have a PIM that is read at each startup and written at each shutdown.


Finally connect the PIM the the Service needs created by adding a data Assignment; press on Add Data Assignment; in the pop-up window "Add Data Assignment" switch to tab Used PIM and select the desired PIM; then press OK:


Do the same steps for all the PIMs; the final result should be as shown here:



Integration with the MCAL

If you are using the virtual target MCAL provided by ISOLAR-EVE, you will need to import the following files for the MCAL generation:

  • Fls_BSWMD.arxml 

  • Fls_BSWMD_EcucValues.arxml

These files are provided along with the VRTA (Virtual) RTA Starter Kit. For other hardware, the MCAL configuration will vary - a range of RTA Starter Kits are available. For more information on the available Starter Kits, contact ETAS.

Configuration Generation

The Basic Software configuration can now be updated given the changes to the System.

Press the RTA-BSW Configuration Generation button or from the Menu bar select RTA-BSW --> Automatically configure BSW from System Description. This step will update the "Config" directory inside the Project folder with the automatically generated arxml files related to the BSW modules. As a result expanding the Bsw Modules within the "ECU Navigator" menu you can see how a Memory stack has been created with the modules: NvM, MemIf and Fee.

Fls module creation

Create the module "Fls" to have all the reference needed for the MCAL. To create an "Fls" module right click on "Bsw Modules" from the "ECU Navigator" menu and select Create Memory Stack --> Create Fls. If you are using the virtual target based on EVE MCAL, you can import the Fls EcuC Values provided along with the VRTA RTA Starter Kit.


Update Mode Management

In order to have PIMs correctly saved and restored during startup/shutdown, you need to update the Mode Management configuration. To do so, you need to update the BswM and the EcuM in order to:

  • Initialize the Memory Stack (NvM, MemIf, Fee, Fls)
  • Configure the actions to complete the NvM ReadAll during startup and the NvM WriteAll during Shutdown.

The Mode Management configuration is outside of the scope of this Application Note.

Code generation

Now you need to generate the BSW code; in this way the BSWMD files will be generated and the NvM module will be recognized and available to be added to the composition. Ensure that the RTA-MEM stack is selected for the generation, and then launch the RTA-BSW Code Generation.

After this step, the BSW code will be generated as well as the NVM Service component.

Add the NvM Service component to your composition

Now that the Service SWC for NVM has been created, you can add it to your composition. To do so, right click on your composition and open it with the Composition Editor.

Then select at the top of the window the Component Prototype.

Then a pop-up will appear and it will allow the selection of the NVM Service component in order to add it to the composition.

Create connections between SWC and NvM Service component

In order to have your SWC able to access to the NVM services, you need to connect it with the NVM Service component generated by RTA-BSW.

To do so, add add require port to the SWC. In the pop-up window select ClientServerInterface --> NvMService. Reopen the SWC with the component editor to add the Server Call Points; switch to "Functions" Tab, on the right switch to sub-tab "Server Call Points" and press the Server Call Points... button. In the pop-up window select "SynchronousServerCallPoint" and then select the CS interface previously created for your PIM.

Now that the the NvM has been added to the ECU configuration, you must connect its ports to the SWC created previously. To do that open again the Composition Editor and switch to tab "Manual Connection Editor". On the left select the NvM module and select the port "NvMNativeBlockX"; it must be connected to the SWC so on the right choose the memory SWC and select the corresponding port. Repeat this for all Nvm Blocks. Note that the name of the Port NvMNativeBlock may change if you have multiple NvM blocks configured in your Memory Stack.

Update ECU Extract

Update the ECU Extract since a new module has been added. Right click on the System and select Create ECU Extract as done before.

Map the SWC runnables on Os Tasks

Open the existing EcuC value collection and switch to the "Entity to Task Mapping" Tab and drag each Runnable to it's respective OsTask (SWC runnables, MemIf Main function runnable, NvM Main function runnable and Fls Main function runnable).

RTE generation

You can now generate the RTE code. To do this, use the RTA-RTE plug-in, press the RTE button in the menu bar and select RTE Generate Phase Wizard from the drop down menu.

MCAL update

Remember to update the MCAL. This step is target dependent; when using the ETAS Virtual Target (VRTA), the MCAL is regenerated using the mcalgen.exe tool.

ASW Update

Now you can update the code for your ASW in order to use the PIM. In the ASW, you can use the services provided by the BSW (for example mark the block to be written during shutdown). You can find an example of ASW implementation in the VRTA RTA Starter Kit.