Jump to content

entable CAN bus


Antillanca

Recommended Posts

@Antillanca you can check out this thread:


Or continue reading here, i'll explain it.
You need to change a few parameters in the boot environment:
sudo armbian-config -> System -> Bootenv
or you can edit the /boot/armbianEnv.txt directly.

Once you are there you need to change the overlay_prefix to:

overlay_prefix=rockchip-rk3588-opi5


Then you need to find the names of overlays, you can get them by running the following in your terminal:

ls -l /boot/dtb/rockchip/overlay

Scroll down and you will see:
pi-overlays.png


So if you want CAN bus and i2c then your Bootenv overlays should look like this:

overlay_prefix=rockchip-rk3588-opi5
overlays=can1-m1 can2-m1 i2c1-m2 i2c1-m4 i2c3-m0 i2c5-m3

Restart your OPi5 for changes to take effect.

If you need wiringPI:

Spoiler

you can currently get it from: https://github.com/orangepi-xunlong/wiringOP/tree/next
(master still doesn't have support for OPi5, next branch does hence why the link to "next")
ReadME doesn't have "gpio read all" for OPi5 so here you go:
OPi5-gpio-readall.png


I have not personally tried CAN bus but it should work, I have tested i2c-1 and it works properly.

Link to comment
Share on other sites

I've been using CAN on mine for a while, it's pretty solid. Though I made my own overlay (I'm still running a testing image which doesn't seem to have come with the can overlays)

 

For the can1-m1 pins:

 

/dts-v1/;
/plugin/;
/ {
        fragment@0 {
                target = <&can1>;

                __overlay__ {
                        status = "okay";
                        pinctrl-0 = <&can1m1_pins>;
                        assigned-clock-rates = <0x1dcd6500>;
                };
        };
};

 

(note I increased the clockrate to 500MHz there, the default is 200MHz. Dunno if there's any harm, but I've been running like that for a few months without issue)

Edited by terranx
Link to comment
Share on other sites

CAN won't show up in /dev. You'll need to lookup how to setup socketcan stuff. But if you're seeing those dmesg messages, the actual bus is enabled. Annoyingly it does flood dmesg with those messages

 

image.thumb.png.802c9a59ea3bf6a2427dbdc7e4e3d2f6.png

 

image.thumb.png.4161c0d7266bef1ebc2fc85b6cf14d46.png

 

image.thumb.png.0ac664bb8ee3fc4f2832a9f2da099acc.png

Edited by terranx
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines