How to guarantee application functionality in a MOST150 network? Walid El Kassem, X2E Friedrich Schick, X2E Prof. Dr. Norbert Wehn, TU Kaiserslautern Projektleiter: Datum: Arbeitsgruppe: Walid El Kassem 20.03.2012 Walid El Kassem, Friedrich Schick, Norbert Wehn Overview 1. 2. 3. 4. 5. 6. 21.03.2012 2 X2E‐the company Motivation Linux as a Real Time Operating System Hardware architecture MOST150 integration A system solution VERTRAULICH ‐ CONFIDENTIAL X2E the company 3 • X2E was founded 2005 in Kandel • Embedded solutions made by X2E – – – – Datalogger for automotive applications Remaining Bus Simulation platforms CarPC based on Atom processor Gateway • Hardware and Software development • SMD assembly and mechanics by X2E 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL Motivation 4 • Support system integration with accurate bus traces of MOST150, Ethernet, CAN, RS232 and Flexray. ‐ For spying the MOST150 bus, a multibus datalogger with MOST150 support needs to be developed. • In the course of developing an ECU, prototypes have to be integrated into MOST150 networks for testing purposes. At this point, either not all relevant devices are available, or the test setup is too cost‐intensive. ‐ Need of a robust Hardware platform with flexible functionality and guarantee of real time operation to simulate MOST150 ECUs. 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL Guarantee by the operating system 5 • A non real‐time operating system: – Preemption is switched off for an unknown amount of time – Worst‐case latency cannot be evaluated • A real‐time operating system (RTOS): – Use of priorites to schedule tasks e.g. fixed priority scheduling, deadline scheduling – Highest priority task always gets to the CPU – Worst‐case latency can be evaluated 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL What does Linux offer? 6 • Wide distribution – Great support from the community and consulting companies Tux, the Linux mascot • Open Source Tooling for development e.g. Compiler, Debugger – Cost cut‐down • Extensive hardware support – USB host and gadget support – Broad ethernet support e.g. VLAN, Multicast, Precision Time Protocol IEEE 1588 • The Linux Vanilla Kernel does not guarantee real‐time execution! – A kernel space process may preempt the execution of user space applications and disable preemption for an unknown amount of time. 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL Make Linux a RTOS 7 CONFIG_PREEMPT_RT patch Objective of complete inclusion into the mainline kernel 21.03.2012 Replace non preemptible locking‐primitives by reimplementation. Merge interrupt handlers into kernel threads, which may be interrupted by a user application. The development is very close to the mainline. VERTRAULICH ‐ CONFIDENTIAL Make Linux a realtime OS "Controlling a laser with Linux is crazy, but everyone in this room is crazy in his own way. So if you want to use Linux to control an industrial welding laser, I have no problem with your using PREEMPT_RT." Linus Torvalds 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL 8 Quality Assurance of RT Linux Quality Assurance by The Open Source Automation Development Lab (OSADL) – – 9 Continuous stress test on a large number of different architectures. Burst loads of memory, filesystem and network access. QA activities include monitored stress tests to detect – – Kernel crashes, memory leaks, driver misbehaviour. Unsatisfying worst‐case latency. OSADL Test Rack ‐ https://www.osadl.org 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL CONFIG_PREEMPT_RT worst‐case latency Kernel 3.0.10‐rt27 with CONFIG_PREEMPT_RT MPC 8349E @533 MHz, 32 bit Number of latency samples 10 Latency plot ‐ https://www.osadl.org Latency (us) 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL Interfacing hardware with Linux Standard Linux drivers – – – – Block or Character device driver Full access to DMA User‐space interaction through system calls e.g. read, write Driver must be licenced under General Pulic License (GPL) User‐space drivers (UIO) – – – – – 21.03.2012 Only a minimalistic kernel driver No direct access to DMA Controller memory map is exposed to the user‐space No syscall, no context switching when accessing the hardware Drivers are user‐space libraries under any license e.g NetServices accessing the Low‐Level driver VERTRAULICH ‐ CONFIDENTIAL 11 High bandwidth versus low latency High bandwidth applications require burst processing in respect of hardware and CPU cache usage Low latency applications require fast interaction with hardware e.g. interrupt handlers Example 1x CAN (1 Mbit/s) – – 8 Bytes payload with bitstuffing, up to 130 bit length Up to 7.5 messages per millisecond Need of hardware supported preprocessing 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL 12 Hardware preprocessing Bus access on slot‐cards e.g. ‐ ‐ ‐ Bus transceiver (CAN, …) Phys (Ethernet, …) Analog circuits FPGA solution ‐ ‐ ‐ ‐ Central timestamp Fully parallel asynchronous sampling of bus traffic e.g. FlexRay startup Transmission part does not interfere with reception part Collecting information in arbiter, that writes frames into ring‐buffer No CPU interaction at all 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL 13 Accessing the MOST150 bus MOST‐ Netzwerk IO‐Companion: OS85652 MOST150‐FOT Rx Tx OS81110 / SPYNIC Network‐ Port MLB 6‐Pin Interface MLBCP MLBCN MLBSP MLBSN 14 D [0:15] A [0:2] Host Bus Interface MLB 6‐Pin Interface MLBDP MLBCN OS81110/ SPYNIC plug socket 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL Chip Select Interupt W/R A complete view of the system 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL 15 Development tools Eclipse CDT development environment – – – Cross‐Compiler Remote Debugger Hardware breakpoints Massive library support – – 16 Multimedia Network streaming Eclipse CDT ‐ http://www.eclipse.org/cdt/ Linux environment – Python, Perl, …. Python Logo ‐ http://python.org/ 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL MOST150 – Linux Demonstration MOST 150 MOST 150 ‐ MEP 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL 17 End 18 Thank you for your Attention! Live demonstration at X2E exhibition stand and the live IN‐CAR DEMO! 21.03.2012 VERTRAULICH ‐ CONFIDENTIAL
© Copyright 2024