Microchip mcp2515, can over spi, not working. Wrong device tree overlay?

1,468 views
Skip to first unread message

laurits...@gmail.com

unread,
Aug 19, 2016, 6:54:37 AM8/19/16
to BeagleBoard
Hi!

I'm trying to get mcp2515 to work. It is a can over spi chip and I can't seem to get the device tree overlay right. I made a simple c driver using spidev to check if my hardware was right. Using that driver I can read/write to registers so I'm assuming my hardware is correct. The chip is connected to an external 20mhz oscillator. I've been stuck for this for a week now, and really need some help to get this to work.

What I have tried so far:
A lot of variations on the devicetree overlay posted below.
Hooked up an oscilloscope, and there is no data going in either direction.
Bought a sparkfun can breakoutboard, and some hex converters, but same problem (so hardware is probably right)

I think there is something worng with the way I define the clock or the interrupts, but honestly, I've never done anything this advanced in the device tree overlay, just the regular stuff where there are a lot of resources on the internet, like getting i2c,uart,spi etc. to work.


After enabling the driver lsmod tells me can_dev is loaded and used by mcp251x.
cat /sys/bus/spi/devices/*/modalias returns spi:mcp2515.
ip a show no can devices.

This is my device tree overlay for the chip:

/dts-v1/;
/plugin/;


/ {
        compatible = "ti,beaglebone", "ti,beaglebone-black";

        /
* identification */
        part-number = "BB-MIKRO-01";

        /
* state the resources this cape uses */
        exclusive-use =
                /
* the pin header uses */
                "P9.25",        /
* spi irq: gpio3_21 */
                "P9.31",        /
* spi: spi1_sclk */
                "P9.29",        /
* spi: spi1_d0 */
                "P9.30",        /
* spi: spi1_d1 */
                "P9.28",        /
* spi: spi1_cs0 */
                /
* the hardware IP uses */
                "gpio3_21",
                "spi1";

        clocks{
                extclk: oscillator {
                        compatible="fixed-clock";
                        #clock-cells = <0>;
                        clock-frequency=<20000000>;
                };
        };

        fragment@0 {
                target = <&am33xx_pinmux>;
                __overlay__ {
                        spi1_pins: pinmux_spi1_pins {
                                pinctrl-single,pins = <
                                        0x190 0x33      /
* mcasp0_aclkx.spi1_sclk, RX_ENABLED | PULLUP | MODE3 */
                                        0x194 0x33      /
* mcasp0_fsx.spi1_d0, RX_ENABLED | PULLUP | MODE3 */
                                        0x198 0x13      /
* mcasp0_axr0.spi1_d1, OUTPUT_PULLUP | MODE3 */
                                        0x19c 0x13      /
* mcasp0_ahclkr.spi1_cs0, OUTPUT_PULLUP | MODE3 */
                                        0x1ac 0x37      /
* mcasp0_ahclkx.gpio3_21, RX_ENABLED | PULLUP | MODE7 */
                                >;
                        };
                };
        };

        fragment@2 {
              target = <&spi1>;

                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;

                        status    = "okay";
                        pinctrl-names   = "default";
                        pinctrl-0       = <&spi1_pins>;
                        ti,pio-mode; /
* disable dma when used as an overlay, dma gets stuck at 160 bits... */

                        can0: can@1 {
                                compatible = "microchip,mcp2515";
                                reg = <0>; /
* cs0 */
                                mode
= <0>;

                                spi
-max-frequency = <10000000>;
                                clocks
=<&extclk>;
                                interrupt
-parent = <&gpio3>;
                                interrupts
= <21 0x02>;
                       
};

               
};
       
};

};

dmesg after enabling it on boot with uEnv.txt:
debian@arm:~$ dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.4.15-ti-r37 (root@a3-imx6q-wandboard-2gb) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP Tue Jul 19 17:04:02 UTC 2016
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=50c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: TI AM335x BeagleBone Black
[    0.000000] cma: Reserved 24 MiB at 0x9e000000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] On node 0 totalpages: 130560
[    0.000000] free_area_init_node: node 0, pgdat c0c20300, node_mem_map df96d000
[    0.000000]   Normal zone: 1152 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 130560 pages, LIFO batch:31
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon )
[    0.000000] PERCPU: Embedded 13 pages/cpu @df925000 s24320 r8192 d20736 u53248
[    0.000000] pcpu-alloc: s24320 r8192 d20736 u53248 alloc=13*4096
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129408
[    0.000000] Kernel command line: console=ttyO0,115200n8 bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN bone_capemgr.enable_partno=BB-MIKRO-01 root=UUID=038be4da-7eba-45f9-977b-3540d6ac25f8 ro rootfstype=ext4 rootwait coherent_pool=1M cape_universal=enable
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 474144K/522240K available (7291K kernel code, 901K rwdata, 3680K rodata, 600K init, 907K bss, 23520K reserved, 24576K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
    vector  
: 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  
: 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc
: 0xe0800000 - 0xff800000   ( 496 MB)
    lowmem  
: 0xc0000000 - 0xe0000000   ( 512 MB)
    pkmap  
: 0xbfe00000 - 0xc0000000   (   2 MB)
    modules
: 0xbf800000 - 0xbfe00000   (   6 MB)
     
.text : 0xc0008000 - 0xc0abf164   (10973 kB)
     
.init : 0xc0ac0000 - 0xc0b56000   ( 600 kB)
     
.data : 0xc0b56000 - 0xc0c37658   ( 902 kB)
       
.bss : 0xc0c3a000 - 0xc0d1cd68   ( 908 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000]  RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000013] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000032] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000044] OMAP clocksource: timer1 at 24000000 Hz
[    0.001148] clocksource_probe: no matching clocksources found
[    0.001333] Console: colour dummy device 80x30
[    0.001359] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.001366] This ensures that you still see kernel messages. Please
[    0.001372] update your kernel commandline.
[    0.001389] Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
[    0.046926] pid_max: default: 32768 minimum: 301
[    0.047060] Security Framework initialized
[    0.047074] Yama: becoming mindful.
[    0.047107] AppArmor: AppArmor disabled by boot time parameter
[    0.047265] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.047278] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.048060] Initializing cgroup subsys io
[    0.048092] Initializing cgroup subsys memory
[    0.048132] Initializing cgroup subsys devices
[    0.048149] Initializing cgroup subsys freezer
[    0.048166] Initializing cgroup subsys net_cls
[    0.048179] Initializing cgroup subsys perf_event
[    0.048194] Initializing cgroup subsys net_prio
[    0.048208] Initializing cgroup subsys pids
[    0.048265] CPU: Testing write buffer coherency: ok
[    0.048317] ftrace: allocating 33957 entries in 67 pages
[    0.132753] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.132873] Setting up static identity map for 0x80008240 - 0x8000828c
[    0.136328] Brought up 1 CPUs
[    0.136349] SMP: Total of 1 processors activated (995.32 BogoMIPS).
[    0.136357] CPU: All CPU(s) started in SVC mode.
[    0.137774] devtmpfs: initialized
[    0.155513] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.173278] omap_hwmod: debugss: _wait_target_disable failed
[    0.228460] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.230587] xor: measuring software checksum speed
[    0.266931]    arm4regs  :  1221.000 MB/sec
[    0.306926]    8regs     :  1093.000 MB/sec
[    0.346927]    32regs    :  1153.000 MB/sec
[    0.386924]    neon      :  1731.000 MB/sec
[    0.386931] xor: using function: neon (1731.000 MB/sec)
[    0.387029] pinctrl core: initialized pinctrl subsystem
[    0.388946] NET: Registered protocol family 16
[    0.392445] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.393646] cpuidle: using governor ladder
[    0.393668] cpuidle: using governor menu
[    0.398764] OMAP GPIO hardware version 0.1
[    0.409880] No ATAGs?
[    0.409910] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.410449] omap4_sram_init:Unable to allocate sram needed to handle errata I688
[    0.410461] omap4_sram_init:Unable to get sram pool needed to handle errata I688
[    0.487083] raid6: int32x1  gen()   270 MB/s
[    0.555030] raid6: int32x1  xor()   240 MB/s
[    0.623073] raid6: int32x2  gen()   356 MB/s
[    0.690930] raid6: int32x2  xor()   269 MB/s
[    0.759074] raid6: int32x4  gen()   405 MB/s
[    0.826936] raid6: int32x4  xor()   259 MB/s
[    0.895079] raid6: int32x8  gen()   359 MB/s
[    0.963051] raid6: int32x8  xor()   231 MB/s
[    1.030955] raid6: neonx1   gen()  1457 MB/s
[    1.098938] raid6: neonx1   xor()   847 MB/s
[    1.166932] raid6: neonx2   gen()  1880 MB/s
[    1.234944] raid6: neonx2   xor()  1166 MB/s
[    1.302946] raid6: neonx4   gen()  1974 MB/s
[    1.370942] raid6: neonx4   xor()  1204 MB/s
[    1.438960] raid6: neonx8   gen()  1211 MB/s
[    1.506942] raid6: neonx8   xor()   672 MB/s
[    1.506949] raid6: using algorithm neonx4 gen() 1974 MB/s
[    1.506956] raid6: .... xor() 1204 MB/s, rmw enabled
[    1.506962] raid6: using intx1 recovery algorithm
[    1.515698] edma 49000000.edma: TI EDMA DMA engine driver
[    1.520192] SCSI subsystem initialized
[    1.520563] libata version 3.00 loaded.
[    1.520887] usbcore: registered new interface driver usbfs
[    1.520957] usbcore: registered new interface driver hub
[    1.521049] usbcore: registered new device driver usb
[    1.521603] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[    1.521648] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe
[    1.521771] media: Linux media interface: v0.10
[    1.521831] Linux video capture interface: v2.00
[    1.521934] pps_core: LinuxPPS API ver. 1 registered
[    1.521943] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.521971] PTP clock support registered
[    1.522810] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    1.524190] NetLabel: Initializing
[    1.524205] NetLabel:  domain hash size = 128
[    1.524211] NetLabel:  protocols = UNLABELED CIPSOv4
[    1.524273] NetLabel:  unlabeled traffic allowed by default
[    1.524648] clocksource: Switched to clocksource timer1
[    1.630046] NET: Registered protocol family 2
[    1.630802] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    1.630851] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    1.630909] TCP: Hash tables configured (established 4096 bind 4096)
[    1.630976] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    1.630996] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    1.631287] NET: Registered protocol family 1
[    1.631798] RPC: Registered named UNIX socket transport module.
[    1.631809] RPC: Registered udp transport module.
[    1.631816] RPC: Registered tcp transport module.
[    1.631821] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.632379] Unpacking initramfs...
[    1.962944] Freeing initrd memory: 4688K (cfb6c000 - d0000000)
[    1.963623] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    1.966146] futex hash table entries: 256 (order: 2, 16384 bytes)
[    1.966259] audit: initializing netlink subsys (disabled)
[    1.966333] audit: type=2000 audit(1.904:1): initialized
[    1.975995] zbud: loaded
[    1.976705] VFS: Disk quotas dquot_6.6.0
[    1.976948] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.979438] NFS: Registering the id_resolver key type
[    1.979506] Key type id_resolver registered
[    1.979514] Key type id_legacy registered
[    1.979542] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.979872] fuse init (API version 7.23)
[    1.980445] SGI XFS with ACLs, security attributes, realtime, no debug enabled
[    1.988161] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.988374] io scheduler noop registered
[    1.988388] io scheduler deadline registered
[    1.988447] io scheduler cfq registered (default)
[    1.989826] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    1.991443] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    1.992862] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[    1.995651] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
[    2.891623] console [ttyS0] enabled
[    2.896537] [drm] Initialized drm 1.1.0 20060810
[    2.952716] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[    2.958878] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[    2.965446] davinci_mdio: dt: updated phy_id[0] from phy_mask[fffffffe]
[    2.979016] libphy: 4a101000.mdio: probed
[    2.983152] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    2.993263] cpsw 4a100000.ethernet: Detected MACID = 6c:ec:eb:ab:d4:bb
[    3.001765] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.008494] ehci-platform: EHCI generic platform driver
[    3.013967] ehci-omap: OMAP-EHCI Host Controller driver
[    3.019658] usbcore: registered new interface driver usb-storage
[    3.027625] 47401300.usb-phy supply vcc not found, using dummy regulator
[    3.036757] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
[    3.036774] musb-hdrc: MHDRC RTL version 2.0
[    3.036782] musb-hdrc: setup fifo_mode 4
[    3.036798] musb-hdrc: 28/31 max ep, 16384/16384 memory
[    3.038234] 47401b00.usb-phy supply vcc not found, using dummy regulator
[    3.047121] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
[    3.047137] musb-hdrc: MHDRC RTL version 2.0
[    3.047145] musb-hdrc: setup fifo_mode 4
[    3.047159] musb-hdrc: 28/31 max ep, 16384/16384 memory
[    3.047284] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    3.053152] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[    3.061282] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    3.068127] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.075417] usb usb1: Product: MUSB HDRC host driver
[    3.080420] usb usb1: Manufacturer: Linux 4.4.15-ti-r37 musb-hcd
[    3.086467] usb usb1: SerialNumber: musb-hdrc.1.auto
[    3.092369] hub 1-0:1.0: USB hub found
[    3.096280] hub 1-0:1.0: 1 port detected
[    3.109261] mousedev: PS/2 mouse device common for all mice
[    3.116901] omap_rtc 44e3e000.rtc: already running
[    3.122162] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[    3.130102] i2c /dev entries driver
[    3.135123] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    3.142459] cpuidle: enable-method property 'ti,am3352' found operations
[    3.149875] omap_hsmmc 48060000.mmc: Got CD GPIO
[    3.218047] hidraw: raw HID events driver (C) Jiri Kosina
[    3.224309] usbcore: registered new interface driver usbhid
[    3.229992] usbhid: USB HID core driver
[    3.237318] ashmem: initialized
[    3.241483]  remoteproc0: wkup_m3 is available
[    3.246057]  remoteproc0: Note: remoteproc is still under development and considered experimental.
[    3.255076]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[    3.270092] NET: Registered protocol family 10
[    3.278057] mip6: Mobile IPv6
[    3.281150] NET: Registered protocol family 17
[    3.285768] Key type dns_resolver registered
[    3.290096] mpls_gso: MPLS GSO support
[    3.294253] omap_voltage_late_init: Voltage driver support not added
[    3.301939] PM: Cannot get wkup_m3_ipc handle
[    3.306506] ThumbEE CPU extension supported.
[    3.310907] Registering SWP/SWPB emulation handler
[    3.316696] registered taskstats version 1
[    3.321007] zswap: loaded using pool lzo/zbud
[    3.325487] mmc1: MAN_BKOPS_EN bit is not set
[    3.333093] Btrfs loaded
[    3.337777] mmc1: new high speed MMC card at address 0001
[    3.352833] mmcblk1: mmc1:0001 MMC04G 3.66 GiB
[    3.360943] mmcblk1boot0: mmc1:0001 MMC04G partition 1 1.00 MiB
[    3.372902] mmcblk1boot1: mmc1:0001 MMC04G partition 2 1.00 MiB
[    3.382115] Key type encrypted registered
[    3.386431]  mmcblk1: p1
[    3.393892] input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/input/input0
[    3.425982] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    3.431886] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    3.438883] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    3.446084] at24 2-0054: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    3.453452] at24 2-0055: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    3.460796] at24 2-0056: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    3.468071] at24 2-0057: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    3.475034] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    3.481691]  remoteproc0: powering up wkup_m3
[    3.486176]  remoteproc0: Booting fw image am335x-pm-firmware.elf, size 219735
[    3.493771]  remoteproc0: remote processor wkup_m3 is now up
[    3.499467] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x191
[    3.510959] bone_capemgr bone_capemgr: Baseboard: '
A335BNLT,00C0,4414BBBK8674'
[    3.518288] bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
[    3.564655] bone_capemgr bone_capemgr: slot #0: No cape found
[    3.608652] bone_capemgr bone_capemgr: slot #1: No cape found
[    3.652652] bone_capemgr bone_capemgr: slot #2: No cape found
[    3.696652] bone_capemgr bone_capemgr: slot #3: No cape found
[    3.702459] bone_capemgr bone_capemgr: enabled_partno PARTNO '
BB-MIKRO-01' VER 'N/A' PR '0'
[    3.710865] bone_capemgr bone_capemgr: slot #4: override
[    3.716218] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[    3.723229] bone_capemgr bone_capemgr: slot #4: '
Override Board Name,00A0,Override Manuf,BB-MIKRO-01'
[    3.732835] bone_capemgr bone_capemgr: initialized OK.
[    3.740032] PM: bootloader does not support rtc-only!
[    3.745757] omap_rtc 44e3e000.rtc: setting system clock to 2016-08-17 13:02:05 UTC (1471438925)
[    3.754629] of_cfs_init
[    3.757259] of_cfs_init: OK
[    3.765093] PM: Hibernation image not present or could not be loaded.
[    3.766300] Freeing unused kernel memory: 600K (c0ac0000 - c0b56000)
[    4.026255] systemd-udevd[105]: starting version 215
[    4.039176] random: systemd-udevd urandom read with 24 bits of entropy available
[    4.741015] bone_capemgr bone_capemgr: loader: failed to load slot-4 BB-MIKRO-01:00A0 (prio 0)
[    5.009532] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null)
[    5.416069] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    5.429962] systemd[1]: Detected architecture '
arm'.
[    5.463177] systemd[1]: Set hostname to <arm>.
[    5.935466] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.
[    5.953727] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
[    5.962113] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    5.969962] systemd[1]: Expecting device dev-ttyS0.device...
[    5.985236] systemd[1]: Starting Remote File Systems (Pre).
[    5.997153] systemd[1]: Reached target Remote File Systems (Pre).
[    6.003683] systemd[1]: Starting Arbitrary Executable File Formats File System Automount Point.
[    6.025189] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    6.034922] systemd[1]: Starting Encrypted Volumes.
[    6.045195] systemd[1]: Reached target Encrypted Volumes.
[    6.050903] systemd[1]: Starting Dispatch Password Requests to Console Directory Watch.
[    6.059331] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    6.067450] systemd[1]: Starting Swap.
[    6.077112] systemd[1]: Reached target Swap.
[    6.081650] systemd[1]: Starting Root Slice.
[    6.093180] systemd[1]: Created slice Root Slice.
[    6.098129] systemd[1]: Starting User and Session Slice.
[    6.113170] systemd[1]: Created slice User and Session Slice.
[    6.119169] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[    6.137183] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    6.144391] systemd[1]: Starting Delayed Shutdown Socket.
[    6.157115] systemd[1]: Listening on Delayed Shutdown Socket.
[    6.163132] systemd[1]: Starting Journal Socket (/dev/log).
[    6.177186] systemd[1]: Listening on Journal Socket (/dev/log).
[    6.183421] systemd[1]: Starting udev Control Socket.
[    6.197117] systemd[1]: Listening on udev Control Socket.
[    6.202850] systemd[1]: Starting udev Kernel Socket.
[    6.221127] systemd[1]: Listening on udev Kernel Socket.
[    6.226748] systemd[1]: Starting Journal Socket.
[    6.237042] systemd[1]: Listening on Journal Socket.
[    6.242408] systemd[1]: Starting System Slice.
[    6.253102] systemd[1]: Created slice System Slice.
[    6.258335] systemd[1]: Started File System Check on Root Device.
[    6.264583] systemd[1]: Starting system-getty.slice.
[    6.277182] systemd[1]: Created slice system-getty.slice.
[    6.282830] systemd[1]: Starting system-serial\x2dgetty.slice.
[    6.297180] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    6.303860] systemd[1]: Starting Increase datagram queue length...
[    6.324541] systemd[1]: Starting Load Kernel Modules...
[    6.376038] systemd[1]: Started Set Up Additional Binary Formats.
[    6.386665] systemd[1]: Mounted Huge Pages File System.
[    6.394179] systemd[1]: Mounting POSIX Message Queue File System...
[    6.415528] systemd[1]: Starting udev Coldplug all Devices...
[    6.469096] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[    6.499634] systemd[1]: Starting Slices.
[    6.517153] systemd[1]: Reached target Slices.
[    6.557108] systemd[1]: Starting Remount Root and Kernel File Systems...
[    6.617089] systemd[1]: Mounted POSIX Message Queue File System.
[    6.643674] EXT4-fs (mmcblk1p1): re-mounted. Opts: errors=remount-ro
[    6.653004] systemd[1]: Started Increase datagram queue length.
[    6.673037] systemd[1]: Started Load Kernel Modules.
[    6.705051] systemd[1]: Started Create list of required static device nodes for the current kernel.
[    6.741012] systemd[1]: Started Remount Root and Kernel File Systems.
[    6.817213] systemd[1]: Started udev Coldplug all Devices.
[    6.997130] systemd[1]: Started Various fixups to make systemd work better on Debian.
[    7.005265] systemd[1]: Starting Load/Save Random Seed...
[    7.021790] systemd[1]: Starting Create Static Device Nodes in /dev...
[    7.054939] systemd[1]: Mounting FUSE Control File System...
[    7.087682] systemd[1]: Mounting Configuration File System...
[    7.141810] systemd[1]: Starting Apply Kernel Variables...
[    7.183055] systemd[1]: Starting Syslog Socket.
[    7.201281] systemd[1]: Listening on Syslog Socket.
[    7.210946] systemd[1]: Starting Journal Service...
[    7.239328] systemd[1]: Started Journal Service.
[    7.598734] systemd-udevd[197]: starting version 215
[    8.264138] systemd-journald[195]: Received request to flush runtime journal from PID 1
[    9.584584] Installing knfsd (copyright (C) 1996 ok...@monad.swb.de).
[    9.720319] davinci-mcasp 48038000.mcasp: invalid tdm slots: 0
[    9.812480] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
[    9.917271] davinci-mcasp 4803c000.mcasp: invalid tdm slots: 0
[   10.278291] random: nonblocking pool is initialized
[   11.286416] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
[   11.613462] Bluetooth: Core ver 2.21
[   11.673029] NET: Registered protocol family 31
[   11.677570] Bluetooth: HCI device and connection manager initialized
[   11.751575] Bluetooth: HCI socket layer initialized
[   11.798040] Bluetooth: L2CAP socket layer initialized
[   11.852982] Bluetooth: SCO socket layer initialized
[   12.045391] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
[   12.173199] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[   12.202270] NFSD: starting 90-second grace period (net c0c14840)
[   13.295364] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   13.300832] Bluetooth: BNEP filters: protocol multicast
[   13.365213] Bluetooth: BNEP socket layer initialized
[   14.461863] net eth0: initializing cpsw version 1.12 (0)
[   14.467260] net eth0: initialized cpsw ale version 1.4
[   14.591445] net eth0: phy found : id is : 0x7c0f1
[   14.655928] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   14.779032] using random self ethernet address
[   14.783613] using random host ethernet address
[   14.788128] using host ethernet address: 6C:EC:EB:AB:D4:BD
[   14.793486] using self ethernet address: 6C:EC:EB:AB:D4:B0
[   14.814881] usb0: HOST MAC 6c:ec:eb:ab:d4:bd
[   14.830132] usb0: MAC 6c:ec:eb:ab:d4:b0
[   14.841070] using random self ethernet address
[   14.845605] using random host ethernet address
[   14.865984] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[   14.872733] g_ether gadget: g_ether ready
[   15.160607] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[   15.428875] g_ether gadget: high-speed config #1: CDC Ethernet (ECM)
[   15.436668] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
[   17.605951] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[   17.613941] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   17.690799] 8021q: 802.1Q VLAN Support v1.8
[   17.695213] 8021q: adding VLAN 0 to HW filter on device eth0

