RTCan missing frames

Johannes Holtz johannes.holtz at compador.de
Tue Feb 12 12:35:33 CET 2019


Am 12.02.19 um 12:24 schrieb Wolfgang Grandegger:
> Hello,
>
> Am 12.02.19 um 11:42 schrieb Johannes Holtz:
>> Am 11.02.19 um 17:46 schrieb Wolfgang Grandegger:
> ... snip ...
>>> UI suggest to write a simple test program to demonstrate the issue. It
>>> should just open the socket and trying to receive messages... just the
>>> necessary stuff. First with a blocking recv() and then non-blocking.
>>>
>>> What hardware and software are you using (arch, board, linux, xenomai)?
> ?
>
>>> Wolfgang.
>> The source code is attached:
>>
>> compiled with -I/opt/xenomai/include -D_GNU_SOURCE -D_REENTRANT
>> -D__XENO__ -lrtdm -L/opt/xenomai/lib -lxenomai -lpthread -lrt -lnative
>>
>> can frames sent by rtcansend
>>
>> Test 1: blocking:
>>
>> ID:0 DLC:2hex:  81 00       <-- NMT request
>> ID:709 DLC:1hex:  00        <-- answer node #9
>> ID:708 DLC:1hex:  00        <-- answer node #8
>> ID:703 DLC:1hex:  00        <-- answer node #3
>> ID:705 DLC:0hex:             <-- here it gets weird ! DLC == 0
>> ID:70400 DLC:1hex:  01
>> ID:70600 DLC:1hex:  01
>> ID:70100 DLC:1hex:  01
>> ID:70200 DLC:1hex:  01
>> ID:1010000 DLC:1hex:  08
> This means that you can receive messages from the CAN bus.
>
>> ID:53220 DLC:124 out of bounds. abort.
> But that's wired.
>
>> Test 2: non blocking:
>>
>> ID:0 DLC:2hex:  81 00    <-- NMT request
>> ID:709 DLC:1hex:  00     <-- answer node #9
>> ID:708 DLC:1hex:  00     <-- answer node #8
>> ID:703 DLC:1hex:  00     <-- answer node #3
>> ID:705 DLC:0hex:          <-- same issue DLC is 0
>> ID:70600 DLC:1hex:  01
>> ID:70400 DLC:1hex:  01
>> ID:70200 DLC:1hex:  01
>> ID:70100 DLC:1hex:  01
>> ID:1010000 DLC:1hex:  08
>> ID:53220 DLC:124 out of bounds. abort.
> Looks identical.
>
>> Also, I found another possible error source and I don't know if this
>> error picture would corresponds to this.
>>
>> However,  While reviewing all settings, I noticed that I made a mistake
>> with the RXBUF_SIZE which is set to 8096 instead of 8192. Must have been
>> asleep when writing this. I'm going to rebuild this module.
> Let's try to understand why rt_dev_recv() does return bogus dlc.
>
> What hardware and software are you using (arch, board, can controlelr,
> linux, xenomai)?
>
> Wolfgang.


root at machinectrl:~# uname -a

Linux machinectrl 3.8.13-intel-atom #3 SMP Wed Jan 2 11:56:35 CET 2019 
i686 GNU/Linux

root at machinectrl:~# xeno-config --version
2.6.4
root at machinectrl:~# cat /proc/rtcan/rtcan0/info
Device     rtcan0
Controller SJA1000
Board      EMS-CPC-PCI
Clock-Hz   8000000
Baudrate   1000000
Bit-time   brp=1 prop_seg=2 phase_seg1=3 phase_seg2=2 sjw=1 sam=1
Ctrl-Mode
State      active
TX-Counter 27
RX-Counter 167
Errors     0
Refcount   0

[    3.171332] RT-Socket-CAN 0.90.2 - (C) 2006 RT-Socket-CAN Development 
Team
[    3.172383] RTCAN SJA1000 driver initialized
[    3.173287] rtcan: registered rtcan0
[    3.173351] EMS-CPC-PCI-CAN 0000:07:02.0: Channel #1 at 0xf84fa400, 
irq 17 registered as rtcan0
[    3.173450] rtcan: registered rtcan1
[    3.173508] EMS-CPC-PCI-CAN 0000:07:02.0: Channel #2 at 0xf84fa600, 
irq 17 registered as rtcan1





More information about the Xenomai mailing list