Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2018-12-24 Thread Drew Fustini
fyi - I have created a pull request to add this dts:
https://github.com/beagleboard/bb.org-overlays/pull/101

-drew

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAEf4M_AN8vQhhhNZfYC6R_SE%2B0PrUhjkrVAXBmBOYm2z7EL%2BZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2018-12-24 Thread Drew Fustini
To followup, here is a GitHub gist which shows how I was able to wire
the MCP2515 to SPI0 on the BeagleBone Black and successfully observe
the mcp251x
initialize it and load the can0 interface:
https://gist.github.com/pdp7/20dddbeffe83082e3c94ab0903563783
(also attached)

Photos of MCP2515 breakout board wired to SPI0 on the BeagleBone Black:
https://photos.app.goo.gl/1UUAHhRngzwiVWha9

add this to /boot/uEnv.txt:

uboot_overlay_addr0=/lib/firmware/BB-SPIDEV0-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/MCP2515.dtbo

grab the MCP2515 overlay and install it:

cd /opt/source/bb.org-overlays/
wget 
https://github.com/battlesnake/beaglebone-spi0-mcp2515/blob/master/MCP2515.dts
sudo ./install.sh

After rebooting, the mcp251x driver should initialize the MCP2515
device and these commands from the Macchina documentation should work:

sudo ip link set can0 type can bitrate 50 listen-only on
sudo ifconfig can0 up

Thanks,
Drew

