RTA Knowledge Base

Table of Content

Introduction

Scope

This application note describes how to start from the System Description and configure a single ECU in your project.

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

RTA-CAR 6.0.1 toolchain

ISOLAR-AB6.0.1
RTA-RTE6.8
RTA-BSW5.0
RTA-OS5.6.4

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.

Moreover, you need to have your ASW already created and configured inside the RTA-CAR project and you need to have already created your System Description (see previous guides).

Workflow

Create an ECU Extract

As mentioned in the prerequisite, in order to start following the workflow steps you need to have completed the System Description (importing arxmls or importing non-AR input files)

The ECU Extract can be created. Right click on the System and select Create ECU Extract. In the pop-up window press the Finish button.

The result of this step is the creation of a Flat View in the Compositions, the ECU Extract and the ECU Flat Map.

Create the required containers

In order to proceed with the configuration, AUTOSAR requires additional elements. In particular, you will need to create an EcuC Value Collection and the containers for RTE and for the OS.

Create an EcuC Value Collection

In order to create an EcuCValueCollection, switch from "AR Explorer" to "ECU Navigator"; then right click on Bsw modules and select Create Ecuc Value Collection --> Create Elements | Ecuc Value Collection.

Create the RTE and OS container

If you double click on the EcucValue Collection, the first time you open it, a pop-up window will appear to set the ECU Extract reference. Select the ECU Extract from the previous step.

As shown above, the wizard also allows the user to create the RTE Module and the OS Module automatically, by clicking the corresponding add button.

Configure the OS

The created Os module will be already populated with an Application Mode named OSAPPDEFAULTMODE.

This initial configuration is sufficient for a basic project to work. However additional elements will be added in the next steps, such as the the RTE configuration.

Additional configuration of the OS module can be achieved using the RTA-OS Configuration Tool. This is described later in this guide.

Configure the RTE

Once the containers have been created, you can proceed with the RTE configuration.

Map the SWC Runnables on Os Tasks

Before mapping the Runnables, you need to create the Os Tasks. To do so, from the "Os Task Properties" Tab right click on the empty table and select Create Os Task (see below).

Configure each Task's properties, Priority and Activation. This is required to allow Runnables to be mapped to the the Os Tasks.

Switch to the "Entity to Task Mapping" Tab and drag each Runnable on the right to the relevant Os task on the left. The result of this step is shown in Figure below.

Configure the BSW

Run RTA-BSW Configuration Generation

RTA-BSW offers a Configuration Generation tool to complete the AUTOSAR Basic Software Module configurations using the configuration already provided.

If the plug-in is correctly installed, the two shortcut buttons for Configuration Generation and Code Generation should be visible in the Toolbar as shown below.

Press the Configuration Generation button or from the Menu bar select RTA-BSW --> Automatically configure BSW from System Description. This step will create a "Config" folder inside the Project folder with the automatically generated arxml files related to the BSW modules.

If the Configuration Generation operation succeeded, the Bsw Modules section will be populated with the configured modules as shown below:

You can configure additional modules/services in the BSW just right clicking on "Bsw Modules" and selecting the creation of the new module. You can also modify the generated configuration of a module by expanding the item from the menu.

Run RTA-BSW Code Generation

Before generating the Basic Software Code, the desired modules must be selected.

From the Toolbar press the arrow next to Run Configurations button and select Run Configurations...

In the pop-up window press New launch configuration button (if there is not already a configuration for the project)


Make sure that the RTA-BSW version recognized is the desired one and that the project is correct, set the path where you want the BSW source code to be placed. Finally check that all the BSW modules configured are checked. The result of this step is shown  below.

Click Apply and Run to generate the BSW code. To regenerate the code from outside the Run Configurations window, the RTA-BSW Code Generation button highlighted below can be used.

Mapping ECU Services

As mentioned before, after the BSW code generation, also the BSW Service Components are created. You can see them under the "Component" view. The Service SWCs are indicated with a violet icon

Map BSW Service SWCs onto the Composition

If you are using BSW services such as Mode Management or NVM services, you will need to add the generated Service SWC prototype to the ECU.

Hint: Mode Management is needed for RTE generation because the RTE generator will look for some references generated by the Mode Management Modules (EcuM and BswM). The mode management configuration is both complex and relatively project agnostic. For these reasons, it is discussed in a separate Application Note. For a basic project, a sample Mode Management configuration can be imported, however if you need to configure BswM and EcuM from scratch, you can refer to the dedicated Application note.

To map the Service SWCs to the composition, open the composition and add the SWC prototypes as shown below.

Update the Connections

If you added new SWCs to your composition, these may also need to connecting using the Assembly Connection tool.

These steps will be more detailed in an example in other Applications Notes, for example you can consult the Memory Services Applications Note to see how to connect Memory Service SWC ports to an Application SWC.

Update the EcuExtract

Following any modifications to the System or composition, the EcuExtract must be regenerated in order to contain the changes. This is done by  right clicking on the System Info and then selecting "Generate EcuExtract".

BSW Runnable mapping

Following updates to the BSW Configuration, the RTE Configuration's Runnable to Task Mapping may need updated. It is recommended to map all BSW runnables to a dedicated Os task. If one does not exist it should be created as shown below - 'OsTask_BSW'.

The example below shows all BSW Entities mapped to an OsTask 'OsTask_BSW'. Additionally, all ModeSwitch Entities have been mapped an OsTask 'OsTask_MS'.

Code generation

At this point the RTE and OS code can be generated.

RTE generation

To generate the RTE code, 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.

In the pop-up window make sure to select the correct paths to the RTA-RTE tool and to the output folders. In the Additional commands always add the command line option (--os-define-osenv=RTAOS40) to create the necessary define for the AUTOSAR release used. If, as in this case, there are some ports unconnected and you want to generate the RTE, use the additional command (--strict-unconnected-rport-check=warn). See the RTA-RTE Reference Manual, in the RTA-RTE installation directory, for details on all the command line options.

OS generation

During the RTE generation, a file "OsNeeds.arxml" is generated. This file describes the Os requirements of the generated RTE code, such as timers, schedule tables, and the number of tasks and the ECU core they will run on. T

Open the RTA-OS Configuration Tool. Press File button in the menu bar and select New Project.... In the pop-up window "Project Properties" make sure to select the correct AUTOSAR release.



Import the 'OsNeeds.arxml' file generated from the RTE generation step. The file is located in the output folder of the RTE Code Generation step. To import the file press on File and select Add Existing File... , browse to the path file and press Open.

In addition to the elements contained in the 'OsNeeds.arxml' file, there is some OS configuration that is required. The required elements are:

  • Configure the target settings for usage with virtual target (or the relevant hardware).

  • Configure the General settings (Scalability class, hooks, error hook)

  • Application modes: a new application mode must be created with the same name of the OsAppMode created in the BSW configuration (in the sample project it is OSDEFAULTAPPMODE)

  • ISRs (these elements depend on the target; in case of a virtual target, create a single ISR and map it to the vector table position 7)

  • Task: A startup task with the same name of the one created in ISOLAR-AB must be created

Once these steps are completed, the OS library can be generated. To do so, press on the Builder button on the left. The builder is composed by 2 main parts: Setup and build.

Verify the Setup in the "Option" Tab under "Build type", for example choose the verbosity level of the building process or (if you have a valid license) generate the OS source code.

In the "Output Locations" tab, select the path to generate the library/source code into.

The "Include Paths" tab contains important settings for building the library, and must specify the location of some files generated by the RTA-BSW tool which are needed by the OS. These are shown below.

The configuration is now complete, and the OS can be built. Switch to "Build" from the menu on the left and press the Build Now button.

Hint: In case you have errors referring to missing .h files check the "Includes Path" option and make sure that all the needed file paths are there.

Hint: Make sure that the installation folder of the compiler you configured for the target is in your system PATH environment variable (for example if MinGW is used, the path must be the following: C:\Program Files\ETAS\ISOLAR-EVE3.2\plugins\com.etas.evetools.toolsfolder_1.7.1\Tools\MinGW\bin).

BSW generation

The BSW Code Generation phase has been covered previously. The BSW must be re-generated following changes to the BSW configuration or any SWC services needs,

Conclusions

Following this Application Note you should now have a project where you can generate the RTE, OS and BSW code. Potentially, this can be a complete project. With the addition of an AUTOSAR MCAL and integration code this could be tested in a virtual/hardware target.