Case Study: SOME/IP Implementation on FreeRTOS

SOME/IP is an automotive protocol used for communication between vehicle ECUs. It is an application layer protocol, used in automotive ethernet.

Communication is necessary between between sensors, actuators and control units within a vehicle. These were acheived by using CAN bus. With advancement in technology, automotive systems needed mechanism for transfering large amounts of data for applications like camera based driver assistance systems, in-vehicle entertainment, software upgrades, etc. CAN bus was primarily designed for low bandwidth applications and hence these new requirements could not be accommodated with CAN.

In 2011, car manufactures BMW and Hyundai started working with Broadcom, NXP Semiconductors, Freescale and Harman, to come up with an Ethernet based solution to handle these data heavy applications. The first Automotive Ethernet standard IEEE Std 802.3bp-2016 was approved in June 2016, and number of vehicle manufacturers have since adopted automotive ethernet for their vehicles.

Automotive ethernet provides the physical and link layers for communication, the TCP/IP stack provides the network and transport layer, and SOME/IP provides the application layer protocol, that is used for communication between ECUs.

Problem Definition

Customer would like to use SOME/IP, in an infotainment system, for communication within the ECU and with other ECUs, as well. Within the ECU is an Analog Device SoC, that is used for handling the audio functionality. The Analog Device SoC has an ARM core which runs FreeRTOS, and has an Ethernet interface to communicate with the other nodes. The customer would like to use SOME/IP protocol to monitor and control the audio application running on the ADSP. The customer wanted an implementation of SOME/IP protocol to run on FreeRTOS using the FreeRTOS+TCP stack.

Solution

SOME/IP protocol was implemented, in C, on top of FreeRTOS and FreeRTOS+TCP. The implementation was tested using a combination of Scapy and Robot Framework. An interop testing was performed against vsomeip implementation, as well. The implementation had the following modules:

  • TP - Implements the transport layers - UDP, TCP, SOME/IP-TP

  • Core - Implements the application API

  • SD - Implements the service discovery functionality

  • Wire - Implements the serialization and deserialization API.

The block diagram for the SOME/IP protocol implementation is shown below:

/static/images/someip-blocks.png
Figure 1. SOME/IP Blocks

Challenges

Some challenges faced while implementing SOME/IP is listed below.

Challenge #1: Development Setup

Due to limited target hardware availability, the testing of the SOME/IP implementation was performed on Qemu. Qemu was used to emulate V2M MPS2 board. A networking was setup between the emulated target and the host machine using TAP network interface on Linux. The SOME/IP implementation was tested on FreeRTOS, FreeRTOS+TCP running within the emulated system.

Challenge #2: Validation

Validation is an integral part of the implementation of the SOME/IP protocol. To be ASPICE compliant, we had to perform both unit testing (SWE.4) and component level integration testing (SWE.5). While unit testing was straight forward, component level integration testing was something that we had to work out, to ensure that the validation requirements were met.

The features on the SOME/IP implementation was validated using two different approaches. The first approach was using vsomeip. vsomeip is an open source implementation of the SOME/IP protocol using C++ and Boost. Test applications were written both in the target and the host and the various scenarios were exercised and the functionality and interop with vsomeip was tested.

The second approach was using Robot Framework and Scapy. Scapy is a Python module / program that enables the user to send, sniff and dissect network packets. Scapy allowed us to inject carefully crafted requests to the SOME/IP server / client, and test the system under various corner case scenarios. Compared to the vsomeip approach, this provided us better fine grained control, and test coverage on the features implemented in the library.

Business Value

The SOME/IP implementation was critical to get the communication happening within the system components. Non-availability of a SOME/IP implementation for use in FreeRTOS posed a challenge to the customer. Using our custom SOME/IP implementation our customer was able to implement various application services for Audio, Upgrade, Diagnostics, Time, etc, meeting the expectations of the system architecture, within the limited available timeline.

Concluding Remarks

While this project is about implementing SOME/IP on FreeRTOS. Our team has implemented SOME/IP, in multiple environments including AUTOSAR, FreeRTOS and Python-based, and using multiple SOME/IP versions. This has helped us gain an deep understanding of various features of the SOME/IP protocol, that we can leverage to support our customers.

If you are interesting in using or implementing SOME/IP protocol, or other automotive protocols like DOIP, DLT, etc. please do get in touch with us at sales@zilogic.com.