[mcp251xfd] CANFD Issues

Post Reply
JackAE
Posts: 6
Joined: Mon Feb 05, 2024 11:27 am
languages_spoken: english
ODROIDs: C4
Has thanked: 2 times
Been thanked: 1 time
Contact:

[mcp251xfd] CANFD Issues

Post by JackAE »

I recently acquired two C4s and the CANFD add-on board, as they were listed as compatible devices.

The guide mentions the requirement of the upcoming 5.15 kernel, and despite my attempts, I've been unable to get it working.

I've tried using the stock 4.9 kernel and a 5.15 image from https://wiki.odroid.com/odroid-c4/gett ... oid-c4hc4 and https://docs.linuxfactory.or.kr/instal ... mage.html (listed as 20221115). Unfortunately, the MCP251xFD driver is not present in both instances after adjusting the config.ini in /media/boot/ and /boot/ respectively, as instructed by the wiki pages.

Despite following these steps, the MCP251xFD driver is still not present. I've double-checked the configurations, and everything seems correct. However, the driver is not loading as expected.

Here is the tutorial that I followed: https://wiki.odroid.com/accessory/add-o ... _odroid-c4

If anyone has experience with this setup or has successfully configured the MCP251xFD driver on an Odroid C4 with the CAN-FD add-on board, your insights would be greatly appreciated. Additionally, if there are specific steps or configurations that I might be overlooking, please point them out.

Kind regards, JackAE

steve.jeong
Posts: 279
Joined: Wed Dec 01, 2021 10:18 am
languages_spoken: english
Has thanked: 38 times
Been thanked: 87 times
Contact:

Re: [mcp251xfd] CANFD Issues

Post by steve.jeong »

please share the result of uname -a

For c4, the IR sensor that can cause short circuits between buses must be bent or removed.
These users thanked the author steve.jeong for the post:
JackAE (Wed Feb 07, 2024 5:24 am)

JackAE
Posts: 6
Joined: Mon Feb 05, 2024 11:27 am
languages_spoken: english
ODROIDs: C4
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: [mcp251xfd] CANFD Issues

Post by JackAE »

The result of

Code: Select all

uname -a
was

Code: Select all

Linux server 5.15.0-odroid-arm64 #1 SMP PREEMPT Ubuntu 5.15.74-202211101131~jammy (2022-11-10) aarch64 aarch64 aarch64 GNU/Linux
and the

Code: Select all

cat /boot/config.ini
is

Code: Select all

[generic]
#default_console=ttyAML0,115200n8
overlay_resize=16384
overlay_profile=""
overlays="spi0 i2c0 i2c1 canfd0"

[overlay_custom]
overlays="i2c0 i2c1"

[overlay_hktft32]
overlays="hktft32"

[overlay_hktft35]
overlays="hktft35 sx865x-i2c1"
I have bent the IR sensor so it is out of the way.

I appreciate your help so far!

steve.jeong
Posts: 279
Joined: Wed Dec 01, 2021 10:18 am
languages_spoken: english
Has thanked: 38 times
Been thanked: 87 times
Contact:

Re: [mcp251xfd] CANFD Issues

Post by steve.jeong »

Linux server 5.15.0-odroid-arm64 #1 SMP PREEMPT Ubuntu 5.15.74-202211101131~jammy (2022-11-10) aarch64 aarch64 aarch64 GNU/Linux
This kernel version does not support canfd.
Upgrade the version and try again.

Code: Select all

$ sudo apt update
$ sudo apt upgrade

JackAE
Posts: 6
Joined: Mon Feb 05, 2024 11:27 am
languages_spoken: english
ODROIDs: C4
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: [mcp251xfd] CANFD Issues

Post by JackAE »

Oh, I am having issues finding the kernel version that is supported. I have tried 4.9 with no success, and on the wiki for the C4 it says 5.15.x, and I have not yet tried 6.1.x.

I have just run both update and upgrade to no avail.

Are you aware of any kernel versions that are supported for the C4?


