pcan error logs/handling
Posted: Thu 24. Nov 2016, 14:10
I'm using peak linux driver 8.1.0 with socketCAN on openleap 42.1 and initialized a can0 interface.
I have an app that writes to can mutlple times per second.
In irregular intervals i get errors that cause the bus to go off after some time.
With cat /proc/pcan i can see the current can status but it would be nice to know which message can-id caused a error.
i check for error flags after write and read but get no output.
cat /proc/pcan after bus switched off:
I have an app that writes to can mutlple times per second.
In irregular intervals i get errors that cause the bus to go off after some time.
With cat /proc/pcan i can see the current can status but it would be nice to know which message can-id caused a error.
i check for error flags after write and read but get no output.
Code: Select all
...
else if (frame.can_id & CAN_ERR_TRX)
{
std::cout << frame.can_id << "CAN_EFF_FLAG" << std::endl;
}
else if (frame.can_id & CAN_ERR_BUSERROR)
{
std::cout << frame.can_id << "CAN_RTR_FLAG" << std::endl;
}
else if (frame.can_id & CAN_ERR_FLAG)
...
*------------- PEAK-System CAN interfaces (http://www.peak-system.com) -------------
*------------- Release_20160608_n (8.1.0) Sep 30 2016 10:23:07 --------------
*---------- [mod] [isa] [pci] [pec] [dng] [par] [usb] [pcc] [net] -----------
*--------------------- 1 interfaces @ major 245 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
0 pci can0 d4000000 016 0x0014 000545a5 00015d22 0005f3d8 0000000f 0x001c