Beaglebone RT test


I use the beaglebone black and I’ve installed Linux debian on it, whitch is a Real Time system (Linux beaglebone 4.4.6-bone-rt-r6 #1 PREEMPT RT Thu Mar 17 04:47:32 UTC 2016 armv7l GNU/Linux), and I want to test the characteristic of RT with cyclictest,

after using " cyclictest -p 90 - m -c 0 -i 200 -n -h 100 -q -l 10000", I got the results:

# Total: 000010000
# Min Latencies: 00012
# Avg Latencies: 00032
# Max Latencies: 00053
# Histogram Overflows: 00000
# Histogram Overflow at cycle number:
# Thread 0:

which means the average latencies is 32us, I want to know it is normal or not ? ( I think it is wired, with the RT patch, it should be better than it. )

And if should not be like this, is there something I missed?

Thanks everyone.

I’ve had no success running a 1 millisecond servo loop on Pandaboard, Beaglebone, and Raspberry Pi2. Attached is a POSIX real-time test program I wrote to compare /dev/spidev writes vs. toggling a GPIO pin to generate a 500 Hz square wave. Peak latencies were worse using /dev/spidev but all “broke” with missed deadlines and multiple millisecond latencies. I’d bet a lot against ever getting getting 100uS worst case latencies, but would love to be wrong.

If you don’t have /dev/spidev1.0 in your device-tree overlay, I think all you’ll need to do is comment out lines 264.265, & 266 that open /dev/spidev1.0 and run the program with no arguments which will have it attempt to create a 500 Hz square wave on GPIO0_7, connector P9 pin 42 (all the /dev/spidev writes will then never execute). it’ll run for five minutes and print out some stats at the end.

I haven’t tried it in about a year on anything newer than 4.1.x so please report back if you do get good results. The comments at the top explain how to build it. For my use I could have lived with about 1.5 mS worst case latency if it wasn’t too common.

cyclictest suggested my 1 mS servo loop should be feasible

Running cyclictest on my Pandaboard using a 3.4.x rt kernel from the Robot Operting System project:

panda@PandaES:~$ uname -a
Linux PandaES 3.4.0-rt17+ #2 SMP PREEMPT RT Thu Nov 15 13:51:22 CST 2012 armv7l armv7l armv7l GNU/Linux

panda@PandaES:~/rt-tests$ sudo ./cyclictest -p 90 -t1 -n -l 1000000

/dev/cpu_dma_latency set to 0us

policy: fifo: loadavg: 0.29 0.28 0.31 1/126 15826

T: 0 (15823) P:90 I:1000 C:1000000 Min: 9 Act: 11 Avg: 12 Max: 26

So add my voice to the chorus saying cyclic test is most likely not telling you anything useful for real applications.

swave_spidev_dt.c (12.2 KB)