Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ctucanfd_base.c #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

phantomrsw
Copy link

@phantomrsw phantomrsw commented Dec 27, 2024

Hello.
There is an error in the driver code, in the function ctucan_set_secondary_sample_point of the file ctucanfd_base.c.
According to the datasheet (see section 3.1.46 CTU_CANFD_Datasheet.pdf), Secondary Sampling Point is not used when SSP_SRC = 0b01. This is true when the bit rate is less than or equal to 1 Mbit/s. But if the CAN FD interface works with a higher data bit rate, for example 4 or 5 Mbit/s, then the transceiver delay value becomes significant and you need to use SSP_SRC = 0x0 or 0x2.
However, in the driver for bitrate greater than 1 Mbit/s
ssp_cfg |= FIELD_PREP(REG_TRV_DELAY_SSP_SRC, 0x1);

According to the datasheet (see section 3.1.46 CTU_CANFD_Datasheet.pdf), Secondary Sampling Point is not used when SSP_SRC = 0b01. This is true when the bit rate is less than or equal to 1 Mbit/s. But if the CAN FD interface works with a higher data bit rate, for example 4 or 5 Mbit/s, then the transceiver delay value becomes significant and you need to use
SSP_SRC = 0x0 or 0x2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant