Pigeon
  • Home
  • Products
  • Quotation Request
  • Documentation
  • News
  • About us
  • Contact us
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu
News

Pigeon RB100-CM3 real-time tests

Software

This page aims to present the real-time tests of Pigeon RB100-CM3.

Global setup

During the test, we used the Pigeon RB100-CM3 with the latest available Raspbian Lite (2017-04-10) installed and a kernel with PREEMPT_RT patches (kernel version 4.4.50-rt63-v7+).

Real-time tests are meaningful only under heavy stress to guarantee the identification of worst-case latencies. The following tools were used to stress the system:

  • stress --cpu 4,
  • ping -f IP_ADDRESS.

Latency from external signal

This test reproduces a common use case. The first GPIO works as input (GPIO1) and the second GPIO is output (GPIO0). Output state changes according to input. The wiring diagram is shown below.

rt-test-schematic

The oscilloscope was set to trigger a rising edge on CH1. During all measurements, the oscilloscope had the 'Persist' option set to 'Infinity' to find worst-case latencies. In all the following oscilloscope snapshots, the input GPIO signal is yellow and the output GPIO signal is blue.

User space pool GPIO

In user space to make the test we use simple pool GPIO example software with processor direct register access [1]. The main loop looks like below

while (1)
{
if (GET_GPIO(GPIO_NR_IN))
GPIO_SET = 1;
else
GPIO_CLR = 1;
}

First, we made the measurement for non real-time policy [2] and no load. On the following oscilloscope snapshot, we can see what we get after 20 minutes: policy = SCHED_OTHER, priority = 0, no stress, time base = 100 us.

NewFile8

It doesn't look bad – the maximum latency is about 50us. Let's see what happens when we add stress. On the following oscilloscope snapshot, we can see what we get after 5 minutes: policy = SCHED_OTHER, priority = 0, stress on, time base = 100 us.

NewFile9

Now it looks hopeless. Maximum latency is greater than 500us.

Next, we made the measurement for real-time policy and stress. On the following oscilloscope snapshot, we can see what we get after 3 hours: policy = SCHED_FIFO, priority = 99, stress on, time base = 100 us.

NewFile10

In this case, maximum latency is below 50us - very good result.

User space interrupt

For user-space interrupt measurement, we use the WiringPi library [3] :

wiringPiISR(GPIO_NR_IN, INT_EDGE_BOTH, &gpio_int)

The gpio_int function looks like this:

void gpio_int(void)
{
if (digitalRead(GPIO_NR_IN))
digitalWrite(GPIO_NR_OUT, 1);
else
digitalWrite(GPIO_NR_OUT, 0);
}

In the following oscilloscope snapshot, we can see what we get after 2 hours: policy = SCHED_RR, priority = 55, stress on, time base = 100 us. Note. WiringPi library sets thread (interrupt handler) policy to SCHED_RR and priority to 55 (see InterruptHandler function in the file wiringPi.c).

NewFile12

As you can see from the above oscilloscope snapshot, the maximum latency in this case is about 240us.

Kernel space interrupt GPIO

For the kernel-space test, we use a kernel module written by Marcin Bis [4] with little modification of pins definitions. This module uses GPIO interrupt. On the following oscilloscope snapshot, we can see what we get after 5 hours: policy = SCHED_FIFO (default for interrupt), priority = 50 (default for interrupt), stress on, time base = 100 us.

NewFile11

In this case, the maximum latency is about 110us. It is possible to increase the priority of the interrupt (chrt command), but we did not notice a significant reduction in maximum latency in this case.

Timer latency

This test measures latency using cyclictest [5], a high-resolution test program. It is part of the test suite rt-tests [6]. To create a latency plot from cyclictest histogram data, we used the mklatencyplot.bash script [7]. In the following chart, we can see what we get after five hours:

plot

Links

[1] http://elinux.org/RPi_GPIO_Code_Samples#Direct_register_access

[2] https://wiki.linuxfoundation.org/realtime/documentation/technical_basics/sched_policy_prio

[3] http://wiringpi.com/reference/priority-interrupts-and-threads/

[4] https://github.com/marcinbis/mb-rt-data/blob/master/rt-tests/01_inout.c

[5] https://rt.wiki.kernel.org/index.php/Cyclictest

[6] https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/rt-tests

[7] https://www.osadl.org/Create-a-latency-plot-from-cyclictest-hi.bash-script-for-latency-plot.0.html

June 20, 2017/by admin
https://pigeoncomputers.com/wp-content/uploads/2015/03/logo_tylko_napis1-300x66.png 0 0 admin https://pigeoncomputers.com/wp-content/uploads/2015/03/logo_tylko_napis1-300x66.png admin2017-06-20 10:30:142025-04-09 10:28:45Pigeon RB100-CM3 real-time tests
Search Search

Pages

  • Home
  • Products
  • Quotation Request
  • Documentation
  • News
  • About us
  • Contact us

Where to find us

KRISTECH
Porzeczkowa 12
43-450 Ustron
Poland

© 2004-2026 KRISTECH. All rights reserved
  • Terms of cooperation
  • Privacy policy
Link to: New Raspbian images with real-time support Link to: New Raspbian images with real-time support New Raspbian images with real-time support Link to: Open source C library Link to: Open source C library Open source C library
Scroll to top Scroll to top Scroll to top
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}