dmesg after enabling it on runtime:
debian@arm:~$ sudo sh -c "echo BB-MIKRO-01 > /sys/devices/platform/bone_capemgr/slots"
debian@arm
:~$ dmesg
...
...
...
[   52.139383] bone_capemgr bone_capemgr: part_number 'BB-MIKRO-01', version 'N/A'
[   52.147153] bone_capemgr bone_capemgr: slot #5: override
[   52.152685] bone_capemgr bone_capemgr: Using override eeprom data at slot 5
[   52.159837] bone_capemgr bone_capemgr: slot #5: 'Override Board Name,00A0,Override Manuf,BB-MIKRO-01'
[   52.192478] bone_capemgr bone_capemgr: slot #5: dtbo 'BB-MIKRO-01-00A0.dtbo' loaded; overlay id #0
[   52.244268] CAN device driver interface
[   52.272904] /ocp/spi@481a0000/can@1: could not find phandle
[   52.278881] mcp251x: probe of spi2.0 failed with error -2



Matthijs van Duin

unread,
Aug 19, 2016, 9:42:06 AM8/19/16
to BeagleBoard, laurits...@gmail.com
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

Matthijs van Duin

unread,
Aug 19, 2016, 10:26:45 AM8/19/16
to BeagleBoard, laurits...@gmail.com
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

