0

I use the USBtin via socketcan by plugging in the device and executing can-utils on CentOS

sudo slcan_attach -f -s3 -o /dev/ttyACM0
sudo slcand ttyACM0 can0
sudo ip link set up can0

Then I check ifconfig

can0: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

and I can use it just like every other CAN device

I set up a OD basic enough to compile the repository.

I have 2 devices, one with the USBtin and one Pi with another shield. While latter prints out the message as expected, I get a segmentation fault with USBtin

Pi output when executing ./canopend can0 -i 4

./canopend[5490]: CANopen device, Node ID = 0x00, starting
./canopend[5490]: CAN Interface "can0" RX buffer set to 477 messages (212992 Bytes)
./canopend[5490]: CANopen NMT state changed to: "initializing" (0)
./canopend[5490]: CANopen device, Node ID = 0x04, communication reset
./canopend[5490]: CANopen device, Node ID = 0x04, running ...
./canopend[5490]: CANopen NMT state changed to: "pre-operational" (127)
./canopend[5490]: CANopen Emergency message from node 0x04: errorCode=0x5000, errorRegister=0x01, errorBit=0x2F, infoCode=0x00000004

Device with USBtin output when executing ./canopend can0 -i 1

./canopend[4722]: CANopen device, Node ID = 0x00, starting
./canopend[4722]: CAN Interface "can0" RX buffer set to 477 messages (212992 Bytes)
./canopend[4722]: (main) CANopen error in CO_CANopenInit(), err=-1
./canopend[4722]: CANopen device, Node ID = 0x01, finished
Segmentation fault (core dumped)

I was able to pin down the problem to the CO_GTWA_init() which is part of the CiA 309 standard implementation.

As I did not set any flags regarding the 309, the default flags will have been defined in CO_driver_target enter image description here

As I did not define any GTW Config for the Pi either I wonder if the cause for the problem is not the missing GTW settings but the default GTW settings due to the slcan might requiring a specific configuration differently to the default socketcan?

As I do not have access to the CiA 309 and I don't intend to use it, I wonder if I must get 309 due to the USBtin?

Does anyone know something about this problem?

spaceKelan
  • 67
  • 7

0 Answers0