CAN driver message structure

Prashanth S fishesprashanth at gmail.com
Tue Apr 12 00:40:02 UTC 2022


Hi All,

This is to query on CAN message format for CAN drivers.

I want to implement a CAN driver for BeagleBone Black in RTEMS(GSoC).

As I looked through the RTEMS Source Tree, found
https://devel.rtems.org/browser/rtems/bsps/arm/lpc176x/can
<https://www.google.com/url?q=https://devel.rtems.org/browser/rtems/bsps/arm/lpc176x/can&sa=D&source=docs&ust=1649726382869937&usg=AOvVaw3vJP6V_BiCCjzC3q-F4AH1>
, https://devel.rtems.org/browser/rtems/bsps/powerpc/gen5200/mscan
<https://www.google.com/url?q=https://devel.rtems.org/browser/rtems/bsps/powerpc/gen5200/mscan&sa=D&source=docs&ust=1649726382870043&usg=AOvVaw3i4_IK73l4WoZ7u64ab0yB>
CAN drivers, which have driver specific CAN message structure.

https://devel.rtems.org/browser/rtems/bsps/powerpc/gen5200/include/bsp/mscan.h
struct can_message {
  /* uint16_t mess_len; */
  uint16_t mess_id;
  uint16_t mess_time_stamp;
  uint8_t  mess_data[MSCAN_MAX_DATA_BYTES];
  uint8_t  mess_len;
  uint8_t  mess_rtr;
  uint32_t toucan_tx_idx;
};

https://devel.rtems.org/browser/rtems/bsps/arm/lpc176x/include/bsp/can.h
typedef union {
  low_level_can_message low_level;
  registers_can_message registers;
 } can_message;

I would like to know if I should define a driver dependent CAN message
structure or use one of the existing ones.

Ideally, I think a generic (driver independent) CAN message structure will
help applications to be portable.

Regards
Prashanth S


More information about the devel mailing list