laurits...@gmail.com

unread,
Aug 19, 2016, 11:46:50 AM8/19/16
to BeagleBoard, laurits...@gmail.com
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.

William Hermans

unread,
Aug 19, 2016, 11:58:48 AM8/19/16
to beagl...@googlegroups.com
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.


--
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+unsubscribe@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.

William Hermans

unread,
Aug 19, 2016, 12:01:40 PM8/19/16
to beagl...@googlegroups.com
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.

William Hermans

unread,
Aug 19, 2016, 1:37:11 PM8/19/16
to beagl...@googlegroups.com
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.

Laurits Telle Riple

unread,
Sep 20, 2016, 9:30:39 AM9/20/16
to BeagleBoard
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
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

thundersp...@gmail.com

unread,
Feb 14, 2017, 10:11:56 AM2/14/17
to BeagleBoard
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

Laurits Telle Riple

unread,
Feb 18, 2017, 9:22:19 AM2/18/17
to BeagleBoard
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.

Mark K Cowan

unread,
Feb 18, 2017, 10:16:42 AM2/18/17
to BeagleBoard
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

roberts...@yahoo.com

unread,
Feb 18, 2017, 11:29:30 AM2/18/17
to beagl...@googlegroups.com

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

Subject: Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?
To: "BeagleBoard" <beagl...@googlegroups.com>
Date: Saturday, February 18, 2017, 5:16 PM
0x37 /*mcasp0_ahclkx.gpio3_21,RX_ ENABLED | PULLUP | MODE7
 Used by8021q                  17930
 0 garp                    5769  1
8021qmrp                     7239  1
8021qstp                     2219  1
garpllc                     5123  2
stp,garpusb_f_ecm               9336
 1 g_ether                 4976
 0 usb_f_rndis            22191  2
g_ethermcp251x                 9039
 0 u_ether                11898  3
usb_f_ecm,usb_f_rndis,g_etherlibcomposite    
      43717  3
usb_f_ecm,usb_f_rndis,g_ethercan_dev        
       11820  1 mcp251xspidev          
       7523  0 bnep                
  13652  2 omap_aes_driver        19045
 0 omap_sham              21340
 0 bluetooth             419221  7
bneprfkill                 18276  3
bluetoothomap_rng                4423
 0 rng_core                7703  1
omap_rngsnd_soc_davinci_mcasp    17079
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 <yyr...@gmail.com> 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 <yyr...@gmail.com> 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, <laurits...@gmail.com> 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-utilsIt lets you write them as
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/dadbe3ea-847d-402e-8002-7f64f7d4f1a8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
erioada regimului legionar-antonescian nu a fost lipsita de contradicp intre protagonistii scenei politice - generalul si legionarii - ambii socotind in numele unor conceptii ideologice totusi diferite alianta temporara si doar un pas catre controlul exclusiv al puterii. Adept al ordinii publice si patriot Ion Antonescc era nemultumit de violentele si crimele legionarilor. Apropierea sa de Germania nazista - generalul fiind ca formatie anglofil - urmarea doar garantarea granitelor tarii a refacerii integritatii teritoriale nationale si a afirmam suveranitatii Romaniei prin anularea Dictatului de la Viena problema pe care de fapt a ridicat-o in toate intalnirile cu Hitler. Convins de rolul nefast al Garzii de Fier Ion Antonescu a luptat de la sfarsitul lui decembrie 1940 pentru eliminarea acesteia din vjata politica. in schimb legionarii pusi pe jaf si pe coruptie ii reprosau generalului ca mentine vechii oameni politici si chiar unele forte politice compromise in colaborarea cu regele Caro al - ea. Confruntarea intre cele doua pozitii a luat forma incercarii supreme a legionarilor de a cuceri puterea politica prin rebeliune.

roberts...@yahoo.com

unread,
Feb 18, 2017, 11:42:05 AM2/18/17
to beagl...@googlegroups.com

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

Subject: Re: [beagleboard] Re: Microchip mcp2515, can over spi, not working. Wrong device tree overlay?
To: beagl...@googlegroups.com
Date: Saturday, February 18, 2017, 6:29 PM
https://groups.google.com/d/msgid/beagleboard/371538802.163835.1487435348012%40mail.yahoo.com.
For more options, visit
https://groups.google.com/d/optout.lebiscitul incepe la 2 14 aprilie 1866. Cu prilejul acestei consultari prealabile ce se va desfasura timp de sase zile cetatenii sunt chemati sa se pronunte prin da sau nu in legatura cu alegerea lui Carol.

Drew Fustini

unread,
Dec 23, 2018, 10:54:25 AM12/23/18
to Beagle Board, ma...@battlesnake.co.uk, ma...@open-cosmos.com
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
> To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/dadbe3ea-847d-402e-8002-7f64f7d4f1a8%40googlegroups.com.

Mark K Cowan

unread,
Dec 23, 2018, 12:43:38 PM12/23/18
to BeagleBoard
For anyone else finding this, the discussion/development is continued on [Github](https://github.com/battlesnake/beaglebone-spi0-mcp2515)

Drew Fustini

unread,
Dec 24, 2018, 3:42:41 PM12/24/18
to Beagle Board, ma...@battlesnake.co.uk, ma...@open-cosmos.com
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 500000 listen-only on
sudo ifconfig can0 up

Thanks,
Drew
beaglebone-black-mcp2515-breakout-board-md.txt

Drew Fustini

unread,
Dec 24, 2018, 4:09:26 PM12/24/18
to Beagle Board
fyi - I have created a pull request to add this dts:
https://github.com/beagleboard/bb.org-overlays/pull/101

-drew
Reply all
Reply to author
Forward
0 new messages