Introduction
Scope
This application note describes how to integrate the RTA-SUM DIAG module in your RTA-CAR project.
Prerequisites
- The user should read the RTA-SUM_DIAG_User_Guide.pdf available in the RTA-SUM package.
- It is assumed you have followed the RTA-CAR 9.2.1 - 1. SUM Integration - Getting started to install the RTA-SUM plugin.
- In order to successfully follow this guide, you shall have the RTA-CAR toolchain installed and you must be familiar with the AUTOSAR specifications, terminology and methodology. You also must be familiar with the GM specification and GM-SUM modules functionalities.
Configuration of the DIAG module
From the 'ECU Navigator' view, expand the Bsw Modules, and add the 'DIAG' module to the 'Other Modules', as shown below:
DIAG configuration
The configuration of the DiagGeneral container is mostly automatic, filled with default values at the module creation.
Under DiagGeneral those default values can be modified: check that the MEC (Manufacturer Enable Counter) initial value matches the project's specific needs.
DIAG_GenerateInitRunnable supports to generate a periodic runnable for DIAG initialization (if it is set to true) which could be mapped to RTE task
Configure the communication under DiagConfigSets referencing the ComMChannel used: in the RIP case ComMChannel_CAN_3_PhysicalChannel.
Note
If no reference is available in the dropdown list, the integrator should check the DIAG paramdef file and modify it by removing the highlighted elements:
Build the DIAG Module
Now it is possible to run the DIAG Build by following the SUM Generation section of RTA-CAR 9.2.1 - 1. SUM Integration - Getting started.
Configuration of BSW
BswM configuration
After adding the DIAG module it is now necessary to complement the BswM configuration.
Firstly make sure to add the DIAG module's header file in the BswMUserIncludeFiles container under BswMGeneral:
The Diag module requires the configuration of several BswM parameters to correctly manage the Modes required by diagnostic (and communications) functionalities.
In the following steps it will be shown how to configure the CurrentDiagnosticSession as a guideline.
First Create a new "BswMModeRequestPorts" under the BswMArbitration container:
We named the request port BswM_Current_DiagnosticSession_Request, setting the "BswMModeRequestProcessing" attribute to BSWM_DEFERRED.
Next proceed then in creating the necessary "BswMModeConditions", following the example below:
Next step is configuring the BswMModeControl.
Create 2 new switch ports using the "Create BswMSwitchPort" button :
Reference the ports to the SUM specific BswM_Modes:
Now that you have created the Ports it is now necessary to add the relevant BswMActions. Here is a list:
For the Action "DIAG_Init" create a user callout to the initialization function by navigating to the folder shown below and setting the "ShortName" as shown in the following screenshots:
Check the file BswM_DIAG_EcucValues.arxml released in the RTA GM StarterKit to see the complete BswM configuration needed for the DIAG integration.
Once the BswM configuration is completed, you can regenerate the BSW and you will find the expected interfaces generated in the BswM and BswM SWCD.
DCM Configuration
Configure the DCM with the DID DID_F1A0_ManufacturersEnableCounter.
as shown below.
Within the DCM enable the DcmDsdResquestSupplierNotifications:
Add the following DcmDsdServiceRequestSupplierNotification:
Next step is adding the complementary DcmDsdServices, following the example for EcuReset:
The complete list of services to add is:
Add the reference to the ComM channel that will be controlled by the communication control services:
Check the file DCM_DIAG_EcucValues.arxml released in the RTA GM RIP to see the complete DCM configuration needed for the DIAG integration.
Once the DCM configuration is completed, you can regenerate the BSW and you will find the expected interfaces generated in the DCM and DCM SWCD.
NVM Configuration
The DIAG uses some NVM services. You need to update the NVM and add a NvMBlockDescriptor as shown below for storing the MEC. Please consult the RIP GM configuration for further details.
Regenerate the BSW to get the NVM SWCD updated and connect the DIAG with the NVM.
ASW and System update
Now the BSW and the DIAG configuration is completed. The next step is to update the ASW adding the DIAG to the composition and creating the connections with the other SWC (ASW, DEM, DCM, other SUMs).
An example might be the DIAG, that needs to be connected to the SUSD for the PermitExecution and the ShutdownPermission signals.
How to create the connections is out of the scope of this AN. Please consult the RTA-CAR Guides for more information.
Now you can:
- Update all the connections in the ASW composition
- Add the SWC to the ECU Mapping using the "SWC To ECU Mapping Editor"
- Map the new signals in the Signal Mapping Editor
- Regenerate the Ecu Extract
- Update the RTE Configuration mapping the new runnables to the Tasks
BSW/RTE/OS generation
The last steps are:
- Run the BSW Code Generator
- Regenerate the RTE
- Generate OS
Integration with the DIAG is completed.