RTA Knowledge Base

Table of Content

Introduction

Scope

This application note describes how to take the System Description that you created in Workflow 02, create an ECU Extract from it, configure the ECU, and then generate the code for the BSW, OS and RTE.

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

RTA-CAR 9.1.0 toolchain

ISOLAR-ABv 9.1.0
RTA-RTEv 7.4.1
RTA-BSWv 6.1.0
RTA-OS

v 6.1.3

Prerequisites

In order to successfully follow the workflow presented below, you must have the RTA-CAR toolchain installed (including the RTA-BSW plug-in) and you must be familiar with the AUTOSAR specifications, terminology and methodology.

You also need to have already worked through Workflow 01 and 02 to create a sample project and System Description.

Workflow Summary

Here is a summary of the steps that you will be working through in this example.

Step 1:  We will create an ECU Extract from the sample project that we created and configured in Workflows 01 and 02.

Step 2: In preparation for the configuration of the extracted ECU, we will configure the required elements (EcuC Value Collection and containers for RTE and OS).

Step 3: We will then configure the OS.

Step 4: Then we will configure the RTE

Step 5: And finally we'll configure the BSW, and then run the BSW Code Generation

Step 6: After the Code Generation, we'll map BSW Service SWCs onto the Composition, update the connections, and update the ECU Extract.

Step 7: We will then complete the workflow by running the Os and RTE Code Generations, and then re-running the BSW Code Generation.

As a result of working through this workflow, you’ll have a project from which you can generate the RTE, OS and BSW code for a particular ECU. With the addition of an AUTOSAR MCAL and integration code, the output of this project  could then be tested in either a virtual or a physical hardware target.

Step 1. Create an ECU Extract

In this first step we are going to create an ECU Extract from the sample project that we created and configured in Workflows 01 and 02.

  • Open the sample project
  • Right-click on the System
  • Select Create ECU Extract.



In the "Create ECUExtract" pop-up, remove the "Ignore comspec conflicts"  option (see EcuExtract_ERR_03 in ISOLAR-A_Help_ErrorDescription and SwConnectors in ISOLAR-A_Help_ReferenceManual) and click Finish.



Click OK on the message confirming that the ECUExtract has been successfully generated.



You'll find the newly-created ECU Extract (EXTR_ApplicationECU) just above the System in the AR Explorer.


Step 2. Configure additional elements

In order to proceed with the configuration of the ECU, the following AUTOSAR defined elements must be present in the project (see ECU Navigator tab):

  • An EcuC Value Collection
  • A container for the RTE
  • A container for the OS

We are now going to configure these required elements.


2.1 Configure an EcuC Value Collection

Switch from the "AR Explorer" tab to "ECU Navigator" tab, then right click on "EcucValueCollection_0" and rename it "EcucValueCollection" under Bsw modules --> Ecuc Value Collection, then double click it.



The first time you open a new Ecuc Value Collection, a "Prerequisite for RTE Configuration" pop-up like the one shown below will appear.

Then select the ECU Extract that you created in Step 1 from the drop-down list and click Finish.

You can see that the containers for both the RTE and OS modules are created by default.



Step 3. Configure the OS

From the ECU Navigator, open the "Os" module.



On the OsAppMode container in the list on the left there is an OsAppMode called OSDEFAULTAPPMODE  is sufficient for a basic project to work, but we'll be doing some additional configuration on it (using the RTA-OS Configuration tool) later on in this workflow.



Step 4. Configure the RTE

At this point we need to do some further configuration of the default RTE container, which will involve the creation of an Os Task and the mapping of SWC runnables.


4.1 Create OS Task

In this first step, we are going to create an OS task. This is required in order for us to be able to map a Runnable to it.

In the ECU Navigator, open the EcucValueCollection by double clicking on it.



At the bottom of the editor dialog,  select the "Os task Properties" tab.



Right-click anywhere inside the empty table, and then click on Create Os Task.



A "Create OsTask" pop-up like the one shown below will appear, then click Finish.



A new row will be added to the table, with a default task called OsTask_0.



Rename the new task as "OsTask_ASW", and ensure that an Os Task Schedule, such as FULL, has been selected.



4.2 Configure the RTE

We now need to configure the RTE.

Switch to the "RTE Configuration" tab at the bottom of the editor.



Configure the RteGeneration container as shown in the image below (see the AUTOSAR RTE specification for more details):


4.3 Map the Runnables to the OS Task

We now need to map the Runnables to the OS task that we've just created.

Switch to the "Entity to Task Mapping" tab at the bottom of the editor.



Drag each Runnable in the right-hand "UnMapped Entries" section over to the relevant Os task in the left-hand "Mapped Entities" section.

Shown below is an example of the "Entity to Task Mapping" after the mapping of Runnables has been completed.


Step 5. Configure the BSW and generate the code

In this next step we are going to configure the BSW and then generate the code.


5.1  Configure the BSW 

RTA-BSW includes a Configuration Generation tool (ConfGen) to complete the AUTOSAR Basic Software Module configurations, based on the configuration that has already been provided.

With the RTA-BSW plug-in correctly installed, you will see a shortcut button for RTA-BSW Configuration Generation in the ISOLAR-AB toolbar. 



Select the project in the AR Explorer and then click the RTA-BSW Configuration Generation button.



Set the Output Path in the Generate ECU Configuration window to an appropriate location and click Finish.



In the case of our example project, and the DBC import that we did in Workflow 02, the Bsw Modules section will be populated with the configured modules, as shown in this example.



Although not part of this sample workflow, you could optionally configure additional modules and/or services in the BSW. This is done by right-clicking on "Bsw Modules" and creating the new module(s), or by modifying the configuration of an existing module by clicking on it to expand its contents.


