RTA Knowledge Base

Table of content

Introduction

The command ClearDTC is normally used via UDS on CAN. But there are usecases where the same functionality is needed to be invoked from a SWC or a CDD.

In that case, some small changes to the configuration are required in order to follow what AUTOSAR specifies. In fact, looking to AUTOSAR DEM specifications, we can see that it is required to call the function Dem_SelectDTC before calling the Dem_ClearDTC.

Scope

In this brief guide we will explain how to make the correct configuration to your project, in order to be able to call both Dem_SelectDTC and Dem_ClearDTC from the same Client SWC/CDD.

Definitions and Abbreviations

BSW: AUTOSAR Basic Software, Hardware independent service layer

RTE: AUTOSAR Run-Time Environment

OS: AUTOSAR Operating System

SWC: Software Component

CDD: Complex Device Driver

Toolchain

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

RTA-CAR 9.2.0 toolchain

ISOLAR-ABv 9.2.0
RTA-RTEv 7.5.0
RTA-BSWv 6.1.2
RTA-OSv 6.2.0

However, the workflow should be applicable also with previous versions of the toolchain.

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 required to have already a project with DEM and diagnostic stack working.

Workflow

Objective

As mentioned, the objective is to be able to call both ClearDTC and SelectDTC APIs from the ASW using the RTE.

First of all, if you already have generated the BSW and the DEM, the ClearDTC interface should appear in the list of the available Interfaces.

As you can see in the screenshot below, the ClearDTC interface provides both ClearDTC and SelecDTC APIs in the same interface, as specified by AUTOSAR.

The objective will be to update your ASW so that both functionalities can be used.

Update DEM configuration

If you don't have it already, the first step is to create a new DemClient. Each Client represent a new entity which can invoke the DEM functionalities.

We can define the new client to use the RTE as shown below, so that the BSW will be able to generate the correct interfaces and SWCD for the DEM.

Generate BSW and DEM SWCD

Once you have done this simple configuration to the DEM, you can generate the BSW again.

Now we can open the Dem SWCD to check if the expected interface has been added. Doubleclick on the Dem Component to open it with the SWC Editor:

Once you have opened the Dem with the SWC Editor, you should be able to see a new interface, with the shortname you defined in the BSW configuration, as in the screenshot below.

Update SWC/CDD

Now the needed action is to update your ASW, which could mean to update your CDD or SWC. In both cases, the steps are the same.

Open your SWC with the Editor and create a new RPort:

in the Port Creation wizard, select Client Server as Interface Type and then the ClearDTC interface

Now you should have your interface created. You can rename it if needed (I have renamed it to RPortClearDTC)

Now, the next step is to add the Server Call Points, in order to use the Services offered by the Client-Server Interface. Select the runnable in which you want to call the APIs ClearDTC and SelectDTC. Then press the button to add the Server Call Points for the selected runnables. Please remember that if you need to use the API from different runnables, you should add Server Call Points for each of them.

In the Server Call Point wizard select the Synchronous Server Call Points for both ClearDTC and SelectDTC as shown in the screenshot below.

After you press OK, you should see the new Server Call Points created in the list, as visible below:

Update Composition

Now you can update your composition, which means connecting the DEM SWC to your SWC/CDD to use the services (ClearDTC and SelectDTC). You can create the connection as visible in the screenshot below:

Update ECU Extract

The last step required is to update the ECU Extract, since you have made modifications to your composition and in general to the ASW.

Generate RTE

Once the Ecu Extract is updated, you can generate the RTE.

Let's have a look to the changes in the generated RTE code. As you can see below, two new interfaces are created, one for the Dem_ClearDTC and one for the Dem_SelectDTC.

You can invoke the functions:

Rte_Call_DiagnosticSWC_RPortClearDTC_SelectDTC
Rte_Call_DiagnosticSWC_RPortClearDTC_ClearDTC

to access to those functionalities from the SWC/CDD