メインコンテンツまでスキップ

AUTOSAR CP Tutorial

This tutorial puts two software components on the ECU node ECU of the project VehicleDesign in PAIO, configures the BSW with its CAN stack and network management by hand, without PRTE AUTO CONFIGURATION, and generates the ECU's code with PRTE, the Classic Platform code generator built into PAIO. It is the second of three parts on one project: AUTOSAR System → AUTOSAR CP → AUTOSAR AP.

The two connected SW-Cs in the composition ECU

The software you build: SwcSensor and SwcActuator in the composition ECU, joined by two connectors.

What You Build​

SwcSensor has a 20 ms runnable that may write a speed value and ask SwcActuator for a scale value; SwcActuator receives the value and answers the request. The tutorial builds this structure; the bodies of the runnables are code you write later.

SW-CPortInterfaceWhat it does
SwcSensorPpSpeed (provides)IfSpeed (sender-receiver)May write speed, started every 20 ms
SwcSensorRpScale (requires)IfScale (client-server)May call GetScale
SwcActuatorRpSpeed (requires)IfSpeed (sender-receiver)Runs when speed arrives
SwcActuatorPpScale (provides)IfScale (client-server)Answers GetScale

What You Need​

  • PAIO, installed and able to run.
  • The project VehicleDesign finished in the AUTOSAR System Tutorial. To skip that tutorial, download VehicleDesign-system.zip, unpack it and open the folder VehicleDesign with Open Project in the PROJECT menu.
  • For chapter 6, the Rte values file VehicleDesign_Rte.arxml. Save it before you start; if the link opens it in a browser tab, use Save As.
  • A screen of 1920×1080 or larger.
  • A rough idea of ports, runnables and the RTE. Each chapter shows what to enter on which screen.

Chapters​

ChapterWhat you doEditor used
1. Composition and ECU MappingCreate the composition ECU and map it to the node ECUVFB editor
2. Data TypeCreate the data type SpeedTypeDataType editor
3. InterfacesCreate the interfaces IfSpeed and IfScaleInterface editor
4. SW-Cs and PortsCreate SwcSensor and SwcActuator with two ports each and connect themVFB editor
5. Internal BehaviorAdd four runnables with their access points and RTE eventsSWC Internal Behavior
6. PRTE SetupBring in the BSW modules, set EcuM, BswM, Mcu and Det, and import the Rte values fileECU Configuration, Configuration
7. Os ConfigurationEnter the OS settings, the tasks, the alarms and the counter by handConfiguration
8. Rte ConfigurationMap the RTE events to the tasks and complete the BSW module instancesConfiguration
9. Communication ConfigurationEnter EcuC, Can, CanIf, ComM, CanSM, Nm, CanNm, LSduR, PduR and Com by handConfiguration
10. Validation and Code GenerationValidate the design and generate the code with PRTEVALIDATION panel, PRTE Code Generation
AppendixAll values, common problems—

How to Read This Tutorial​

  • Follow the chapters in order. Each one starts from the result of the previous one.
  • Repetitive work is shown once. One item is shown as steps; the rest are given in value tables that you enter the same way.
  • UI labels are written in bold as the screen shows them, and model element names and values in code.

Next Step​

Start with Composition and ECU Mapping.