5.2  Run the BSW Code Generation

The BSW code is generated through the RTA Code Generator, which can also be used to generate the code for the RTE and OS modules.

There's an icon for the RTA Code Generator in the ISOLAR-AB toolbar.



Choose the Open RTA-Code Generator dialog option.



In the pop-up window (see below) you can set the details of each of the three code generators (RTA-BSW, RTA-RTE, RTA-OS).

Before generating the BSW Code, you must first select the configured BSW modules that you wish to be included in the generated code, and also set/check the location of the BSW Output Path.




Depending on which BSW modules you have selected, you may have to do additional configuration in order for the BSW code generation to be successful. If you have enabled the BswM and EcuM modules and wish to use an example configuration, there is a note about this in section 6.1.

When you're ready to do the code generation, click Apply and then click on Generate RTA-BSW.

Note: If you need to regenerate the BSW code from outside the Run Configurations window, you can use the Generate RTA-BSW button from the RTA Code Generator menu.



Step 6. Mapping ECU Services

The BSW Service Components will also be created as part of the code generation, and they are visible (with a violet colored icon) in the "Components" section.



If you have any Service Components, you need to update the System and map them in your ECU, and also update the ECUExtract (the same way as creating it) after the System has been modified. We show you how to do this additional work below in step 6.1.


6.1 Map BSW Service SWCs onto the Composition

As mentioned above, if you're 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 workflow. 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 other workflow.

If you are following this example workflow directly, you can use the configurations provided in the Starter Kit. Copy the following files from the Starter Kit into the same locations within your project.

  • All BswM_*.arxml and EcuM_*.arxml files from ecu_config\bsw\ecucvalues
  • The whole integrationCfg folder from ecu_config\bsw\
  • MSI_Shutdown.arxml from the system_config folder (if an error regarding it during the BSW generation is raised)


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



After that open the system with the SWC To ECU Mapping Editor to map the new component.



Now, drag and drop the Service SWC into the System Mapping.



Update the Connections

If you add new SWCs to your composition, they may also need connecting using the Assembly Connection tool. We cover this process in a separate workflow (e.g.  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 that you make to the System or Composition, the Ecu Extract must be regenerated in order to incorporate those changes. This is done, as we saw earlier, by right clicking on the System Info and then selecting "Create EcuExtract".



BSW Runnable mapping

Following updates to the BSW Configuration, the RTE Configuration's Runnable to Task Mapping may also need to be updated in the EcucValueCollection. It is recommended that you map all BSW runnables to a dedicated Os task. If such a task doesn't already exist, it should be created like the "OsTask_BSW" example shown here. (See step 4.1 for instructions on how to create an Os task).



The example below shows all BSW Entities mapped to the one "OsTask_BSW" task.  


Step 7. Code Generation for RTE and OS

We are now ready to generate the code for the RTE, and then configure and generate the code for the OS.


7.1  RTE Code Generation


In the Rte Main tab of the RTA Code Generator Settings (see below), set the Rte Output Path and Rte Log Path.

In the Rte Command box, add the command line option (--os-define-osenv=RTAOS40) to create the necessary define for the AUTOSAR release used.

If, as in the case of our example workflow, there are some ports unconnected, use the additional command (--strict-unconnected-rport-check=off). See the RTA-RTE Reference Manual, in the RTA-RTE installation directory, for details on all the command line options that are available here.



In the Included AR Files tab, select the included files needed for the RTA-RTE generation. In the case of this example workflow, make the selections shown here:



In the RTA Code Generator menu, select Generate RTA-RTE.



7.2  OS Configuration and Generation

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

Now that we have this file, we are ready to proceed with the OS configuration. There are two ways to carry out the configuration of the OS:

  • Using ISOLAR-AB (from RTA-CAR 7.0.1).
  • Using the RTA-OS Configuration tool.

Within this sample workflow, we will configure the OS using ISOLAR-AB.


Double-click the Os container in Bsw Modules.



Within the BSW Editor you can configure all the OS containers according to your project requirements.

In addition to the elements contained in the 'OsNeeds.arxml' file, the following elements are required for the OS configuration:

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

  • Configure the General settings (e.g. scalability class, hooks, error hook etc).

  • You will also need to create ISRs, which will depend on the intended target (e.g. for a virtual target, create a single ISR for the System Clock and map it to the vector table position 7).

  • A startup task must also be created (see below), where the OsTaskAppModeRef in the OsTaskAutostart container should be set to OSDEFAULTAPPMODE, where the OsAppMode should have been set up automatically upon project creation. A startup task is necessary to initialise the ECU system code (e.g. OS startup code) before any other Application or Basic SW starts.


If you're following this example workflow, you can copy the sample configuration from the Starter Kit.

Note that if you do this, you should use the split view (see icon below) to see which containers are configured in the Os arxml and which are automatically generated by the Rte into osNeeds.arxml.



Once you've completed the configuration of the additional elements described above, open the RTA Code Generator again and configure the Os in the same way that you did for the RTE in step 7.1 (e.g. specifying output paths, additional commands, and included files and folders).



If you're still following this example workflow, you will need to select your Os.arxml and the osNeeds.arxml (generated by the RTE) in the Included AR files tab for the OS.

Once the configuration is completed, you can then click Run to run the OS code generation.

The RTA-OS Generator will be called by ISOLAR and you will be able to see the result in the Command Log.



7.3  Re-Generation of BSW

Following changes to the BSW configuration, or any SWC services needs, the BSW must be re-generated. You do this using the same process as previously described in section 5.2


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.