Screen Shot 2024-02-07 at 3.28.31 PM.png
Screen Shot 2024-02-07 at 3.28.31 PM.png (24.64 KiB) Viewed 230 times

steve.jeong
Posts: 279
Joined: Wed Dec 01, 2021 10:18 am
languages_spoken: english
Has thanked: 38 times
Been thanked: 87 times
Contact:

Re: [mcp251xfd] CANFD Issues

Post by steve.jeong »

1. Check the kernel version (The version must be at least 2023-10-24 or later.)

Code: Select all

$ uname -a
Linux server 5.15.0-odroid-arm64 #1 SMP PREEMPT Ubuntu 5.15.145-202401081659~jammy (2024-01-08) aarch64 aarch64 aarch64 GNU/Linux

2. Check the dtbo file has been added.

Code: Select all

$ ls -l /boot/dtbs/$(uname -r)/amlogic/overlays/odroidc4/canfd*
-rwxr-xr-x 1 root root 1179 Jan  8 09:44 /boot/dtbs/5.15.0-odroid-arm64/amlogic/overlays/odroidc4/canfd0.dtbo

3. Check if the module is initialized

Code: Select all

$ dmesg | grep mcp
[    4.840418] mcp251xfd spi0.0 can0: MCP2517FD rev0.0 (-RX_INT +MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD c:20.00MHz m:10.00MHz r:8.50MHz e:0.00MHz) successfully initialized.

4. Check whether the kernel module is loaded or not

Code: Select all

$  lsmod | grep mcp
mcp251xfd              49152  0
can_dev                36864  1 mcp251xfd
...

5. Check the CAN interface

Code: Select all

$ ifconfig can0
can0: flags=128<NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1024  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 44  
Please check if any parts look different from me

JackAE
Posts: 6
Joined: Mon Feb 05, 2024 11:27 am
languages_spoken: english
ODROIDs: C4
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: [mcp251xfd] CANFD Issues

Post by JackAE »

Okay, I will work on that now!

Thank you so much Steve, you are a legend!

As a last hoorah, are there any Ubuntu minimal/lts ODROID images with these kernel versions available for the C4, or will we need to build our kernel?

User avatar
tobetter
Posts: 12975
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 984 times
Been thanked: 2249 times
Contact:

Re: [mcp251xfd] CANFD Issues

Post by tobetter »

JackAE wrote:
Wed Feb 07, 2024 12:23 pm
As a last hoorah, are there any Ubuntu minimal/lts ODROID images with these kernel versions available for the C4, or will we need to build our kernel?
You are already working on the image with Linux kernel 5.15, which kernel version or image are you looking for?
These users thanked the author tobetter for the post:
JackAE (Wed Feb 07, 2024 12:55 pm)

JackAE
Posts: 6
Joined: Mon Feb 05, 2024 11:27 am
languages_spoken: english
ODROIDs: C4
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: [mcp251xfd] CANFD Issues

Post by JackAE »

I want a kernel 5.15 that has the drivers to use the CAN FD extension, so a version that is at least from 2023-10-24 or later as Steve previously mentioned.

Thanks!

steve.jeong
Posts: 279
Joined: Wed Dec 01, 2021 10:18 am
languages_spoken: english
Has thanked: 38 times
Been thanked: 87 times
Contact:

Re: [mcp251xfd] CANFD Issues

Post by steve.jeong »

JackAE wrote:
Wed Feb 07, 2024 11:33 am
I have just run both update and upgrade to no avail.
If you upgrade, it will be the latest version (2024-01-08)
Did you upgrade and reboot?

JackAE
Posts: 6
Joined: Mon Feb 05, 2024 11:27 am
languages_spoken: english
ODROIDs: C4
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: [mcp251xfd] CANFD Issues

Post by JackAE »

Thanks for your help Steve.

We ended up reflashing the device and then I apt upgraded and updated and it worked!

Thank you so much for your help!
These users thanked the author JackAE for the post:
steve.jeong (Thu Feb 08, 2024 10:56 am)

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 2 guests