Real-Time Linux Testbench on Raspberry Pi 3 using Xenomai

University essay from KTH/Skolan för elektroteknik och datavetenskap (EECS)

Abstract: Test benches are commonly used to simulate events to an embedded system for validation purposes. Microcontrollers can be used for making test benches and can be programmed with a bare-metal style, i.e. without an Operating System (OS), for simple cases. If the test bench would be too complex for a microcontroller, then a Real-Time Operating System (RTOS) could be used instead of a more complex hardware. A RTOS has limited functionalities to guarantee high predictability. A General-Purpose Operating System (GPOS) has a vast number of functionalities but has low predictability. The literature study looks therefore into approaches to improve the real-time predictability of Linux. The result of the literature study finds an approach called Xenomai Cobalt to be the optimal solution, considering the target usecase and project resources. The Xenomai Cobalt approach was evaluated on a Raspberry Pi (RPi) 3 using its General-Purpose Input/Output (GPIO) pins and a latency test. An application was written using Xenomai's Application Programming Interface (API). The application used the GPIO pins to read from a function generator and to write to an oscilloscope. The measurements from the oscilloscope were then compared to the measurements done by the application. The result showed the measured dierences between the RPi 3 and the oscilloscope. The result of the measurements showed that reading varied 66:20 μs, and writing varied 56:20 μs. The latency test was executed with a stress test and the worst measured latency was 82 μs. The resulting measured dierences were too high for the project requirements. However, the majority of the measurements were much smaller than the worstcases with 23:52 μs for reading and 34:05 μs for writing. This means the system could be used better as a rm real-time system instead of a hard real-time system.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)