Hello, I reverse engineered a dts overlay for BeagleBone AI-64 from the overlays in this repository, for the MAIN_MCAN0 interface like this:
BONE-CAN0.dts made by me
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2022 BeagleBoard.org - https://beagleboard.org/
*
* https://elinux.org/Beagleboard:BeagleBone_cape_interface_spec#CAN
*/
/dts-v1/;
/plugin/;
/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
&{/chosen} {
overlays {
BONE-CAN0.kernel = __TIMESTAMP__;
};
};
&bone_can_0 {
status = "okay";
};
my definition of the bone_can_0
in the file k3-j721e-beagleboneai64-bone-buses.dtsi from the above mentioned repo
bone_can_0: &main_mcan0 {
pinctrl-names = "default";
pinctrl-0 = <
&P9_19_can_pin /* mcan0_rx */
&P9_20_can_pin /* mcan0_tx */
>;
symlink = "bone/can/0";
status = "disabled";
};
With these changes I installed the whole repo with the sudo make install_arm64
to my Beagle. Then, I edited the file extlinux.conf in the directory /boot/firmware/extlinux/
like this
label Linux eMMC
kernel /Image
append console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait net.ifnames=0
fdtdir /
fdtoverlays /overlays/BONE-CAN0.dtbo
initrd /initrd.img
then saved and rebooted the Beagle. After that I checked ifconfig -a
where I saw, that the MAIN_MCAN0 interface is seen by the Beagle as can0
. Since can0
was down I set it up with commands
sudo ip link set can0 up type can bitrate 1000000 dbitrate 8000000 restart-ms 1000 berr-reporting on fd on
sudo ifconfig can0 txqueuelen 65536
Finally, I connected the interface to a CAN bus over a CAN transciever and tested it with utilities candump
and cansend
. The interface seems to work correctly.
The issue is, that the symlink I defined in the file k3-j721e-beagleboneai64-bone-buses.dtsi for the bone_can_0
, doesn’t show up in my Beagle’s directory /dev/bone/
. I tested this with other overlays that were in the repo originally, like the overlay BONE-UART1.dts and BONE-I2C1.dts and for them there is an entry. So I must be doing something wrong. Unfortunately I have no idea what.
Thank you for any advice in advance.