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 = <16000000>;
>>                 #clock-cells = <0>;
>>         };
>>
>>         clk4m:clk4m{
>>                 compatible = "fixed-clock";
>>                 clock-frequency = <4000000>;
>>                 #clock-cells = <0>;
>>         };
>> };
>>
>> &ldo3_reg {
>>         regulator-min-microvolt = <1800000>;
>>         regulator-max-microvolt = <1800000>;
>>         regulator-always-on;
>> };
>>
>> &mmc1 {
>>         vmmc-supply = <&vmmcsd_fixed>;
>> };
>>
>> &mmc2 {
>>         vmmc-supply = <&vmmcsd_fixed>;
>>         pinctrl-names = "default";
>>         pinctrl-0 = <&emmc_pins>;
>>         bus-width = <8>;
>>         status = "okay";
>> };
>>
>> &cpu0_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@1000000000 {
>>                 opp-supported-hw = <0x06 0x0100>;
>>         };
>> };
>>
>>
>> &am33xx_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 */
>>                 >;
>>         };
>> };
>>
>> &spi1{
>>         status="okay";
>>         pinctrl-names="default";
>>         pinctrl-0=<&spi1_pins>;
>>
>>         /*spi1@0{
>>                 compatible="spidev";
>>                 reg=<0>;
>>                 spi-max-frequency=<16000000>;
>>         };*/
>>
>>         max14830@0{
>>                 compatible="maxim,max14830";
>>                 reg=<0>;
>>                 spi-max-frequency=<16000000>;
>>                 clocks=<&clk4m>;
>>                 clock-names="osc";
>>                 interrupt-parent=<&gpio3>;
>>                 interrupts=<19 IRQ_TYPE_EDGE_FALLING>;
>>                 gpio-controller;
>>                 #gpio-cells=<2>;
>>         };
>>         mcp2515@1{
>>                 compatible="microchip,mcp2515";
>>                 reg=<1>;
>>                 spi-max-frequency=<10000000>;
>>                 pinctrl-names="default";
>>                 pinctrl-0=<&mcp2515_pins>;
>>                 clocks=<&clk16m>;
>>                 interrupt-parent=<&gpio3>;
>>                 interrupts=<21 IRQ_TYPE_EDGE_FALLING>;
>>         };
>> };
>>
>> &spi0{
>>         status="okay";
>>         pinctrl-names="default";
>>         pinctrl-0=<&spi0_pins>;
>>
>>         spi0@0{
>>                 compatible="spidev";
>>                 reg=<0>;
>>                 spi-max-frequency=<16000000>;
>>         };
>> };
>>
>>
>> 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 
>> garp                    5769  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_rndis            22191  2 g_ether
>> mcp251x                 9039  0 
>> u_ether                11898  3 usb_f_ecm,usb_f_rndis,g_ether
>> libcomposite           43717  3 usb_f_ecm,usb_f_rndis,g_ether
>> can_dev                11820  1 mcp251x
>> spidev                  7523  0 
>> bnep                   13652  2 
>> omap_aes_driver        19045  0 
>> omap_sham              21340  0 
>> bluetooth             419221  7 bnep
>> rfkill                 18276  3 bluetooth
>> omap_rng                4423  0 
>> rng_core                7703  1 omap_rng
>> snd_soc_davinci_mcasp    17079  0 
>> snd_soc_edma            1290  1 snd_soc_davinci_mcasp
>> snd_soc_omap            3058  1 snd_soc_davinci_mcasp
>> snd_soc_core          155549  3 
>> snd_soc_davinci_mcasp,snd_soc_edma,snd_soc_omap
>> snd_pcm_dmaengine       5209  2 snd_soc_core,snd_soc_omap
>> snd_pcm                83341  4 
>> snd_soc_davinci_mcasp,snd_soc_core,snd_soc_omap,snd_pcm_dmaengine
>> snd_timer              19788  1 snd_pcm
>> snd                    59495  3 snd_soc_core,snd_timer,snd_pcm
>> soundcore               7637  1 snd
>> spi_omap2_mcspi        11148  0 
>> nfsd                  261377  13 
>> evdev                  10695  2 
>> uio_pdrv_genirq         3539  0 
>> uio                     8822  1 uio_pdrv_genirq
>> pru_rproc              13507  0 
>> pruss_intc              7451  1 pru_rproc
>> pruss                  10611  1 pru_rproc
>>
>> I have used https://www.sparkfun.com/products/13262 with bi-directional 
>> heconverters on the logic signals.
>>
>> I don't understand what I am doing wrong? Dmesg output here: 
>> http://dpaste.com/2XSZV56
>>
>>
>> fredag 19. august 2016 19.37.11 UTC+2 skrev William Hermans følgende:
>>>
>>> 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 <[email protected]> 
>>> 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 <[email protected]> 
>>>> 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, <[email protected]> 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 [email protected].
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/beagleboard/01fc36f9-5d81-4597-acc6-d553e02a231b%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/beagleboard/01fc36f9-5d81-4597-acc6-d553e02a231b%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/e1e63b79-94e6-4c56-8a18-e6b82c01bea1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to