I am in the process of upgrading from 32-bit/Xenomai 2.6.4/Ubuntu 14.04.4/
Linux 3.16.7 to 64-bit/Xenomai 3.1/Ubuntu 20.04.1/Linux 5.4.77 and I'm
experiencing an rtserial event difference in behavior. Our application
depends on single-byte interrupts from rtserial ports, which we're
not seeing despite having configured rtserial ports the same between our 2
different image configurations that run on the same x86 hardware.
Attached is a modified cross-link.c example that highlights this
difference in behavior. Also included is relevant detail for each target,
build, and sample program output.

My modified cross-link.c transmits 26 characters every 1 second and prints
the number of RX_PEND events along with reception bins every 26 characters
read by the receive thread. Reception bins show the number of bytes
read per RX_PEND event [0-16,17+]. The total number of bytes
processed equals the sum of all bins multiplied by the quantity they
represent. For example, these snipped outputs (from the below greater
details) were taken following a total of 208 bytes transmitted. In
2.6.4 we have 208 events * 1 byte = 208 bytes and in 3.1 we have
48 events * 4 bytes + 8 events * 2 bytes = 208 bytes. We expect/desire the
second bin to be exclusively non-zero (2.6.4 output), indicating an RX_PEND
event for each byte that arrives on the serial port.

2.6.4 Output:
rx.events=1  | rx.rx_pending=1 | r_t=1618404168709819446
Count= 208 bins=0 208 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3.1 Output:
rx.events=1  | rx.rx_pending=2 | r_t=1618406767806828954
Count=  56 bins=0 0 8 0 48 0 0 0 0 0 0 0 0 0 0 0 0 0

I'm not sure where to take the next level of troubleshooting and am happy to
provide additional detail, run tests, etc. The attached cross-link includes
some preprocessor defines to modify program behaviors that I can explain if
helpful. Details shown below are also attached with line wrapping removed
for reference.

Thanks!
Alan

::32-bit System Details::
-BOOT_IMAGE=/boot/vmlinuz-3.16.7 root=UUID=1bfa0993-a88b-4a77-be72-0f1531acf3fa
ro quiet splash 8250.nr_uarts=4 xeno_hal.smi=-1 consoleblank=0 vt.handoff=7
-Xenomai retrieved from
https://www.xenomai.org/downloads/xenomai/stable/xenomai-2.6.4.tar.bz2
-config.log first 14 lines :
  It was created by Xenomai configure 2.6.4, which was
  generated by GNU Autoconf 2.69.  Invocation command line was

    $ ../configure --prefix=/home/delta/kernel/xenomai-libs --enable-x86-sep 
CFLAGS=-O3

  ## --------- ##
  ## Platform. ##
  ## --------- ##

  hostname = delta
  uname -m = i686
  uname -r = 3.16.7
  uname -s = Linux
  uname -v = #1 SMP Sun Jul 26 11:10:00 EDT 2015
-Ipipe patch retrieved from
https://www.xenomai.org/downloads/ipipe/v3.x/x86/older/ipipe-core-3.16.7-x85-5.patch
::32-bit Example Build::
gcc -o cross-link cross-link.c
-I/home/jbw/GitWorkTree/master/Development/Cobalt/include
-D_GNU_SOURCE -D_REENTRANT -D__XENO__
-I/home/jbw/GitWorkTree/master/Development/Cobalt/include
-D_GNU_SOURCE -D_REENTRANT -D__XENO__ -lrtdm
-L/home/jbw/GitWorkTree/master/Development/Cobalt/lib -lxenomai -lpthread -lrt 
-lnative
-L/home/jbw/GitWorkTree/master/Development/Cobalt/lib -lxenomai -lpthread -lrt
::32-bit Example Execution::
main : write-file opened
main : write-config written
main : read-file opened
main : read-config written
main : read-config gotten
main : write-task created
main : read-task created
main : starting write-task
main : starting read-task

Built for Xenomai 2.6.4
Write task sends 26 chars every 1.00 s
Printing on message size modulus of 26
Baud Rate = 115200
fifo_depth written = 0, fifo_depth received = 0
rx timeout written = 4294967295, rx timeout received = 4294967295
event timeout written = 0, event timeout received = 0

