Meaning of yarp::dev::CanErrors struct members #381
-
Hello. I'm having a hard time understanding the meaning of the struct members in class YARP_dev_API yarp::dev::CanErrors
{
public:
CanErrors() { /* ... */ }
int txCanErrors; //can device tx errors
int rxCanErrors; //can device rx errors
bool busoff; //bus off
unsigned int rxCanFifoOvr; // can device rx overflow
unsigned int txCanFifoOvr; // can device tx overflow
unsigned int txBufferOvr; // tx buffer overflow
unsigned int rxBufferOvr; // rx buffer overflow
}; What is the difference between the The only usage I found across robotology's codebase is PlxCan.cpp and CanBusMotionControl.cpp, both at robotology/icub-main. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
As indicated at http://wiki.icub.org/wiki/PC104_Linux_Image_-_Support_for_version_prev_5.0#Device_Drivers, inside an iCub 104 image (e.g. http://www.icub.org/download/pc104-images/image1.8-oc.img.tar.bz2 which I downloaded, uncompressed, mounted, and typedef struct _PLXCAN_MSG
{
long id;
unsigned char len;
unsigned char data[8];
// int32_t id;
// uint8_t len;
// uint8_t data[8];
} PLXCAN_MSG;
//typedef PLXCAN_MSG CMSG;
typedef struct _PLXCAN_ERRORS
{
unsigned int canOvr;
unsigned int errors;
int busoff;
unsigned int outputBuffOvr;
unsigned int inputBuffOvr;
} PLXCAN_ERRORS; Unfortunately, I have not been able to find the source code of On the hardware side and trying to make sense of this, "http://wiki.icub.org/wiki/CFW_card + schematics" confirm the " |
Beta Was this translation helpful? Give feedback.
-
From the SJA1000 datasheet:
Still, the source code of |
Beta Was this translation helpful? Give feedback.
-
This is quite a peculiar request. Is there anyone into CAN and our related code who's able to give an answer? Maybe @randaz81 ? |
Beta Was this translation helpful? Give feedback.
-
It has been a long long time, but if a remember correctly the rxCanFifo/txCanFifo refer to the small buffers inside the device, whereas the txBuffer/rxBuffer are the ones between the CPU and the device. The CanFifo buffers are managed by the device and overflow should not occur, whereas the txBuffer/rxBuffer are managed by the driver, overflow may occur if the CPU does not read messages quickly enough (rxBufferOvr) of it it write messages too quickly (txBufferOvr). This should be how the Plx driver works. The CFW is more complicated but these error messages are mapped in a similar way. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much, @lornat75, that explains a lot. And thank you @jgvictores for your research! My question has been answered, this issue can be closed now. |
Beta Was this translation helpful? Give feedback.
It has been a long long time, but if a remember correctly the rxCanFifo/txCanFifo refer to the small buffers inside the device, whereas the txBuffer/rxBuffer are the ones between the CPU and the device.
The CanFifo buffers are managed by the device and overflow should not occur, whereas the txBuffer/rxBuffer are managed by the driver, overflow may occur if the CPU does not read messages quickly enough (rxBufferOvr) of it it write messages too quickly (txBufferOvr).
This should be how the Plx driver works. The CFW is more complicated but these error messages are mapped in a similar way.