Return to search

Real-Time Linux Testbench on Raspberry Pi 3 using Xenomai

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. / Testbänkar används ofta för att simulera händelser till ett inbyggt system för validering. Till simpla testbänkar kan mikrokontroller användas. För mer avancerade testbänkar kan RTOS användas på mer komplex hårdvara. RTOS har begränsad funktionalitet för att garantera en hög förutsägbarhet. GPOS har stora mängder funktionaliteter men har istället en låg förutsägbarhet.Litteraturstudien undersökte därför möjligheterna till att få Linux att hantera realtid. Resultatet av litteraturstudien fann ett tillvägagångssätt vid namn Xenomai Cobalt att vara den optimala lösningen för att få Linux till Real-Time Linux.Xenomai Cobalt utvärderades på en RPi 3 med hjälp av dess GPIO-pinnar och ett fördröjningstest. En applikation skrevs med Xenomai’s API. Applikationen använde GPIO-pinnarna till att läsa från en funktionsgenerator och till att skriva till ett oskilloskop. Mätningarna från oskilloskopet jämfördes sen med applikationens mätningar.Resultatet visade mätskillnaderna mellan RPi 3 och oskilloskopet med systemet i viloläge. Resultatet av mätningarna visade att läsningen varierade med 66.20 µs och skrivandet med 56.20 µs. Fördröjningstestet utfördes medstresstestning och visade den värsta uppmätta fördröjningen, resultatet blev82 µs.De resulterande mätskillnaderna blev dock för höga för projektets krav. Majoriteten av mätningarna var mycket mindre än de värsta fallen med 23.52 µs för läsning och 34.05 µs för skrivning. Detta innebar att systemet kan användas med bättre precision som ett fast realtidssystem istället för ett hårt realtidssystem.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:kth-235484
Date January 2018
CreatorsJohansson, Gustav
PublisherKTH, Skolan för elektroteknik och datavetenskap (EECS)
Source SetsDiVA Archive at Upsalla University
LanguageEnglish
Detected LanguageEnglish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
Formatapplication/pdf
Rightsinfo:eu-repo/semantics/openAccess
RelationTRITA-EECS-EX ; 2018:179

Page generated in 0.002 seconds