Jump to content

nagaudio

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by nagaudio

  1. Hi everyone!

     

    I have compiled a boot image for MangoPi Pro D1 from the source code at the link

    https://github.com/chainsx/armbian-riscv-build

     

    these sources, as I understand it, are based on:
    https://github.com/150balbes/build

     

    The image is working, but I can't install Kernel Headers

     

    Console displays me the following message:

    max@nezha:~$ sudo apt install linux-headers-$(uname -r)
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    E: Unable to locate package linux-headers-5.19.17-d1
    E: Couldn't find any package by glob 'linux-headers-5.19.17-d1'

     

    Which way should we move and dig to resolve the issue?

     

    cat /proc/version

    Linux version 5.19.17-d1 (root@jammy-vm) (riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.6.1 B-20220906) 10.2.0, GNU ld (GNU Binutils) 2.35) #riscv Sun Jan 14 14:33:15 +04 2024

     

  2. add some extra info for activating mcp2515 driver on AIR.

     

    put next files  (from attach) to next directories:

    /boot/dtb-5.15.33-sunxi/overlay/

    sun8i-h3-uart3.dtbo

    (with disabled uart2, because it use PA2 pin, which is necessary to use as INTERRUPT pin)

     

    /overlay-user/

    spi-mcp251x.dts,

    spi-mcp251x.dtbo

    (with configured correct pins)

     

    /boot/dtb-5.15.33-sunxi/

    sun8i-h3-nanopi-neo-air.dts,

    sun8i-h3-nanopi-neo-air.dtbo

    (customized setup SPI bus on Armbian 22.05.0-trunk Focal with Linux 5.15.33-sunxi)

    mcp2115.zip

  3. Its work succeful on NanoPi neo Air

     

    Armbian 22.05.0-trunk Focal with Linux 5.15.33-sunxi
     

     

    armbianEnv.txt

    verbosity=1
    bootlogo=false
    console=serial
    disp_mode=1920x1080p60
    overlay_prefix=sun8i-h3
    overlays=i2c0 spi-spidev usbhost2 usbhost3 w1-gpio
    param_spidev_spi_bus=1
    param_spidev_spi_cs=1
    param_spidev_max_freq=1000000
    rootdev=UUID=b159adca-200e-4061-b610-b41e2ca7e38e
    rootfstype=ext4
    user_overlays=sun8i-h3-i2s0-master spi-mcp251x
    usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

     

    interrupt set on PA2 in dts / dtbo file

     

     

    2023-06-24_23-05-08.png

     

    photo_2023-06-25_10-49-37.jpg

    spi-mcp251x.dtbo spi-mcp251x.dts

  4. hi everyone!

     

    try to start MCP2515 on Nano Pi Neo Air, have next success:

     

    Armbian 22.05.0-trunk Focal with Linux 5.15.33-sunxi
    
    root@nanopiair:~# dmesg | grep spi
    [    1.965166] sun6i-spi 1c68000.spi: chipselect 0 already in use
    [    1.965202] spi_master spi0: spi_device register error /soc/spi@1c68000/spidev@0
    [    1.965257] spi_master spi0: Failed to create SPI device for /soc/spi@1c68000/spidev@0
    [    1.965550] sun8i-h3-pinctrl 1c20800.pinctrl: pin PA15 already requested by 1c28c00.serial; cannot claim for 1c69000.spi
    [    1.965580] sun8i-h3-pinctrl 1c20800.pinctrl: pin-15 (1c69000.spi) status -22
    [    1.965632] sun6i-spi 1c69000.spi: Error applying setting, reverse things back
    [   13.173316] mcp251x spi0.0 can0: MCP2515 successfully initialized.
    
    root@nanopiair:~# dmesg | grep mcp
    [   13.173316] mcp251x spi0.0 can0: MCP2515 successfully initialized.
    
    root@nanopiair:~# dmesg | fgrep -i can
    [    1.965550] sun8i-h3-pinctrl 1c20800.pinctrl: pin PA15 already requested by 1c28c00.serial; cannot claim for 1c69000.spi
    [   13.093230] CAN device driver interface
    [   13.173316] mcp251x spi0.0 can0: MCP2515 successfully initialized.
    
    root@nanopiair:~# sudo ip link set can0 up type can bitrate 500000
    root@nanopiair:~# ifconfig
    can0: flags=193<UP,RUNNING,NOARP>  mtu 16
            unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    

     

    but can data doesnt receive and send to other device.

     

    this is my overlay

    /dts-v1/;
    /plugin/;
    
    / {
    	compatible = "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
    
    	fragment@0 {
    		target-path = "/clocks";
    		__overlay__ {
    			#address-cells = <1>;
    			#size-cells = <1>;
    			can0_osc_fixed: can0_osc_fixed {
    				compatible = "fixed-clock";
    				#clock-cells = <0>;
    				clock-frequency  = <40000000>;
    			};
    		};
    	};
    
    	fragment@1 {
    		target = <&pio>;
    		__overlay__ {
    			can0_pin_irq: can0_pin_irq {
    				pins = "PA2";
    				function = "irq";
    				drive = <0x0>;
    				pull = <0x1>;
    				linux,phandle = <0x1>;
    				phandle = <0x1>;
    			};
    		};
    	};
    
    	fragment@2 {
    		target = <&spi0>;
    		__overlay__ {
    			#address-cells = <1>;
    			#size-cells = <0>;
    			status = "okay";
    			mcp2515 {
    				reg = <0>;
    				compatible = "microchip,mcp2515";
    				pinctrl-names = "default";
    				pinctrl-0 = <&can0_pin_irq>;
    				spi-max-frequency = <500000>;
    				interrupt-parent = <&pio>;
    				interrupts = <0 2 8>;
    				clocks = <&can0_osc_fixed>;
    				status = "okay";
    			};
    		};
    	};
    };

     

    this is my boot config

     

    verbosity=1
    bootlogo=false
    console=serial
    disp_mode=1920x1080p60
    overlay_prefix=sun8i-h3
    overlays=i2c0 spi-spidev usbhost2 usbhost3 w1-gpio
    param_spidev_spi_bus=1
    param_spidev_spi_cs=1
    param_spidev_max_freq=1000000
    rootdev=UUID=b159adca-200e-4061-b610-b41e2ca7e38e
    rootfstype=ext4
    user_overlays=sun8i-h3-i2s0-master spi-mcp251x
    usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

     

    try to test loopback:

    sudo ip link set can0 type can loopback on
    cansend can0 001#1122334455667788

     

    but command

    candump can0

     

    doesnt anwer me, just hold it tty. only CTRL+C breacked it.

     

    Please help me to dig and solve problem.


     

  5. 03.04.2022 в 01:56, Falcounet сказал:

    So basically, I used armian-config to edit the Device Tree (System => Dtc),

    Browse the DT over soc => spi@1c68000
    And I added these lines :

    spi@1c68000 {
    	...
    	spidev@0x00 {
    		compatible = "rohm,dh2228fv";
    		spi-max-frequency = <100000000>;
    		reg = <0x00>;
    	};
    }

     

    And the same for the second SPI controller :
     

    spi@1c69000 {
    	...
    	spidev@0x00 {
    		compatible = "rohm,dh2228fv";
    		spi-max-frequency = <100000000>;
    		reg = <0x00>;
    	};
    }

     

    I also had to remove the spidev stuff from /boot/armbianEnv.conf (No spi-spidev overlay)

    This way, I get two SPI devices and the SBC is working again with 5.15 kernel :
     

    # ls /dev/ | grep spi
    spidev0.0
    spidev1.0

     

     

    this one really works! thank you!

     

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines