This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compile dtbo for TinkerBoard (TinkerOS, mcp2515-can0-overlay.dts)
#21
(02-19-2018, 08:29 PM)Longbow Archer Wrote: Hi, I’m working on a complex system in which I want to use TinkerBoard and MCP2515 (pican2). I do exact the same way as here: CAN-Bus document but in ‘Setup CAN-Bus’ step I don’t have /net folder in  /sys/bus/spi/devices/spi2.0/  path.  Moreover I don’t see mcp2515-can0.dtbo file in my /boot/overlays. I tried to compile mcp2515-can0-overlay.dts but I get syntax error(unable to parse input tree). Can you give me some clue? I’m working on a 2.0.4 OS image.

Do you see the mcp2515-can0.dtbo file at the below path in your kernel folder ? 
{codebase}/kernel/arch/arm/boot/dts/overlays
Reply
#22
(02-19-2018, 11:10 PM)jamess Wrote:
(02-19-2018, 08:29 PM)Longbow Archer Wrote: Hi, I’m working on a complex system in which I want to use TinkerBoard and MCP2515 (pican2). I do exact the same way as here: CAN-Bus document but in ‘Setup CAN-Bus’ step I don’t have /net folder in  /sys/bus/spi/devices/spi2.0/  path.  Moreover I don’t see mcp2515-can0.dtbo file in my /boot/overlays. I tried to compile mcp2515-can0-overlay.dts but I get syntax error(unable to parse input tree). Can you give me some clue? I’m working on a 2.0.4 OS image.

Do you see the mcp2515-can0.dtbo file at the below path in your kernel folder ? 
{codebase}/kernel/arch/arm/boot/dts/overlays

No, I don't see mcp2515-can0.dtbo file in /kernel/arch/arm/boot/dts/overlays. Maybe its something wrong with kernel compiling? I compile kernel in this way.
Reply
#23
(02-20-2018, 09:46 AM)Longbow Archer Wrote: [quote pid='4741' dateline='1519081830']
No, I don't see mcp2515-can0.dtbo file in /kernel/arch/arm/boot/dts/overlays. Maybe its something wrong with kernel compiling? I compile kernel in this way.

[/quote]

We miss the following line of the build kernel SOP, sorry for the mistake.
$ make dtbs ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j16

I have also updated in the SOP. Thanks.
https://tinkerboarding.co.uk/wiki/index....are#Kernel
Reply
#24
(02-21-2018, 01:51 AM)jamess Wrote:
(02-20-2018, 09:46 AM)Longbow Archer Wrote: [quote pid='4741' dateline='1519081830']
No, I don't see mcp2515-can0.dtbo file in /kernel/arch/arm/boot/dts/overlays. Maybe its something wrong with kernel compiling? I compile kernel in this way.

We miss the following line of the build kernel SOP, sorry for the mistake.
$ make dtbs ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j16

I have also updated in the SOP. Thanks.
https://tinkerboarding.co.uk/wiki/index....are#Kernel
[/quote]

Everything is working now, thanks a lot!
Reply
#25
Hello, fro those who succeed bringing up CAN bus, can You please help me, I've started discussion in different topic of this forum:
https://tinkerboarding.co.uk/forum/threa...-8746.html
Reply
#26
@lefedor, that isn't a good practice. You might not get focus on any of those posts, as much as you disperse people attention.
Light blue words might be a link. Have you try to click on them? Big Grin
Reply
#27
Hi
I read all the posts of this thread but it doesn't work for me.
"dmesg | grep can0" gives me:
[ 2.198537] rockchip-pinctrl pinctrl: unable to find group for node can0_pins

Can someone help me?
Thank you
Reply
#28
Showing the operations that you've done and the errors, might be a better way to help you and catch some oversight of yours. We can't see anything from here.
Better text for what is a console output. You may use a SSH session for that and highlight and copy the screen over the forum.
If you have errors while booting, the USB-RS232 adapter would be the best tool for troubleshooting.
Light blue words might be a link. Have you try to click on them? Big Grin
Reply
#29
Hi!

I am using the MCP2515 CAN Module that works at Raspberry Pi 3 with the following instruction at /boot/config.txt
Code:
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=12
I have two devices connected at this CAN bus, sending data continuously that I can see with candump.

I am trying to migrate to Asus Tinker Board S.
I connected the MCP2515 CAN Module to Tinker Board S exactly as Raspberry Pi 3.

I think I am almost there but candump show anything yet.
At /sys/bus/spi/devices/spi2.0/net/ is available can0.
The interface can0 is up:

Code:
# ip -details -statistics link show can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
   link/can  promiscuity 0
   can state ERROR-ACTIVE restart-ms 0
 bitrate 125000 sample-point 0.875
 tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
 mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
 clock 8000000
...
#

At my /boot/hw_intf.conf I added intf:dtoverlay=mcp2515-can0:

Code:
# cat /boot/hw_intf.conf
...
intf:dtoverlay=mcp2515-can0
...

