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 8.0.1 toolchain:

RTA-CAR 8.0.1 toolchain

ISOLAR-ABv 8.0.1
RTA-RTEv 7.3.0
RTA-BSWv 6.0.0
RTA-OSv 6.1.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

Double click a SWC in either the AR Explorer or ECU Navigator to open the SWC configuration.

In order to add a PIM  (Per Instance Memory) configuration to your SWC, from the Component Editor switch to Tab "Others".

Next, switch to the sub-tab of "PerInstanceMemory" and press the Create PerInstanceMemory button.


 A new element will be added to the table. 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 by double clicking it 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 in the AR Explorer 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, making sure to select the correct Service Dependency when adding the Data Assignments. The final result should be as shown here:

PIMs Configuration


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 (RTA-SK_VRTA_8.0.1\RTA-SK\ecu_config\bsw\integrationCfg):

  • 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 Generated ECU Configuration arrow button (see below) to initialise the ECU Configuration Wizard. 

Ensure that the path is pointing to the existing Project_EcucValues.arxml or the existing ConfGen folder if the Generate separate file for each Module option was selected from Browse, so that values are not duplicated and click Finish. 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 (Fls_EcucValues.arxml) provided along with the VRTA RTA Starter Kit in RTA-SK_VRTA_8.0.1\RTA-SK\ecu_config\bsw\ecucValues.


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 from the AR Explorer 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. Click OK.

Once you have created the Component Prototype you might find that your Component is not being displayed, when it indicates that there is a Component Prototype present. 

Click on the filter icon and check the box to show the NvM Component Prototype Connections.

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, in AR Explorer right click on the SWC (MyReceivingSWC in this example) > Open With > Service Needs.

Click on Add Service Ports in the Service Needs Editor of the SWC. In the pop-up window select New AR service interfaces and then check Autosar Service Interfaces > NvMService > OK.

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 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 RTA Code Generator button in the menu bar and select Generate RTA-RTE 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.