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 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-C | Port | Interface | What it does |
|---|---|---|---|
SwcSensor | PpSpeed (provides) | IfSpeed (sender-receiver) | May write speed, started every 20 ms |
SwcSensor | RpScale (requires) | IfScale (client-server) | May call GetScale |
SwcActuator | RpSpeed (requires) | IfSpeed (sender-receiver) | Runs when speed arrives |
SwcActuator | PpScale (provides) | IfScale (client-server) | Answers GetScale |
What You Need
- PAIO, installed and able to run.
- The project
VehicleDesignfinished in the AUTOSAR System Tutorial. To skip that tutorial, download VehicleDesign-system.zip, unpack it and open the folderVehicleDesignwith 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
| Chapter | What you do | Editor used |
|---|---|---|
| 1. Composition and ECU Mapping | Create the composition ECU and map it to the node ECU | VFB editor |
| 2. Data Type | Create the data type SpeedType | DataType editor |
| 3. Interfaces | Create the interfaces IfSpeed and IfScale | Interface editor |
| 4. SW-Cs and Ports | Create SwcSensor and SwcActuator with two ports each and connect them | VFB editor |
| 5. Internal Behavior | Add four runnables with their access points and RTE events | SWC Internal Behavior |
| 6. PRTE Setup | Bring in the BSW modules, set EcuM, BswM, Mcu and Det, and import the Rte values file | ECU Configuration, Configuration |
| 7. Os Configuration | Enter the OS settings, the tasks, the alarms and the counter by hand | Configuration |
| 8. Rte Configuration | Map the RTE events to the tasks and complete the BSW module instances | Configuration |
| 9. Communication Configuration | Enter EcuC, Can, CanIf, ComM, CanSM, Nm, CanNm, LSduR, PduR and Com by hand | Configuration |
| 10. Validation and Code Generation | Validate the design and generate the code with PRTE | VALIDATION panel, PRTE Code Generation |
| Appendix | All 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.