diff --git a/arch b/arch index 52f459de149..393a1dcf68b 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 52f459de149c45a4cd7a7758b350167a400375f3 +Subproject commit 393a1dcf68b3571f39a28f9b9e87843eedb77df8 diff --git a/configs b/configs index bba0b5c9b5e..86d7dde23be 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit bba0b5c9b5e62c8d1f8d69cdd96c960e042bf82c +Subproject commit 86d7dde23be4b04331c58cc12c13ce381151ab9e diff --git a/drivers/can.c b/drivers/can.c index 4f2e5f95440..f52ccae555c 100644 --- a/drivers/can.c +++ b/drivers/can.c @@ -811,7 +811,15 @@ int can_receive(FAR struct can_dev_s *dev, FAR struct can_hdr_s *hdr, if (nexttail != fifo->rx_head) { - /* Add the new, decoded CAN message at the tail of the FIFO */ + /* Add the new, decoded CAN message at the tail of the FIFO. + * + * REVISIT: In the CAN FD format, the coding of the DLC differs from + * the standard CAN format. The DLC codes 0 to 8 have the same coding + * as in standard CAN, the codes 9 to 15, which in standard CAN all + * code a data field of 8 bytes, are encoded: + * + * 9->12, 10->16, 11->20, 12->24, 13->32, 14->48, 15->64 + */ memcpy(&fifo->rx_buffer[fifo->rx_tail].cm_hdr, hdr, sizeof(struct can_hdr_s)); for (i = 0, dest = fifo->rx_buffer[fifo->rx_tail].cm_data; i < hdr->ch_dlc; i++) diff --git a/include/nuttx/can.h b/include/nuttx/can.h index 98ce0e416cd..d22a2b8bc30 100644 --- a/include/nuttx/can.h +++ b/include/nuttx/can.h @@ -167,7 +167,7 @@ struct can_hdr_s #else struct can_hdr_s { - uint16_t ch_dlc : 4; /* 4-bit DLC */ + uint16_t ch_dlc : 4; /* 4-bit DLC. May be encoded in CAN_FD mode. */ uint16_t ch_rtr : 1; /* RTR indication */ uint16_t ch_id : 11; /* 11-bit standard ID */ } packed_struct;