Jump to content

MCP2515 CAN Bus on orange Pi one


jwhouwers

Recommended Posts

Armbianmonitor:

Hello All,


I'm trying to set-up MCP2515 on 8mhz on orange Pi one on SPI0
running recent installed Armbian 5.9 / Linux 3.4.113-sun8i

 

can bus support orange pi zero

i was reading trough above for pi Zero and trying get the unit up and running, but no luck till now,

 

CAN unit is modifed, so 3v3 for mcp and 5v for can tranciever, connections:
pin1 3v3 power on vcc for mcp2515
pin2 5v power for cantranciever
pin6 gnd
pin19/PC0(GPIO Orange PI) MOSI - (MCP2515<->CAN) SI
pin21/PC1(GPIO Orange PI) MISO - (MCP2515<->CAN) SO
pin23/PC2(GPIO Orange PI) CLK   - (MCP2515<->CAN) SCK
pin24/PC3(GPIO Orange PI) CS     - (MCP2515<->CAN) CS
pin29 PA7(GPIO Orange PI)  INT    - (MCP2515<->CAN) INT

 

connected per i/o schematic from: Pi one GPIO   

overlay for mcp2515
in folder boot/user-overlay --> sun8i-h3-spi0-mcp2515.dtbo


ArmbianEnv.txt

verbosity=1
console=serial
overlay_prefix=sun8i-h3
disp_mem_reserves=on
extraargs=cma=96M
rootdev=UUID=698619e7-7638-4282-b3c1-743acf73e189
rootfstype=ext4
overlays=spi-spidev0
user_overlays=spi0-mcp2515
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

debug via serial cable,during start-up no spi seems enabled..
        U-Boot 2018.05-armbian (Jul 05 2019 - 23:30:10 +0200) Allwinner Technology

        CPU:   Allwinner H3 (SUN8I 1680)
        Model: Xunlong Orange Pi One
        DRAM:  512 MiB
        MMC:   SUNXI SD/MMC: 0
        Loading Environment from EXT4... ** File not found /boot/boot.env **

        ** Unable to read "/boot/boot.env" from mmc0:1 **
        Failed (-5)
        In:    serial
        Out:   serial
        Err:   serial
        Net:   phy interface0
        eth0: ethernet@1c30000
        230454 bytes read in 25 ms (8.8 MiB/s)
        starting USB...
        USB0:   USB EHCI 1.00
        USB1:   USB OHCI 1.0
        scanning bus 0 for devices... Device NOT ready
           Request Sense returned 02 3A 00
        6 USB Device(s) found
               scanning usb for storage devices... 0 Storage Device(s) found
        Autoboot in 1 seconds, press <Space> to stop

 

i'm a bit puzzled how find out what i do wrong with the overlays, upon check:
root@orangepione:# dmesg | grep spi||mcp
[    0.628802] sunxi_spi_chan_cfg()1376 - [spi-0] has no spi_regulator.
[    0.628817] sunxi_spi_chan_cfg()1376 - [spi-1] has no spi_regulator.
[    0.629394] spi spi0: master is unqueued, this is deprecated

 

Seems i would have something wrong in armbianenv.txt / what do i have wrong in overlay..

some good direction pointer were really appreciated..

Link to comment
Share on other sites

14 hours ago, jwhouwers said:

overlays=spi-spidev0

Such "spi-spidev0" overlay doesn't exist by default. Did you wrote your own ?

The one that exist is :

overlays=spi-spidev
param_spidev_spi_bus=0

Also, your u-boot log is truncated, we don't see the part where overlays are loaded ...

Link to comment
Share on other sites

Martin,

 

thanks for the reply, changed per your comments,

as no i did not write one, but same result on dsmeg as above..

looks like spi0 were not enabled, used the mcp2515 board earlier with arduino without issue's

 

added the u-boot file, and dtbo overlay file..i was checking the overlay info from Armbian user-guide

it made me doubt on the folder locations, after installing base image copied attached dtbo file to folder /boot/overlay-user

or do i need to do something after copying???

 

 

ArmbianEnv.txt

verbosity=1
console=serial
overlay_prefix=sun8i-h3
disp_mem_reserves=on
extraargs=cma=96M
rootdev=UUID=698619e7-7638-4282-b3c1-743acf73e189
rootfstype=ext4
overlays=spi-spidev

param_spidev_spi_bus=0
user_overlays=spi0-mcp2515
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

i checked the u-boot log but can't see it seems to load the mcp2515 overlay..

but i'm not experienced enough on this..

 

root@orangepione:~# dmesg | grep spi||mcp
[    0.629326] sunxi_spi_chan_cfg()1376 - [spi-0] has no spi_regulator.
[    0.629340] sunxi_spi_chan_cfg()1376 - [spi-1] has no spi_regulator.
[    0.629914] spi spi0: master is unqueued, this is deprecated

 

JW

 

sun8i-h3-spi0-mcp2515.dtbo orange_PI_one_U_boot.txt

Link to comment
Share on other sites

14 hours ago, jwhouwers said:

looks like spi0 were not enabled

I'm seeing in your boot log "Armbian Linux 3.4.113-sun8i", this is a Legacy image, and Legacy images doesn't support DT overlays at all !

You should try with Mainline "current" or "dev" images ...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines