Skip to content

drivers/can: Use 8 data bytes for classic messages with DLC 9..15. - #20938

Merged
acassis merged 1 commit into
apache:masterfrom
raiden00pl:can-char-classic-dlc
Oct 24, 2026
Merged

acassis merged 1 commit into
apache:masterfrom
raiden00pl:can-char-classic-dlc

Conversation

@raiden00pl

Copy link
Copy Markdown
Member

Summary

The character driver took the data length of every message from
can_dlc2bytes(), which with CONFIG_CAN_FD gives 12..64 bytes for DLC
9..15, also for classic frames.  write() of such a classic message with
its 8 data bytes then returned 0 without sending it, and can_receive()
copied up to 64 bytes from the 8-byte data of a classic lower half.
Use the CAN FD length only when ch_edl is set and 8 bytes otherwise;
the DLC itself is kept.  ctucanfd_pci, kvaser_pci and sim_canchar copy
8 bytes for these frames too.

Impact

bugfix

Testing

issue found with https://github.com/railab/nuttx-testlab

Comment thread drivers/can/ctucanfd_pci.c Resolved
Comment thread drivers/can/kvaser_pci.c Resolved
Comment thread drivers/can/can.c Resolved
@github-actions github-actions Bot added Arch: simulator Issues related to the SIMulator Area: Drivers Drivers issues Size: S The size of the change in this PR is small labels Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

The character driver took the data length of every message from
can_dlc2bytes(), which with CONFIG_CAN_FD gives 12..64 bytes for DLC
9..15, also for classic frames.  write() of such a classic message with
its 8 data bytes then returned 0 without sending it, and can_receive()
copied up to 64 bytes from the 8-byte data of a classic lower half.
Use the CAN FD length only when ch_edl is set and 8 bytes otherwise;
the DLC itself is kept.  ctucanfd_pci, kvaser_pci and sim_canchar copy
8 bytes for these frames too.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: raiden00pl <[email protected]>
@raiden00pl
raiden00pl force-pushed the can-char-classic-dlc branch from aa6d842 to c9d2513 Compare October 24, 2026 06:51
@xiaoxiang781216

Copy link
Copy Markdown
Contributor

let's ignore ci error which is fixed by #20960 instead wasting ci resource by retrigger.

xiaoxiang781216 added a commit to xiaoxiang781216/nuttx that referenced this pull request Oct 24, 2026
Remove the REVISIT preprocessor warning in max3421e_enumerate(). Its unquoted apostrophe is diagnosed as a missing terminating character literal, which becomes a build error under -Werror even when preprocessor warnings are disabled.

This fixes the stm32f103-minimum/usbhost CI failure reported in apache#20938 without changing runtime behavior.

Validated with git diff --check and tools/checkpatch.sh. Reproduced the original diagnostic with arm-none-eabi-gcc 13.2.1 on Linux; the removed directive no longer produces the diagnostic. No full board build or hardware runtime test was performed.

Assisted-by: Copilot SDK in VS Code
Signed-off-by: Xiang Xiao <[email protected]>
@acassis
acassis merged commit 6cdd3ea into apache:master Oct 24, 2026
47 of 52 checks passed
xiaoxiang781216 added a commit that referenced this pull request Oct 24, 2026
Remove the REVISIT preprocessor warning in max3421e_enumerate(). Its unquoted apostrophe is diagnosed as a missing terminating character literal, which becomes a build error under -Werror even when preprocessor warnings are disabled.

This fixes the stm32f103-minimum/usbhost CI failure reported in #20938 without changing runtime behavior.

Validated with git diff --check and tools/checkpatch.sh. Reproduced the original diagnostic with arm-none-eabi-gcc 13.2.1 on Linux; the removed directive no longer produces the diagnostic. No full board build or hardware runtime test was performed.

Assisted-by: Copilot SDK in VS Code
Signed-off-by: Xiang Xiao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: simulator Issues related to the SIMulator Area: Drivers Drivers issues Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants