RTA Knowledge Base

Used toolchain

RTA-BSWv 3.1.0
RTA-RTEv 6.4
RTA-OSv 5.5.11
RTA-OS portHightechTricore 5.0.16

Introduction

Scope

This Application Notes shows how to create a multicore sample system and configure RTE, OS and BSW for multicore systems.

Tool-chain used

Below a list of tools used for this AN:

  • RTA-BSW 3.1.0.011456pr
  • RTA-RTE 6.4
  • RTA-OS 5.5.11
  • RTA-OS port Hightec Tricore 5.0.16

Prerequisites

The following example is based on RTA-SK configuration, but it can be applied on any AUTOSAR system with the correct adaptions.

In addition to the SK configuration, 2 SWCs have been added running on 2 tasks. The scope of the exercise is to map one of the task on a secondary core:

Create partitions

Open the existing ECU Extract with the Ecu Partition Editor right clicking on the ECU extract and selecting Open with --> Ecu Partition Editor:

Now create two new partitions; right click on the empty table and select Create Ecu Partition


The partitions configuration will be imported by the OS, therefore the AR package shall be the same as the OS one (e.g. OsCfg)


For each partition create an Os Application; right click on the partition and select Create OsApplication

For each partition create a Core Definition; right click on the partition and select Make Core ID Editable/Non-Editable

For partition 0 set the following properties:

  • OsTrusted to TRUE
  • BswModuleExecution to TRUE
  • CoreID to 0

For partition 1 set the following properties:

  • OsTrusted to TRUE 
  • BswModuleExecution to FALSE 
  • CoreID to 1

Map SWCs to Partitions

Now map all components on the EcuPartition0 with the exception of the component that will execute on the secondary core (in this example CPTSWCCPU1):

Task Configuration

In RTE editor map each task to an OsApplication: tasks running on core 0 shall be mapped on OsApplication0 while tasks running on core 1 shall be mapped on OsApplication1

RTE generation

At this stage it is possible to generate the RTE. The RTE will generate the new file iocNeeds.arxml that will be imported in the OS in the next steps. Generated files from RTE generator are shown below:

OS Configuration

Open RTA-OS configurator and import the following files:

  • icoNeeds.arxml
  • Configuration file containing the partition configuration created previously

Hint: convert the path form Absolute to Relative to make the project independent from the file system.

NB: RTA-RTE does not support the generation of OsNeeds for multicore System. It is suggested at this stage to freeze the current OsNeeds (e.g. copying it into the OS project folder and remove the reference to the existing one). From now on the synchronization between RTA and OS must be manually maintained!

Now disable all Hooks for all OsApplications

Map the following entities on OsApplication_0:

  • Counters
  • ISR
  • Schedule tables
  • Tasks (with the exception of the task running on core 1)

Map on OsApplication_1 the task running on CPU 1.

In the current example Resources needs to be accessed only by CPU 0, therefore is possible to ad only the OsApplicaiton0 to the resource “In Use” list. For all the available resources, add to “Accessing Application In Use” the OsAPllication0

Add the OsApplicaiton_1 to the Schedule table Applications “In Use”

From OsTaskCPU1:

  • Add the access to the OsApplication_0 (to give access to the Schedule table)

  • Remove the access to the RTE_RESOURCE (because is not required)

ISR priority 1 must now be freezed. In case the OS has any ISR with this priority, the value shall be changed

Set the number of Cores in General configuration, to 2

Map OsApplicaiton0 to Core 0 and OsApplication1 to core 1

In order to build, the OS now needs to access the files RteType.h (generated by RTE) and RteUserCfg.h. Add the relative folders to the include paths in the Build set-up window

It’s now possible to generate the Operating system.

BSW generation

EcuM configuration depends on the number of cores configured in the system. RTA-BSW takes this information by the OS configuration already present in the project, hence the EcuM does not need any reconfiguration. The BSW can be generated at this stage with no changes in the configuration. NB: : due to a know issue, the file containing the Partition configuration, created at the beginning of this exercise, shall be removed during the BSW generation and restored afterwards.

BSW modification

EcuM description now contains a different MainFunction configuration:

  • The previous MainFunction definition has been removed
  • 2 new MainFunction have been created

So you must:

  • Remove the mapping of the un-existing MainFunction
  • Map the new MainFunctions on tasks mapped on the 2 different cores

RTE generation

The new Task configuration requires to generate the RTE. AUTOSAR does not allow to map the same SWC on 2 different partitions, but at the same time requires the EcuM to be executed on 2 cores. For this reason, the EcuM MainFunction mapping generates error in the RTE validation that needs to be bypassed. To do that:

  • add the following option in the additional command filed :
--deviate-bsw-any-partition=1 --deviate-split-swci-support=1 --error-as-warning=E16-1357
  • enable the ErrorAsWarning option: go to RTE_InstallationFolder/bin/RTEGen.ini and set
ErrorAsWarningOption=enable

The AUTOSAR configuration is now complete.

Integration hints for RTA-SK based on Infineon Tricore

In case the start-up code form RTA-SK is used, you may need to: 

  • Rename McalStart to cstart
  • Remove the Overlay memory activation from start-up code (SCU_OVCENABLE.B.OVEN0 = 1;) if Overlay mem is required, add a condition to activate the overlay memory only by core 0
  • Set:
#define MCAL_NO_OF_CORES   (2U)
  • In McalCore1Container add the call to OsStartCoreGate() and EcuM_Init(). Remove the existing while loop

Add the command “CORE.ASSIGN 1,2” to Lauterbach scripts to activate the second core.