rx.events=1  | rx.rx_pending=1 | r_t=1618404161709825071
Count=  26 bins=0 26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=1 | r_t=1618404162709820540
Count=  52 bins=0 52 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=1 | r_t=1618404163709821237
Count=  78 bins=0 78 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=1 | r_t=1618404164709821910
Count= 104 bins=0 104 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=1 | r_t=1618404165709817391
Count= 130 bins=0 130 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=1 | r_t=1618404166709818064
Count= 156 bins=0 156 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=1 | r_t=1618404167709818773
Count= 182 bins=0 182 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=1 | r_t=1618404168709819446
Count= 208 bins=0 208 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
::64-bit Target Details::
Xenomai version: Xenomai/cobalt v3.1 -- #932fc81c4 (2021-03-06 09:12:44 +0100)
Linux delta 5.4.77-Cobalt-v6 #1 SMP PREEMPT Wed Apr 7 16:51:16 EDT 2021
x86_64 x86_64 x86_64 GNU/Linux
Kernel parameters: BOOT_IMAGE=/boot/vmlinuz-5.4.77-Cobalt-v6
root=UUID=147f0e74-99ca-4816-9e22-4c3f4f5e8c66 ro isolcpus=1
xenomai.supported_cpus=0x01 splash quiet 8250.nr_uarts=4
xenomai.smi=enabled fsck.mode=force vt.handoff=7
I-pipe release #2 detected  (retrieved from: 
https://www.xenomai.org/downloads/ipipe/v5.x/x86/ipipe-core-5.4.77-x86-2.patch)
Cobalt core 3.1 detected
Compiler: gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
Build args: --prefix=/home/delta/kernel/xenomai-libs --with-core=cobalt
--enable-smp --enable-pshared --enable-debug=symbols
::64-bit Build::
gcc -o cross-link cross-link.c
-I/home/jbw/GitWorkTree/sandbox/Development/Cobalt/include/cobalt
-I/home/jbw/GitWorkTree/sandbox/Development/Cobalt/include -D_GNU_SOURCE
-D_REENTRANT -fasynchronous-unwind-tables -D__COBALT__
 -I/home/jbw/GitWorkTree/sandbox/Development/Cobalt/include/alchemy
 -D__COBALT_WRAP__ -Wl,--no-as-needed
 -Wl,@/home/jbw/GitWorkTree/sandbox/Development/Cobalt/lib/cobalt.wrappers
-Wl,@/home/jbw/GitWorkTree/sandbox/Development/Cobalt/lib/modechk.wrappers
-lalchemy -lcopperplate
/home/jbw/GitWorkTree/sandbox/Development/Cobalt/lib/xenomai/bootstrap.o
-Wl,--wrap=main
 
-Wl,--dynamic-list=/home/jbw/GitWorkTree/sandbox/Development/Cobalt/lib/dynlist.ld
-L/home/jbw/GitWorkTree/sandbox/Development/Cobalt/lib -lcobalt -lmodechk
-lpthread -lrt
::64-bit Execution::
main : write-file opened
main : write-config written
main : read-file opened
main : read-config written
main : read-config gotten
main : write-task created
main : read-task created
main : starting write-task
main : starting read-task

Built for Xenomai 3.1
Write task sends 26 chars every 1.00 s
Printing on message size modulus of 26
Baud Rate = 115200
fifo_depth written = 0, fifo_depth received = 0
rx timeout written = 18446744073709551615, rx timeout received = 
18446744073709551615
event timeout written = 0, event timeout received = 0

rx.events=1  | rx.rx_pending=2 | r_t=1618406760806831175
Count=   7 bins=0 0 1 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=2 | r_t=1618406761806831122
Count=  14 bins=0 0 2 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=2 | r_t=1618406762806833636
Count=  21 bins=0 0 3 0 18 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=2 | r_t=1618406763806825651
Count=  28 bins=0 0 4 0 24 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=2 | r_t=1618406764806828562
Count=  35 bins=0 0 5 0 30 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=2 | r_t=1618406765806828508
Count=  42 bins=0 0 6 0 36 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=2 | r_t=1618406766806829031
Count=  49 bins=0 0 7 0 42 0 0 0 0 0 0 0 0 0 0 0 0 0
rx.events=1  | rx.rx_pending=2 | r_t=1618406767806828954
Count=  56 bins=0 0 8 0 48 0 0 0 0 0 0 0 0 0 0 0 0 0

PRIVACY NOTICE: The information contained in this e-mail, including any 
attachments, is confidential and intended only for the named recipient(s). 
Unauthorized use, disclosure, forwarding, or copying is strictly prohibited and 
may be unlawful. If you are not the intended recipient, please delete the 
e-mail and any attachments and notify us immediately by return e-mail.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cross-link.c
URL: 
<http://xenomai.org/pipermail/xenomai/attachments/20210420/690665c9/attachment.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: DetailsLessLineWrapping.txt
URL: 
<http://xenomai.org/pipermail/xenomai/attachments/20210420/690665c9/attachment.txt>

Reply via email to