As it did not works I tried to pass the "oscillator" and "interrupt" arguments as below:
 intf:dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=12
After the reboot the Tinker Board freeze!
The only way to revert is by connecting the mini-USB cable on the PC and revert the instruction above.

Could someone tell me what is the GPIO to connect the MCP2515 interrupt pin?
And how to inform the clock used by MCP2515 ?

More info:

Code:
# uname -a
Linux tinkerboard 4.4.132+ #8 SMP Thu Aug 13 08:51:08 UTC 2020 armv7l GNU/Linux
# cat /etc/version
2.1.16-20200813

I have the same issue related by fabio.dogliotti:

Code:
# dmesg | grep can0
[    2.211122] rockchip-pinctrl pinctrl: unable to find group for node can0_pins
#


Best regards,

Jonas
Reply
#30
Hello
Could I find some help with a similar problem.
In have a tinkerboard S with the PICAN 2 Hat Rev B 09/15
Nothing connected to the can bus.
Impossible to have any /dev/can0 device  created at boot up.

Code:
linaro@linaro-alip:~$ uname -a
Linux linaro-alip 4.4.194 #75 SMP Thu Jun 24 14:03:34 UTC 2021 armv7l GNU/Linux
linaro@linaro-alip:~$

Code:
linaro@linaro-alip:~$ dmesg | grep can0
[    2.531509] rockchip-pinctrl pinctrl: unable to find group for node can0_pins
linaro@linaro-alip:~$

Code:
root@linaro-alip:/boot# ls -l /proc/device-tree/pinctrl/gpio5@ff7c0000/can0_pins@0/
total 0
-r--r--r-- 1 root root 10 Sep 30 09:30 name
-r--r--r-- 1 root root  4 Sep 30 09:30 phandle
-r--r--r-- 1 root root 16 Sep 30 09:30 rockchip,pins
root@linaro-alip:/boot#

Code:
root@linaro-alip:~# cat mcp2515-can0.dts
/*
* Device tree overlay for mcp251x/can0 on spi0.0
*/

/dts-v1/;
/plugin/;

/ {
   compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
   /* disable spi-dev for spi0.0 */
   fragment@0 {
       target = <&spi2>;
       __overlay__ {
           status = "okay";
           spidev@0{
               status = "disabled";
           };
           spidev@1{
               status = "disabled";
           };
       };
   };

   /* the interrupt pin of the can-controller */
   fragment@1 {
       target = <&gpio5>;
       __overlay__ {
           can0_pins: can0_pins {
               rockchip,pins = <5 19 0 &pcfg_pull_none>;
           };
       };
   };

   /* the clock/oscillator of the can-controller */
   fragment@2 {
       target-path = "/";
       __overlay__ {
           /* external oscillator of mcp2515 on SPI0.0 */
           can0_osc: can0_osc {
               compatible = "fixed-clock";
               #clock-cells = <0>;
               clock-frequency  = <16000000>;
           };
       };
   };

   /* the spi config of the can-controller itself binding everything together */
   fragment@3 {
       target = <&spi2>;
       __overlay__ {
           /* needed to avoid dtc warning */
           #address-cells = <2>;
           #size-cells = <0>;
           can0: mcp2515@0 {
               reg = <0>;
               compatible = "microchip,mcp2515";
               pinctrl-names = "default";
               pinctrl-0 = <&can0_pins>;
               spi-max-frequency = <10000000>;
               interrupt-parent = <&gpio5>;
               interrupts = <19 0x2>;
               clocks = <&can0_osc>;
           };
       };
   };
   //__overrides__ {
   //    oscillator = <&can0_osc>,"clock-frequency:0";
   //    spimaxfrequency = <&can0>,"spi-max-frequency:0";
   //    interrupt = <&can0_pins>,"brcm,pins:0",<&can0>,"interrupts:0";
   //};
};
root@linaro-alip:~#

Code:
root@linaro-alip:/boot# cat config.txt
##### Hardware Interface Config #####

## Note: fiq_debugger and uart3 use the same pin. Set fiq_debugger first while both on. ##
## Note: uart4 and spi0 are the same pins. Set the latter one while both on. ##
## Note: uart2 is the same pins to pwm2 and pwm3. Set the latter one while both on. ##

intf:fiq_debugger=on
#intf:i2c1=off
#intf:i2c4=off
#intf:spi0=off
intf:spi2=on
#intf:pwm2=off
#intf:pwm3=off
intf:pcm_i2s=on
#intf:uart1=off
#intf:uart2=off
#intf:uart3=off
#intf:uart4=off

##### List of device tree overlays to load. Format: overlay=<dtbo name, no extension> <dtbo2> ... #####

## Note: Put dtbo files under the overlays folder. ##

dtdebug=1
overlay=mcp2515-can0
root@linaro-alip:/boot#



For information exactly the same problem with armbian OS
Many thanks for your Help
Regards
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)