On Sun, Dec 23, 2018 at 9:54 AM Drew Fustini  wrote:
>
> Hello Mark, thank you for sharing your overlay file. I am trying to
> get a MCP2515 working with the BeagleBone Black on SPI0 with the
> 4.14.78-bone17 kernel.
>
> Would it be possible for to document how you had the MCP2515 wired to
> the P8/P9 headers on the BeagleBone Black?
>
> Also, I would be curious to know what kernel version you were using
> with this Device Tree Overlay.
>
> I am trying to get this working with u-boot overlays [0] as the cape
> manager driver has been deprecated [1].
>
> thanks!
> drew
>
> [0] https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
> [1] 
> https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Where_did_the_slots_file_go.3F

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAEf4M_ATBLcG79NTSiDfMJGLzE3e33SGEAb14TjXz5Ch6dPPMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
### Resources
* [Photos of breadboard wiring](https://photos.app.goo.gl/1UUAHhRngzwiVWha9)
* [MCP2515 breakout board from 
Amazon](https://smile.amazon.com/gp/product/B01HXI5LH8/ref=oh_aui_detailpage_o00_s00?ie=UTF8=1)
* [BeagleBone Black 
headers](https://elinux.org/Beagleboard:Cape_Expansion_Headers)
* [Macchina M2 
schematics](https://github.com/macchina/m2-hardware/tree/master/M2-B)


### /boot/uEnv.txt
```
uname_r=4.14.78-bone17

enable_uboot_overlays=1
uboot_overlay_addr0=/lib/firmware/BB-SPIDEV0-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/MCP2515.dtbo
disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
disable_uboot_overlay_wireless=1
disable_uboot_overlay_adc=1
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
enable_uboot_cape_universal=1

cmdline=coherent_pool=1M net.ifnames=0 quiet
```
 device tree overlays
* 
[MCP2515.dts](https://github.com/battlesnake/beaglebone-spi0-mcp2515/blob/master/MCP2515.dts)
  * [related mailing list 
discussion](https://groups.google.com/d/msg/beagleboard/nyyq1wQtGQc/iwGNUBM0EwAJ)
* 
[BB-SPIDEV0-00A0.dts](https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-SPIDEV0-00A0.dts)
 u-boot log
```
loading /boot/vmlinuz-4.14.78-bone17 ...
7438848 bytes read in 547 ms (13 MiB/s)
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot-univ.dtb] ...
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot.dtb] ...
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot.dtb ...
loading /boot/dtbs/4.14.78-bone17/am335x-boneblack-uboot.dtb ...
58502 bytes read in 97 ms (588.9 KiB/s)
uboot_overlays: [fdt_buffer=0x6] ...
uboot_overlays: loading /lib/firmware/BB-SPIDEV0-00A0.dtbo ...
1523 bytes read in 150 ms (9.8 KiB/s)
uboot_overlays: loading /lib/firmware/MCP2515.dtbo ...
2119 bytes read in 463 ms (3.9 KiB/s)
uboot_overlays: uboot loading of [/lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo] 
disabled by /boot/uEnv.txt [disable_uboot_overlay_emmc=1]...
uboot_overlays: uboot loading of [/lib/firmware/BB-HDMI-TDA998x-00A0.dtbo] 
disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]...
uboot_overlays: uboot loading of [/lib/firmware/BB-ADC-00A0.dtbo] disabled by 
/boot/uEnv.txt [disable_uboot_overlay_adc=1]...
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo ...
3513 bytes read in 605 ms (4.9 KiB/s)
uboot_overlays: cape universal disabled, external cape enabled or detected...
loading /boot/initrd.img-4.14.78-bone17 ...
4456483 bytes read in 361 ms (11.8 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 
root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait
```

### Kernel
 4.14.78-bone17
```
debian@beaglebone:~$ uname -a
Linux beaglebone 4.14.78-bone17 #3 PREEMPT Fri Dec 21 10:18:33 CST 2018 armv7l 
GNU/Linux
```

Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2018-12-23 Thread Mark K Cowan
For anyone else finding this, the discussion/development is continued on 
[Github](https://github.com/battlesnake/beaglebone-spi0-mcp2515)

On Sunday, 23 December 2018 15:54:25 UTC, Drew Fustini wrote:
>
> Hello Mark, thank you for sharing your overlay file. I am trying to 
> get a MCP2515 working with the BeagleBone Black on SPI0 with the 
> 4.14.78-bone17 kernel. 
>
> Would it be possible for to document how you had the MCP2515 wired to 
> the P8/P9 headers on the BeagleBone Black? 
>
> Also, I would be curious to know what kernel version you were using 
> with this Device Tree Overlay. 
>
> I am trying to get this working with u-boot overlays [0] as the cape 
> manager driver has been deprecated [1]. 
>
> thanks! 
> drew 
>
> [0] https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays 
> [1] 
> https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Where_did_the_slots_file_go.3F
>  
>
> On Sat, Feb 18, 2017 at 9:16 AM Mark K Cowan  > wrote: 
> > 
> > I solved it with my own devicetree overlay, loaded after the BB-SPIDEV0 
> overlay.  It's available at 
> https://github.com/battlesnake/beaglebone-spi0-mcp2515 
> > 
> > On Saturday, 18 February 2017 14:22:19 UTC, Laurits Telle Riple wrote: 
> >> 
> >> Hi! 
> >> 
> >> I got it to work, but not using the mainline driver. I bought a cape 
> from towertech to be sure that my hardware was correct. They shipped the 
> device with some modified version of the driver. Got some help in the 
> beagle irc chat to try to find the origin of that driver. IIRC the driver 
> was based on a driver from many years ago, but it works. I have not tested 
> it over a long period, but it seems to work. I am currently trying to get 
> it to work with the mainline driver, but its not my top priority right now. 
> There has been several changes to the mainline driver since I tried to use 
> it the last time, so i hope it will work next time I try it. With the 
> towertech driver I managed to get it to work, both by using a overlay and 
> just making my own DT. Should be instructions on how to compile if you 
> download from these links. And I think there is a dto in the zip as well. 
> If I get it to work with the mainline, I will update this thread. 
> >> 
> >> Btw. Some other guy on irc did not get this driver to work with his old 
> rev of the can cape. I think I have rev5. Should work with that. 
> >> 
> >>  TT3201 driver for Debian 7.x / Kernel 3.x 
> >> <
> https://dl.dropboxusercontent.com/u/2883083/TowerTech/towertech-tt3201-rev5.tar.gz>
>  
>
> >> 
> >>   * TT3201 driver for Debian 8.x / Kernel 4.x 
> >> <
> https://dl.dropboxusercontent.com/u/2883083/TowerTech/towertech-tt3201-rev5-kernel-4.x.tar.gz>
>  
>
> >> 
> >> 
> >> tirsdag 14. februar 2017 16.11.56 UTC+1 skrev Mark K Cowan følgende: 
> >>> 
> >>> Hi, 
> >>> 
> >>> Did you ever get the MCP2515 working over SPI?  I'm attempting that 
> now, but I'm not sure where to start. 
> >>> 
> >>> Thanks, 
> >>>   Mark 
> >>> 
> >>> 
> >>> 
> >>> On Tuesday, 20 September 2016 14:30:39 UTC+1, Laurits Telle Riple 
> wrote: 
>  
>  After chatting in the IRC channel with Matthijs I was encouraged to 
> not use overlays, and just make my own dtb.  I have tried that now, but it 
> doesn't seem to work properly. I've enabled spi0 and spi1. And used the 
> spi_loopback to see that my dtb was working, then i expanded it by adding a 
> clock node and adding the mcp in the spi config. Also, the max14830 not 
> working, maybe the same issue? Anyways, this is my dtb: 
>  
>  /* 
>   * Copyright (C) 2012 Texas Instruments Incorporated - 
> http://www.ti.com/ 
>   * 
>   * This program is free software; you can redistribute it and/or 
> modify 
>   * it under the terms of the GNU General Public License version 2 as 
>   * published by the Free Software Foundation. 
>   */ 
>  
>  /dts-v1/; 
>  
>  #include "am33xx.dtsi" 
>  #include "am335x-bone-common.dtsi" 
>  #include "am33xx-overlay-edma-fix.dtsi" 
>  #include "irq.h" 
>  
>  / { 
>  model = "TI AM335x BeagleBone Black"; 
>  compatible = "ti,am335x-bone-black", "ti,am335x-bone", 
> "ti,am33xx"; 
>  
>  clk16m:clk16m{ 
>  compatible = "fixed-clock"; 
>  clock-frequency = <1600>; 
>  #clock-cells = <0>; 
>  }; 
>  
>  clk4m:clk4m{ 
>  compatible = "fixed-clock"; 
>  clock-frequency = <400>; 
>  #clock-cells = <0>; 
>  }; 
>  }; 
>  
>  _reg { 
>  regulator-min-microvolt = <180>; 
>  regulator-max-microvolt = <180>; 
>  regulator-always-on; 
>  }; 
>  
>   { 
>  vmmc-supply = <_fixed>; 
>  }; 
>  
>   { 
>  vmmc-supply = <_fixed>; 
>  pinctrl-names = "default"; 
>  

Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2018-12-23 Thread Drew Fustini
Hello Mark, thank you for sharing your overlay file. I am trying to
get a MCP2515 working with the BeagleBone Black on SPI0 with the
4.14.78-bone17 kernel.

Would it be possible for to document how you had the MCP2515 wired to
the P8/P9 headers on the BeagleBone Black?

Also, I would be curious to know what kernel version you were using
with this Device Tree Overlay.

I am trying to get this working with u-boot overlays [0] as the cape
manager driver has been deprecated [1].

thanks!
drew

[0] https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
[1] 
https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Where_did_the_slots_file_go.3F

On Sat, Feb 18, 2017 at 9:16 AM Mark K Cowan  wrote:
>
> I solved it with my own devicetree overlay, loaded after the BB-SPIDEV0 
> overlay.  It's available at 
> https://github.com/battlesnake/beaglebone-spi0-mcp2515
>
> On Saturday, 18 February 2017 14:22:19 UTC, Laurits Telle Riple wrote:
>>
>> Hi!
>>
>> I got it to work, but not using the mainline driver. I bought a cape from 
>> towertech to be sure that my hardware was correct. They shipped the device 
>> with some modified version of the driver. Got some help in the beagle irc 
>> chat to try to find the origin of that driver. IIRC the driver was based on 
>> a driver from many years ago, but it works. I have not tested it over a long 
>> period, but it seems to work. I am currently trying to get it to work with 
>> the mainline driver, but its not my top priority right now. There has been 
>> several changes to the mainline driver since I tried to use it the last 
>> time, so i hope it will work next time I try it. With the towertech driver I 
>> managed to get it to work, both by using a overlay and just making my own 
>> DT. Should be instructions on how to compile if you download from these 
>> links. And I think there is a dto in the zip as well. If I get it to work 
>> with the mainline, I will update this thread.
>>
>> Btw. Some other guy on irc did not get this driver to work with his old rev 
>> of the can cape. I think I have rev5. Should work with that.
>>
>>  TT3201 driver for Debian 7.x / Kernel 3.x
>> 
>>
>>   * TT3201 driver for Debian 8.x / Kernel 4.x
>> 
>>
>>
>> tirsdag 14. februar 2017 16.11.56 UTC+1 skrev Mark K Cowan følgende:
>>>
>>> Hi,
>>>
>>> Did you ever get the MCP2515 working over SPI?  I'm attempting that now, 
>>> but I'm not sure where to start.
>>>
>>> Thanks,
>>>   Mark
>>>
>>>
>>>
>>> On Tuesday, 20 September 2016 14:30:39 UTC+1, Laurits Telle Riple wrote:

 After chatting in the IRC channel with Matthijs I was encouraged to not 
 use overlays, and just make my own dtb.  I have tried that now, but it 
 doesn't seem to work properly. I've enabled spi0 and spi1. And used the 
 spi_loopback to see that my dtb was working, then i expanded it by adding 
 a clock node and adding the mcp in the spi config. Also, the max14830 not 
 working, maybe the same issue? Anyways, this is my dtb:

 /*
  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */

 /dts-v1/;

 #include "am33xx.dtsi"
 #include "am335x-bone-common.dtsi"
 #include "am33xx-overlay-edma-fix.dtsi"
 #include "irq.h"

 / {
 model = "TI AM335x BeagleBone Black";
 compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";

 clk16m:clk16m{
 compatible = "fixed-clock";
 clock-frequency = <1600>;
 #clock-cells = <0>;
 };

 clk4m:clk4m{
 compatible = "fixed-clock";
 clock-frequency = <400>;
 #clock-cells = <0>;
 };
 };

 _reg {
 regulator-min-microvolt = <180>;
 regulator-max-microvolt = <180>;
 regulator-always-on;
 };

  {
 vmmc-supply = <_fixed>;
 };

  {
 vmmc-supply = <_fixed>;
 pinctrl-names = "default";
 pinctrl-0 = <_pins>;
 bus-width = <8>;
 status = "okay";
 };

 _opp_table {
 /*
  * All PG 2.0 silicon may not support 1GHz but some of the early
  * BeagleBone Blacks have PG 2.0 silicon which is guaranteed
  * to support 1GHz OPP so enable it for PG 2.0 on this board.
  */
 oppnitro@10 {
 opp-supported-hw = <0x06 0x0100>;
 };
 };



Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2017-02-18 Thread robertsmaria934 via BeagleBoard


On Sat, 2/18/17, robertsmaria934 via BeagleBoard <beagleboard@googlegroups.com> 
wrote:

 Subject: Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. 
Wrong device tree overlay?
 To: beagleboard@googlegroups.com
 Date: Saturday, February 18, 2017, 6:29 PM
 
 
 
 On Sat, 2/18/17, Mark K Cowan <m...@open-cosmos.com>
 wrote:
 
  Subject: Re: [beagleboard] Re: Microchip mcp2515, can over
 spi, not working. Wrong device tree overlay?
  To: "BeagleBoard" <beagleboard@googlegroups.com>
  Date: Saturday, February 18, 2017, 5:16 PM
  
  I solved it with my
  own devicetree overlay, loaded after the BB-SPIDEV0
 overlay.
   It's available
  at https://github.com/battlesnake/beaglebone-spi0-mcp2515
  
  On Saturday, 18 February 2017 14:22:19 UTC, Laurits Telle
  Riple  wrote:Hi!
  I got it to work, but not using the mainline
  driver. I bought a cape from towertech to be sure that my
  hardware was correct. They shipped the device with some
  modified version of the driver. Got some help in the
 beagle
  irc chat to try to find the origin of that driver. IIRC
 the
  driver was based on a driver from many years ago, but it
  works. I have not tested it over a long period, but it
 seems
  to work. I am currently trying to get it to work with the
  mainline driver, but its not my top priority right now.
  There has been several changes to the mainline driver
 since
  I tried to use it the last time, so i hope it will work
 next
  time I try it. With the towertech driver I managed to get
 it
  to work, both by using a overlay and just making my own
 DT.
  Should be instructions on how to compile if you download
  from these links. And I think there is a dto in the zip as
  well. If I get it to work with the mainline, I will update
  this thread.
  Btw. Some other guy on irc did not get this
  driver to work with his old rev of the can cape. I think I
  have rev5. Should work with that.
   TT3201 driver for Debian 7.x
  / Kernel 3.x
  <https://dl.
  dropboxusercontent.com/u/ 2883083/TowerTech/towertech-
  tt3201-rev5.tar.gz>
  
    *
  TT3201 driver for Debian 8.x / Kernel 4.x
  <https://dl.
  dropboxusercontent.com/u/ 2883083/TowerTech/towertech-
  tt3201-rev5-kernel-4.x.tar.gz>
  
  
  tirsdag 14. februar 2017 16.11.56 UTC+1 skrev Mark K Cowan
  følgende:Hi,
  Did you ever get the MCP2515 working over SPI?
   I'm attempting that now, but I'm not sure where to
  start.
  Thanks,  Mark
  
  
  On Tuesday, 20 September 2016 14:30:39 UTC+1, Laurits
 Telle
  Riple  wrote:After chatting in
  the IRC channel with Matthijs I was encouraged to not use
  overlays, and just make my own dtb.  I have tried that
 now,
  but it doesn't seem to work properly. I've enabled
  spi0 and spi1. And used the spi_loopback to see that my
 dtb
  was working, then i expanded it by adding a clock node and
  adding the mcp in the spi config. Also, the max14830 not
  working, maybe the same issue? Anyways, this is my
  dtb: 
  /* * Copyright (C) 2012 Texas Instruments
  Incorporated - http://www.ti.com/ * * This program is
 free software; you can
  redistribute it and/or modify * it under the terms of the
 GNU General
  Public License version 2 as * published by the Free
 Software
  Foundation. */
  
  /dts-v1/;
  #include
  "am33xx.dtsi"#include
  "am335x-bone-common.dtsi"#include
  "am33xx-overlay-edma-fix.dtsi"#include
  "irq.h"
  /
  {        model =
  "TI AM335x BeagleBone
  Black";     
    compatible = "ti,am335x-bone-black",
  "ti,am335x-bone",
  "ti,am33xx";
         
  clk16m:clk16m{   
              compatible =
  "fixed-clock";                clock-frequency =
  <1600>; 
                #clock-cells =
  <0>;     
    };
         
  clk4m:clk4m{     
            compatible =
  "fixed-clock";                clock-frequency =
  <400>; 
                #clock-cells =
  <0>;     
    };};
  _reg
  {       
  regulator-min-microvolt =
  <180>; 
        regulator-max-microvolt =
  <180>; 
        regulator-always-on;};
  
  {       
  vmmc-supply =
  <_fixed>;};
  
  {       
  vmmc-supply =
  <_fixed>;        pinctrl-names =
  "default";        pinctrl-0 =
  <_pins>;        bus-width =
  <8>;     
    status = "okay";};
  _opp_table
  {       
  /*         *
  All PG 2.0 silicon may not support 1GHz but some of the
  early         *
  BeagleBone Blacks have PG 2.0 silicon which is
  guaranteed     
     * to support 1GHz OPP so enable it for PG 2.0 on this
  board.       
   */       
  oppnitro@10
 {                opp-supported-hw =
  <0x06 0x0100>;        };};
  
  _pinmux{       
  spi1_pins:spi1_pins{               
  pinctrl-single,pins=<                       
 0x190
  0x33  /* mcasp

Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2017-02-18 Thread robertsmaria934 via BeagleBoard


On Sat, 2/18/17, Mark K Cowan <m...@open-cosmos.com> wrote:

 Subject: Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. 
Wrong device tree overlay?
 To: "BeagleBoard" <beagleboard@googlegroups.com>
 Date: Saturday, February 18, 2017, 5:16 PM
 
 I solved it with my
 own devicetree overlay, loaded after the BB-SPIDEV0 overlay.
  It's available
 at https://github.com/battlesnake/beaglebone-spi0-mcp2515
 
 On Saturday, 18 February 2017 14:22:19 UTC, Laurits Telle
 Riple  wrote:Hi!
 I got it to work, but not using the mainline
 driver. I bought a cape from towertech to be sure that my
 hardware was correct. They shipped the device with some
 modified version of the driver. Got some help in the beagle
 irc chat to try to find the origin of that driver. IIRC the
 driver was based on a driver from many years ago, but it
 works. I have not tested it over a long period, but it seems
 to work. I am currently trying to get it to work with the
 mainline driver, but its not my top priority right now.
 There has been several changes to the mainline driver since
 I tried to use it the last time, so i hope it will work next
 time I try it. With the towertech driver I managed to get it
 to work, both by using a overlay and just making my own DT.
 Should be instructions on how to compile if you download
 from these links. And I think there is a dto in the zip as
 well. If I get it to work with the mainline, I will update
 this thread.
 Btw. Some other guy on irc did not get this
 driver to work with his old rev of the can cape. I think I
 have rev5. Should work with that.
  TT3201 driver for Debian 7.x
 / Kernel 3.x
 <https://dl.
 dropboxusercontent.com/u/ 2883083/TowerTech/towertech-
 tt3201-rev5.tar.gz>
 
   *
 TT3201 driver for Debian 8.x / Kernel 4.x
 <https://dl.
 dropboxusercontent.com/u/ 2883083/TowerTech/towertech-
 tt3201-rev5-kernel-4.x.tar.gz>
 
 
 tirsdag 14. februar 2017 16.11.56 UTC+1 skrev Mark K Cowan
 følgende:Hi,
 Did you ever get the MCP2515 working over SPI?
  I'm attempting that now, but I'm not sure where to
 start.
 Thanks,  Mark
 
 
 On Tuesday, 20 September 2016 14:30:39 UTC+1, Laurits Telle
 Riple  wrote:After chatting in
 the IRC channel with Matthijs I was encouraged to not use
 overlays, and just make my own dtb.  I have tried that now,
 but it doesn't seem to work properly. I've enabled
 spi0 and spi1. And used the spi_loopback to see that my dtb
 was working, then i expanded it by adding a clock node and
 adding the mcp in the spi config. Also, the max14830 not
 working, maybe the same issue? Anyways, this is my
 dtb: 
 /* * Copyright (C) 2012 Texas Instruments
 Incorporated - http://www.ti.com/ * * This program is free software; you can
 redistribute it and/or modify * it under the terms of the GNU General
 Public License version 2 as * published by the Free Software
 Foundation. */
 
 /dts-v1/;
 #include
 "am33xx.dtsi"#include
 "am335x-bone-common.dtsi"#include
 "am33xx-overlay-edma-fix.dtsi"#include
 "irq.h"
 /
 {        model =
 "TI AM335x BeagleBone
 Black";     
   compatible = "ti,am335x-bone-black",
 "ti,am335x-bone",
 "ti,am33xx";
        
 clk16m:clk16m{   
             compatible =
 "fixed-clock";                clock-frequency =
 <1600>; 
               #clock-cells =
 <0>;     
   };
        
 clk4m:clk4m{     
           compatible =
 "fixed-clock";                clock-frequency =
 <400>; 
               #clock-cells =
 <0>;     
   };};
 _reg
 {       
 regulator-min-microvolt =
 <180>; 
       regulator-max-microvolt =
 <180>; 
       regulator-always-on;};
 
 {       
 vmmc-supply =
 <_fixed>;};
 
 {       
 vmmc-supply =
 <_fixed>;        pinctrl-names =
 "default";        pinctrl-0 =
 <_pins>;        bus-width =
 <8>;     
   status = "okay";};
 _opp_table
 {       
 /*         *
 All PG 2.0 silicon may not support 1GHz but some of the
 early         *
 BeagleBone Blacks have PG 2.0 silicon which is
 guaranteed     
    * to support 1GHz OPP so enable it for PG 2.0 on this
 board.       
  */       
 oppnitro@10 {                opp-supported-hw =
 <0x06 0x0100>;        };};
 
 _pinmux{       
 spi1_pins:spi1_pins{               
 pinctrl-single,pins=<                        0x190
 0x33  /* mcasp0_aclkx.spi1_sclk,  OUTPUT_PULLUP | MODE 3
 */           
             0x194 0x33  /* mcasp0_fsx.spi1_d0,    
  INPUT_PULLUP | MODE3 */                        0x198
 0x13  /* mcasp0_axr0.spi1_d1,     OUTPUT_PULLUP | MODE 3
 */           
             0x19c 0x13  /* mcasp0_ahclkr.spi1_cs0,
  OUTPUT_PULLUP | MODE3 */               
 >;       
 };       
 spi0_pins:spi0_pins{               
 pinctrl-single,pins=<                        0x150
 0x30  /* spi0_sclk, INPUT

Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2017-02-18 Thread Mark K Cowan
I solved it with my own devicetree overlay, loaded after the BB-SPIDEV0 
overlay.  It's available 
at https://github.com/battlesnake/beaglebone-spi0-mcp2515

On Saturday, 18 February 2017 14:22:19 UTC, Laurits Telle Riple wrote:
>
> Hi!
>
> I got it to work, but not using the mainline driver. I bought a cape from 
> towertech to be sure that my hardware was correct. They shipped the device 
> with some modified version of the driver. Got some help in the beagle irc 
> chat to try to find the origin of that driver. IIRC the driver was based on 
> a driver from many years ago, but it works. I have not tested it over a 
> long period, but it seems to work. I am currently trying to get it to work 
> with the mainline driver, but its not my top priority right now. There has 
> been several changes to the mainline driver since I tried to use it the 
> last time, so i hope it will work next time I try it. With the towertech 
> driver I managed to get it to work, both by using a overlay and just making 
> my own DT. Should be instructions on how to compile if you download from 
> these links. And I think there is a dto in the zip as well. If I get it to 
> work with the mainline, I will update this thread.
>
> Btw. Some other guy on irc did not get this driver to work with his old 
> rev of the can cape. I think I have rev5. Should work with that.
>
>  TT3201 driver for Debian 7.x / Kernel 3.x
> <
> https://dl.dropboxusercontent.com/u/2883083/TowerTech/towertech-tt3201-rev5.tar.gz
> >
>
>   * TT3201 driver for Debian 8.x / Kernel 4.x
> <
> https://dl.dropboxusercontent.com/u/2883083/TowerTech/towertech-tt3201-rev5-kernel-4.x.tar.gz
> >
>
>
> tirsdag 14. februar 2017 16.11.56 UTC+1 skrev Mark K Cowan følgende:
>>
>> Hi,
>>
>> Did you ever get the MCP2515 working over SPI?  I'm attempting that now, 
>> but I'm not sure where to start.
>>
>> Thanks,
>>   Mark
>>
>>
>>
>> On Tuesday, 20 September 2016 14:30:39 UTC+1, Laurits Telle Riple wrote:
>>>
>>> After chatting in the IRC channel with Matthijs I was encouraged to not 
>>> use overlays, and just make my own dtb.  I have tried that now, but it 
>>> doesn't seem to work properly. I've enabled spi0 and spi1. And used the 
>>> spi_loopback to see that my dtb was working, then i expanded it by adding a 
>>> clock node and adding the mcp in the spi config. Also, the max14830 not 
>>> working, maybe the same issue? Anyways, this is my dtb: 
>>>
>>> /*
>>>  * Copyright (C) 2012 Texas Instruments Incorporated - 
>>> http://www.ti.com/
>>>  *
>>>  * This program is free software; you can redistribute it and/or modify
>>>  * it under the terms of the GNU General Public License version 2 as
>>>  * published by the Free Software Foundation.
>>>  */
>>>
>>> /dts-v1/;
>>>
>>> #include "am33xx.dtsi"
>>> #include "am335x-bone-common.dtsi"
>>> #include "am33xx-overlay-edma-fix.dtsi"
>>> #include "irq.h"
>>>
>>> / {
>>> model = "TI AM335x BeagleBone Black";
>>> compatible = "ti,am335x-bone-black", "ti,am335x-bone", 
>>> "ti,am33xx";
>>>
>>> clk16m:clk16m{
>>> compatible = "fixed-clock";
>>> clock-frequency = <1600>;
>>> #clock-cells = <0>;
>>> };
>>>
>>> clk4m:clk4m{
>>> compatible = "fixed-clock";
>>> clock-frequency = <400>;
>>> #clock-cells = <0>;
>>> };
>>> };
>>>
>>> _reg {
>>> regulator-min-microvolt = <180>;
>>> regulator-max-microvolt = <180>;
>>> regulator-always-on;
>>> };
>>>
>>>  {
>>> vmmc-supply = <_fixed>;
>>> };
>>>
>>>  {
>>> vmmc-supply = <_fixed>;
>>> pinctrl-names = "default";
>>> pinctrl-0 = <_pins>;
>>> bus-width = <8>;
>>> status = "okay";
>>> };
>>>
>>> _opp_table {
>>> /*
>>>  * All PG 2.0 silicon may not support 1GHz but some of the early
>>>  * BeagleBone Blacks have PG 2.0 silicon which is guaranteed
>>>  * to support 1GHz OPP so enable it for PG 2.0 on this board.
>>>  */
>>> oppnitro@10 {
>>> opp-supported-hw = <0x06 0x0100>;
>>> };
>>> };
>>>
>>>
>>> _pinmux{
>>> spi1_pins:spi1_pins{
>>> pinctrl-single,pins=<
>>> 0x190 0x33  /* mcasp0_aclkx.spi1_sclk, 
>>>  OUTPUT_PULLUP | MODE 3 */
>>> 0x194 0x33  /* mcasp0_fsx.spi1_d0, 
>>>  INPUT_PULLUP | MODE3 */
>>> 0x198 0x13  /* mcasp0_axr0.spi1_d1, 
>>> OUTPUT_PULLUP | MODE 3 */
>>> 0x19c 0x13  /* mcasp0_ahclkr.spi1_cs0, 
>>>  OUTPUT_PULLUP | MODE3 */
>>> >;
>>> };
>>> spi0_pins:spi0_pins{
>>> pinctrl-single,pins=<
>>> 0x150 0x30  /* spi0_sclk, INPUT_PULLUP | MODE0 */
>>> 0x154 0x30  /* spi0_d0, INPUT_PULLUP | MODE0 */
>>> 0x158 0x10  /* spi0_d1, OUTPUT_PULLUP 

Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2017-02-18 Thread Laurits Telle Riple
Hi!

I got it to work, but not using the mainline driver. I bought a cape from 
towertech to be sure that my hardware was correct. They shipped the device 
with some modified version of the driver. Got some help in the beagle irc 
chat to try to find the origin of that driver. IIRC the driver was based on 
a driver from many years ago, but it works. I have not tested it over a 
long period, but it seems to work. I am currently trying to get it to work 
with the mainline driver, but its not my top priority right now. There has 
been several changes to the mainline driver since I tried to use it the 
last time, so i hope it will work next time I try it. With the towertech 
driver I managed to get it to work, both by using a overlay and just making 
my own DT. Should be instructions on how to compile if you download from 
these links. And I think there is a dto in the zip as well. If I get it to 
work with the mainline, I will update this thread.

Btw. Some other guy on irc did not get this driver to work with his old rev 
of the can cape. I think I have rev5. Should work with that.

 TT3201 driver for Debian 7.x / Kernel 3.x
<
https://dl.dropboxusercontent.com/u/2883083/TowerTech/towertech-tt3201-rev5.tar.gz
>

  * TT3201 driver for Debian 8.x / Kernel 4.x
<
https://dl.dropboxusercontent.com/u/2883083/TowerTech/towertech-tt3201-rev5-kernel-4.x.tar.gz
>


tirsdag 14. februar 2017 16.11.56 UTC+1 skrev Mark K Cowan følgende:
>
> Hi,
>
> Did you ever get the MCP2515 working over SPI?  I'm attempting that now, 
> but I'm not sure where to start.
>
> Thanks,
>   Mark
>
>
>
> On Tuesday, 20 September 2016 14:30:39 UTC+1, Laurits Telle Riple wrote:
>>
>> After chatting in the IRC channel with Matthijs I was encouraged to not 
>> use overlays, and just make my own dtb.  I have tried that now, but it 
>> doesn't seem to work properly. I've enabled spi0 and spi1. And used the 
>> spi_loopback to see that my dtb was working, then i expanded it by adding a 
>> clock node and adding the mcp in the spi config. Also, the max14830 not 
>> working, maybe the same issue? Anyways, this is my dtb: 
>>
>> /*
>>  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
>>  *
>>  * This program is free software; you can redistribute it and/or modify
>>  * it under the terms of the GNU General Public License version 2 as
>>  * published by the Free Software Foundation.
>>  */
>>
>> /dts-v1/;
>>
>> #include "am33xx.dtsi"
>> #include "am335x-bone-common.dtsi"
>> #include "am33xx-overlay-edma-fix.dtsi"
>> #include "irq.h"
>>
>> / {
>> model = "TI AM335x BeagleBone Black";
>> compatible = "ti,am335x-bone-black", "ti,am335x-bone", 
>> "ti,am33xx";
>>
>> clk16m:clk16m{
>> compatible = "fixed-clock";
>> clock-frequency = <1600>;
>> #clock-cells = <0>;
>> };
>>
>> clk4m:clk4m{
>> compatible = "fixed-clock";
>> clock-frequency = <400>;
>> #clock-cells = <0>;
>> };
>> };
>>
>> _reg {
>> regulator-min-microvolt = <180>;
>> regulator-max-microvolt = <180>;
>> regulator-always-on;
>> };
>>
>>  {
>> vmmc-supply = <_fixed>;
>> };
>>
>>  {
>> vmmc-supply = <_fixed>;
>> pinctrl-names = "default";
>> pinctrl-0 = <_pins>;
>> bus-width = <8>;
>> status = "okay";
>> };
>>
>> _opp_table {
>> /*
>>  * All PG 2.0 silicon may not support 1GHz but some of the early
>>  * BeagleBone Blacks have PG 2.0 silicon which is guaranteed
>>  * to support 1GHz OPP so enable it for PG 2.0 on this board.
>>  */
>> oppnitro@10 {
>> opp-supported-hw = <0x06 0x0100>;
>> };
>> };
>>
>>
>> _pinmux{
>> spi1_pins:spi1_pins{
>> pinctrl-single,pins=<
>> 0x190 0x33  /* mcasp0_aclkx.spi1_sclk, 
>>  OUTPUT_PULLUP | MODE 3 */
>> 0x194 0x33  /* mcasp0_fsx.spi1_d0, 
>>  INPUT_PULLUP | MODE3 */
>> 0x198 0x13  /* mcasp0_axr0.spi1_d1, 
>> OUTPUT_PULLUP | MODE 3 */
>> 0x19c 0x13  /* mcasp0_ahclkr.spi1_cs0, 
>>  OUTPUT_PULLUP | MODE3 */
>> >;
>> };
>> spi0_pins:spi0_pins{
>> pinctrl-single,pins=<
>> 0x150 0x30  /* spi0_sclk, INPUT_PULLUP | MODE0 */
>> 0x154 0x30  /* spi0_d0, INPUT_PULLUP | MODE0 */
>> 0x158 0x10  /* spi0_d1, OUTPUT_PULLUP | MODE0 */
>> 0x15c 0x10  /* spi0_cs0, OUTPUT_PULLUP | MODE0 */
>> >;
>> };
>> mcp2515_pins:mcp2515_pins{
>> pinctrl-single,pins=<
>> 0x1ac 0x37 /*mcasp0_ahclkx.gpio3_21,RX_ENABLED | 
>> PULLUP | MODE7 */
>> >;
>> };
>> max14830_pins:max14830_pins{
>>   

Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2017-02-14 Thread thunderspoonextreme
Hi,

Did you ever get the MCP2515 working over SPI?  I'm attempting that now, 
but I'm not sure where to start.

Thanks,
  Mark



On Tuesday, 20 September 2016 14:30:39 UTC+1, Laurits Telle Riple wrote:
>
> After chatting in the IRC channel with Matthijs I was encouraged to not 
> use overlays, and just make my own dtb.  I have tried that now, but it 
> doesn't seem to work properly. I've enabled spi0 and spi1. And used the 
> spi_loopback to see that my dtb was working, then i expanded it by adding a 
> clock node and adding the mcp in the spi config. Also, the max14830 not 
> working, maybe the same issue? Anyways, this is my dtb: 
>
> /*
>  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
>  *
>  * This program is free software; you can redistribute it and/or modify
>  * it under the terms of the GNU General Public License version 2 as
>  * published by the Free Software Foundation.
>  */
>
> /dts-v1/;
>
> #include "am33xx.dtsi"
> #include "am335x-bone-common.dtsi"
> #include "am33xx-overlay-edma-fix.dtsi"
> #include "irq.h"
>
> / {
> model = "TI AM335x BeagleBone Black";
> compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
>
> clk16m:clk16m{
> compatible = "fixed-clock";
> clock-frequency = <1600>;
> #clock-cells = <0>;
> };
>
> clk4m:clk4m{
> compatible = "fixed-clock";
> clock-frequency = <400>;
> #clock-cells = <0>;
> };
> };
>
> _reg {
> regulator-min-microvolt = <180>;
> regulator-max-microvolt = <180>;
> regulator-always-on;
> };
>
>  {
> vmmc-supply = <_fixed>;
> };
>
>  {
> vmmc-supply = <_fixed>;
> pinctrl-names = "default";
> pinctrl-0 = <_pins>;
> bus-width = <8>;
> status = "okay";
> };
>
> _opp_table {
> /*
>  * All PG 2.0 silicon may not support 1GHz but some of the early
>  * BeagleBone Blacks have PG 2.0 silicon which is guaranteed
>  * to support 1GHz OPP so enable it for PG 2.0 on this board.
>  */
> oppnitro@10 {
> opp-supported-hw = <0x06 0x0100>;
> };
> };
>
>
> _pinmux{
> spi1_pins:spi1_pins{
> pinctrl-single,pins=<
> 0x190 0x33  /* mcasp0_aclkx.spi1_sclk, 
>  OUTPUT_PULLUP | MODE 3 */
> 0x194 0x33  /* mcasp0_fsx.spi1_d0, 
>  INPUT_PULLUP | MODE3 */
> 0x198 0x13  /* mcasp0_axr0.spi1_d1, 
> OUTPUT_PULLUP | MODE 3 */
> 0x19c 0x13  /* mcasp0_ahclkr.spi1_cs0, 
>  OUTPUT_PULLUP | MODE3 */
> >;
> };
> spi0_pins:spi0_pins{
> pinctrl-single,pins=<
> 0x150 0x30  /* spi0_sclk, INPUT_PULLUP | MODE0 */
> 0x154 0x30  /* spi0_d0, INPUT_PULLUP | MODE0 */
> 0x158 0x10  /* spi0_d1, OUTPUT_PULLUP | MODE0 */
> 0x15c 0x10  /* spi0_cs0, OUTPUT_PULLUP | MODE0 */
> >;
> };
> mcp2515_pins:mcp2515_pins{
> pinctrl-single,pins=<
> 0x1ac 0x37 /*mcasp0_ahclkx.gpio3_21,RX_ENABLED | 
> PULLUP | MODE7 */
> >;
> };
> max14830_pins:max14830_pins{
> pinctrl-single,pins=<
> 0x1a4 0x37  /* mcasp0_fsr.gpio3_19, RX_ENABLED 
> | PULLUP | MODE7 */
> >;
> };
> };
>
> {
> status="okay";
> pinctrl-names="default";
> pinctrl-0=<_pins>;
>
> /*spi1@0{
> compatible="spidev";
> reg=<0>;
> spi-max-frequency=<1600>;
> };*/
>
> max14830@0{
> compatible="maxim,max14830";
> reg=<0>;
> spi-max-frequency=<1600>;
> clocks=<>;
> clock-names="osc";
> interrupt-parent=<>;
> interrupts=<19 IRQ_TYPE_EDGE_FALLING>;
> gpio-controller;
> #gpio-cells=<2>;
> };
> mcp2515@1{
> compatible="microchip,mcp2515";
> reg=<1>;
> spi-max-frequency=<1000>;
> pinctrl-names="default";
> pinctrl-0=<_pins>;
> clocks=<>;
> interrupt-parent=<>;
> interrupts=<21 IRQ_TYPE_EDGE_FALLING>;
> };
> };
>
> {
> status="okay";
> pinctrl-names="default";
> pinctrl-0=<_pins>;
>
> spi0@0{
> compatible="spidev";
> reg=<0>;
> spi-max-frequency=<1600>;
> };
> };
>
>
> But I still dont get any can devices when i issue the "ip a" command. 
> However running lsmod gives:
>
> debian@arm:/opt/source/dtb-4.4-ti$ 

Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2016-09-20 Thread Laurits Telle Riple
After chatting in the IRC channel with Matthijs I was encouraged to not use 
overlays, and just make my own dtb.  I have tried that now, but it doesn't 
seem to work properly. I've enabled spi0 and spi1. And used the 
spi_loopback to see that my dtb was working, then i expanded it by adding a 
clock node and adding the mcp in the spi config. Also, the max14830 not 
working, maybe the same issue? Anyways, this is my dtb: 

/*
 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

/dts-v1/;

#include "am33xx.dtsi"
#include "am335x-bone-common.dtsi"
#include "am33xx-overlay-edma-fix.dtsi"
#include "irq.h"

/ {
model = "TI AM335x BeagleBone Black";
compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";

clk16m:clk16m{
compatible = "fixed-clock";
clock-frequency = <1600>;
#clock-cells = <0>;
};

clk4m:clk4m{
compatible = "fixed-clock";
clock-frequency = <400>;
#clock-cells = <0>;
};
};

_reg {
regulator-min-microvolt = <180>;
regulator-max-microvolt = <180>;
regulator-always-on;
};

 {
vmmc-supply = <_fixed>;
};

 {
vmmc-supply = <_fixed>;
pinctrl-names = "default";
pinctrl-0 = <_pins>;
bus-width = <8>;
status = "okay";
};

_opp_table {
/*
 * All PG 2.0 silicon may not support 1GHz but some of the early
 * BeagleBone Blacks have PG 2.0 silicon which is guaranteed
 * to support 1GHz OPP so enable it for PG 2.0 on this board.
 */
oppnitro@10 {
opp-supported-hw = <0x06 0x0100>;
};
};


_pinmux{
spi1_pins:spi1_pins{
pinctrl-single,pins=<
0x190 0x33  /* mcasp0_aclkx.spi1_sclk, 
 OUTPUT_PULLUP | MODE 3 */
0x194 0x33  /* mcasp0_fsx.spi1_d0, 
 INPUT_PULLUP | MODE3 */
0x198 0x13  /* mcasp0_axr0.spi1_d1, 
OUTPUT_PULLUP | MODE 3 */
0x19c 0x13  /* mcasp0_ahclkr.spi1_cs0, 
 OUTPUT_PULLUP | MODE3 */
>;
};
spi0_pins:spi0_pins{
pinctrl-single,pins=<
0x150 0x30  /* spi0_sclk, INPUT_PULLUP | MODE0 */
0x154 0x30  /* spi0_d0, INPUT_PULLUP | MODE0 */
0x158 0x10  /* spi0_d1, OUTPUT_PULLUP | MODE0 */
0x15c 0x10  /* spi0_cs0, OUTPUT_PULLUP | MODE0 */
>;
};
mcp2515_pins:mcp2515_pins{
pinctrl-single,pins=<
0x1ac 0x37 /*mcasp0_ahclkx.gpio3_21,RX_ENABLED | 
PULLUP | MODE7 */
>;
};
max14830_pins:max14830_pins{
pinctrl-single,pins=<
0x1a4 0x37  /* mcasp0_fsr.gpio3_19, RX_ENABLED 
| PULLUP | MODE7 */
>;
};
};

{
status="okay";
pinctrl-names="default";
pinctrl-0=<_pins>;

/*spi1@0{
compatible="spidev";
reg=<0>;
spi-max-frequency=<1600>;
};*/

max14830@0{
compatible="maxim,max14830";
reg=<0>;
spi-max-frequency=<1600>;
clocks=<>;
clock-names="osc";
interrupt-parent=<>;
interrupts=<19 IRQ_TYPE_EDGE_FALLING>;
gpio-controller;
#gpio-cells=<2>;
};
mcp2515@1{
compatible="microchip,mcp2515";
reg=<1>;
spi-max-frequency=<1000>;
pinctrl-names="default";
pinctrl-0=<_pins>;
clocks=<>;
interrupt-parent=<>;
interrupts=<21 IRQ_TYPE_EDGE_FALLING>;
};
};

{
status="okay";
pinctrl-names="default";
pinctrl-0=<_pins>;

spi0@0{
compatible="spidev";
reg=<0>;
spi-max-frequency=<1600>;
};
};


But I still dont get any can devices when i issue the "ip a" command. 
However running lsmod gives:

debian@arm:/opt/source/dtb-4.4-ti$ lsmod
Module  Size  Used by
8021q  17930  0 
garp5769  1 8021q
mrp 7239  1 8021q
stp 2219  1 garp
llc 5123  2 stp,garp
usb_f_ecm   9336  1 
g_ether 4976  0 
usb_f_rndis22191  2 g_ether
mcp251x 9039  0 
u_ether11898  3 usb_f_ecm,usb_f_rndis,g_ether
libcomposite   43717  3 usb_f_ecm,usb_f_rndis,g_ether

Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2016-08-19 Thread William Hermans
Something I noticed about your device tree file. First, the mcp251x.c /
mcp2515.c driver would be loaded as a module in a device tree. I see no
"status=okay" so the driver would never load. Honestly I've yet to setup
SPI on the beaglebone in ~3.5 years. So I'm no expert. However if I were
you. I would at least initially setup, and use universal-io to mux your
pins. https://github.com/cdsteinkuehler/beaglebone-universal-io . It is far
simpler, and easier to use than a raw device tree source file.

So, universal io is already installed, and loaded by default on the stick
4.4 debian images. The only thing you may have to do is download via wget
config-pin, chmod +x it then move it to the appropriate /bin directory.

Then you just:

$ sudo config-pin PX.XX spi

etc, etc.


On Fri, Aug 19, 2016 at 9:01 AM, William Hermans  wrote:

> https://github.com/msperl/mcp2515/blob/master/mcp2515.c there it is.
>
> By the way, the mcp2515 has a built in transceiver. The CANBUS controller
> on the am335x does not. the MCP2515 is also more cost efficient. So don't
> let anyone make you feel bad for going that route.
>
> On Fri, Aug 19, 2016 at 8:58 AM, William Hermans 
> wrote:
>
>> 1. Haha! It does? Must have missed it when I looked on the pinmap.
>>> 2. Tried to disable universal cape, makes no difference.
>>>
>>> Anyways. I still want to get it to work. Have spent so much time on it,
>>> and I would hate to just let it go. Even though I probably won't use it. I
>>> also need to get a spi to uart chip (max14830) to work, which has almost
>>> the same configuration so I'm hoping that solving this issue, will also
>>> solve the max14830.
>>>
>>> I will try out your tool, looks very promising ;) Thanks for the help.
>>
>> Well, you're device tree would simply be for SPI anyway. Since thats the
>> bus you're using. Also, so you know the mcp2515 driver already exists, so I
>> forget whatexactly the module name is, but something like $ sudo
>> modprobe mcp25xx should just work.
>>
>>
>> On Fri, Aug 19, 2016 at 7:21 AM,  wrote:
>>
>>> 1. Haha! It does? Must have missed it when I looked on the pinmap.
>>> 2. Tried to disable universal cape, makes no difference.
>>>
>>> Anyways. I still want to get it to work. Have spent so much time on it,
>>> and I would hate to just let it go. Even though I probably won't use it. I
>>> also need to get a spi to uart chip (max14830) to work, which has almost
>>> the same configuration so I'm hoping that solving this issue, will also
>>> solve the max14830.
>>>
>>> I will try out your tool, looks very promising ;) Thanks for the help.
>>>
>>>
>>> fredag 19. august 2016 15.42.06 UTC+2 skrev Matthijs van Duin følgende:

 I haven't really looked yet at your overlay, but two immediate thoughts:
 1. why on earth are you using an spi can controller when there are
 *two* built-in CAN controllers already on the beaglebone?
 2. you have cape-universal enabled, this conflicts with pretty much
 every overlay (remove the cape_universal=enable from cmdline in your
 /boot/uEnv.txt

 BTW I made some utils to make the process of writing overlays less
 painful: https://github.com/mvduin/overlay-utils
 It lets you write them as device tree fragments and automatically
 converts them to the structure requires for overlays. It also includes
 macros that make pinmux much easier to read. No support for overlay
 metadata though, I didn't bother since the new configfs mechanism to load
 overlays ignores it anyway.

 Matthijs

>>> --
>>> For more options, visit http://beagleboard.org/discuss
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "BeagleBoard" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to beagleboard+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/beagleboard/01fc36f9-5d81-4597-acc6-d553e02a231b%40googlegroups.com
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORoYGHvQS5WfxXMeWC1dUW6b-MSjMK6N9wYQY%3DpkSMngRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2016-08-19 Thread William Hermans
https://github.com/msperl/mcp2515/blob/master/mcp2515.c there it is.

By the way, the mcp2515 has a built in transceiver. The CANBUS controller
on the am335x does not. the MCP2515 is also more cost efficient. So don't
let anyone make you feel bad for going that route.

On Fri, Aug 19, 2016 at 8:58 AM, William Hermans  wrote:

> 1. Haha! It does? Must have missed it when I looked on the pinmap.
>> 2. Tried to disable universal cape, makes no difference.
>>
>> Anyways. I still want to get it to work. Have spent so much time on it,
>> and I would hate to just let it go. Even though I probably won't use it. I
>> also need to get a spi to uart chip (max14830) to work, which has almost
>> the same configuration so I'm hoping that solving this issue, will also
>> solve the max14830.
>>
>> I will try out your tool, looks very promising ;) Thanks for the help.
>
> Well, you're device tree would simply be for SPI anyway. Since thats the
> bus you're using. Also, so you know the mcp2515 driver already exists, so I
> forget whatexactly the module name is, but something like $ sudo modprobe
> mcp25xx should just work.
>
>
> On Fri, Aug 19, 2016 at 7:21 AM,  wrote:
>
>> 1. Haha! It does? Must have missed it when I looked on the pinmap.
>> 2. Tried to disable universal cape, makes no difference.
>>
>> Anyways. I still want to get it to work. Have spent so much time on it,
>> and I would hate to just let it go. Even though I probably won't use it. I
>> also need to get a spi to uart chip (max14830) to work, which has almost
>> the same configuration so I'm hoping that solving this issue, will also
>> solve the max14830.
>>
>> I will try out your tool, looks very promising ;) Thanks for the help.
>>
>>
>> fredag 19. august 2016 15.42.06 UTC+2 skrev Matthijs van Duin følgende:
>>>
>>> I haven't really looked yet at your overlay, but two immediate thoughts:
>>> 1. why on earth are you using an spi can controller when there are *two*
>>> built-in CAN controllers already on the beaglebone?
>>> 2. you have cape-universal enabled, this conflicts with pretty much
>>> every overlay (remove the cape_universal=enable from cmdline in your
>>> /boot/uEnv.txt
>>>
>>> BTW I made some utils to make the process of writing overlays less
>>> painful: https://github.com/mvduin/overlay-utils
>>> It lets you write them as device tree fragments and automatically
>>> converts them to the structure requires for overlays. It also includes
>>> macros that make pinmux much easier to read. No support for overlay
>>> metadata though, I didn't bother since the new configfs mechanism to load
>>> overlays ignores it anyway.
>>>
>>> Matthijs
>>>
>> --
>> For more options, visit http://beagleboard.org/discuss
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to beagleboard+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/beagleboard/01fc36f9-5d81-4597-acc6-d553e02a231b%40googlegroups.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORq7mUuJz%3DMLmZnKz_-pOg%3Dy%2BzNBHkzyBYuS0Oss6k9RnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2016-08-19 Thread William Hermans
>
> 1. Haha! It does? Must have missed it when I looked on the pinmap.
> 2. Tried to disable universal cape, makes no difference.
>
> Anyways. I still want to get it to work. Have spent so much time on it,
> and I would hate to just let it go. Even though I probably won't use it. I
> also need to get a spi to uart chip (max14830) to work, which has almost
> the same configuration so I'm hoping that solving this issue, will also
> solve the max14830.
>
> I will try out your tool, looks very promising ;) Thanks for the help.

Well, you're device tree would simply be for SPI anyway. Since thats the
bus you're using. Also, so you know the mcp2515 driver already exists, so I
forget whatexactly the module name is, but something like $ sudo modprobe
mcp25xx should just work.


On Fri, Aug 19, 2016 at 7:21 AM,  wrote:

> 1. Haha! It does? Must have missed it when I looked on the pinmap.
> 2. Tried to disable universal cape, makes no difference.
>
> Anyways. I still want to get it to work. Have spent so much time on it,
> and I would hate to just let it go. Even though I probably won't use it. I
> also need to get a spi to uart chip (max14830) to work, which has almost
> the same configuration so I'm hoping that solving this issue, will also
> solve the max14830.
>
> I will try out your tool, looks very promising ;) Thanks for the help.
>
>
> fredag 19. august 2016 15.42.06 UTC+2 skrev Matthijs van Duin følgende:
>>
>> I haven't really looked yet at your overlay, but two immediate thoughts:
>> 1. why on earth are you using an spi can controller when there are *two*
>> built-in CAN controllers already on the beaglebone?
>> 2. you have cape-universal enabled, this conflicts with pretty much every
>> overlay (remove the cape_universal=enable from cmdline in your
>> /boot/uEnv.txt
>>
>> BTW I made some utils to make the process of writing overlays less
>> painful: https://github.com/mvduin/overlay-utils
>> It lets you write them as device tree fragments and automatically
>> converts them to the structure requires for overlays. It also includes
>> macros that make pinmux much easier to read. No support for overlay
>> metadata though, I didn't bother since the new configfs mechanism to load
>> overlays ignores it anyway.
>>
>> Matthijs
>>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beagleboard/01fc36f9-5d81-4597-acc6-d553e02a231b%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORr2YTJxoHPX%2B5%2B%3D0WR453ZpbHCPm8HEKJ_0kCn7MLVcQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2016-08-19 Thread laurits . triple
1. Haha! It does? Must have missed it when I looked on the pinmap.
2. Tried to disable universal cape, makes no difference. 

Anyways. I still want to get it to work. Have spent so much time on it, and 
I would hate to just let it go. Even though I probably won't use it. I also 
need to get a spi to uart chip (max14830) to work, which has almost the 
same configuration so I'm hoping that solving this issue, will also solve 
the max14830.

I will try out your tool, looks very promising ;) Thanks for the help.


fredag 19. august 2016 15.42.06 UTC+2 skrev Matthijs van Duin følgende:
>
> I haven't really looked yet at your overlay, but two immediate thoughts:
> 1. why on earth are you using an spi can controller when there are *two* 
> built-in CAN controllers already on the beaglebone?
> 2. you have cape-universal enabled, this conflicts with pretty much every 
> overlay (remove the cape_universal=enable from cmdline in your 
> /boot/uEnv.txt
>
> BTW I made some utils to make the process of writing overlays less 
> painful: https://github.com/mvduin/overlay-utils
> It lets you write them as device tree fragments and automatically converts 
> them to the structure requires for overlays. It also includes macros that 
> make pinmux much easier to read. No support for overlay metadata though, I 
> didn't bother since the new configfs mechanism to load overlays ignores it 
> anyway.
>
> Matthijs
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/01fc36f9-5d81-4597-acc6-d553e02a231b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2016-08-19 Thread Matthijs van Duin
The clocks node is definitely wrong. Every top-level node in an overlay 
file is treated as a fragment (names like fragment@0 are conventional but 
not actually important), but your clocks-node has no target property nor an 
__overlay__ child node, so it accomplishes nothing.

Matthijs

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/e3830e19-705f-4b0d-bd60-1106ebd11baa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

2016-08-19 Thread Matthijs van Duin
I haven't really looked yet at your overlay, but two immediate thoughts:
1. why on earth are you using an spi can controller when there are *two* 
built-in CAN controllers already on the beaglebone?
2. you have cape-universal enabled, this conflicts with pretty much every 
overlay (remove the cape_universal=enable from cmdline in your 
/boot/uEnv.txt

BTW I made some utils to make the process of writing overlays less painful: 
https://github.com/mvduin/overlay-utils
It lets you write them as device tree fragments and automatically converts 
them to the structure requires for overlays. It also includes macros that 
make pinmux much easier to read. No support for overlay metadata though, I 
didn't bother since the new configfs mechanism to load overlays ignores it 
anyway.

Matthijs

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/81412771-e2bd-44c2-ab16-f0d2417a3288%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.