AUTOSAR overview: BSW, RTE, SWC
The standard structure of automotive software. The RTE connects the BSW, close to the hardware, with the SWCs that hold the functions.
Layers
| Layer | Contents |
|---|---|
| SWC (application) | Function logic. Knows nothing about the hardware |
| RTE | Connects SWC to SWC and SWC to BSW with generated code |
| BSW services | Communication (COM, PduR), diagnostics (DCM, DEM), memory (NvM), OS |
| ECU abstraction | Hides the board configuration |
| MCAL | MCU drivers (DIO, ADC, PWM, CAN) |
How the work goes
- In system design, define the SWCs and their ports (the data they exchange) in ARXML
- Configure the BSW modules with tools (Vector DaVinci, EB tresos)
- Generate the RTE and BSW code
- The developer writes logic inside the SWC's runnables (functions called periodically)
void SpeedCtrl_Run10ms(void) {
uint16 spd;
Rte_Read_VehSpd_Value(&spd);
Rte_Write_TrqReq_Value(calc_torque(spd));
}
Classic and Adaptive
- Classic: MCUs, static configuration, real-time ECUs
- Adaptive: high-performance SoCs, POSIX OS, service-oriented communication (SOME/IP), dynamic deployment
In industry, ASW development mostly handles SWC logic (in many cases code generated from Simulink models), and BSW development handles the configuration and integration of communication, diagnostics and drivers.