kreestyahn
Members-
Posts
10 -
Joined
-
Last visited
-
External SD Card using SPI on Orange Pi Zero 2W
kreestyahn replied to kreestyahn's topic in Allwinner sunxi
The error disappears and the SPI1 pins' mode set back to ALT4 when only "spi1-cs0-spidev" overlay is enabled. But if only "spi-sd" or both is enabled it set them back to "OFF" and the error appears. -
External SD Card using SPI on Orange Pi Zero 2W
kreestyahn replied to kreestyahn's topic in Allwinner sunxi
now it looks like this:I replaced the target = <&spi1>; to target-path = </soc/spi@5011000>; because i got errors (Reference to non-existent node or label "spi1"). /dts-v1/; / { compatible = "allwinner,sun50i-h616"; fragment@0 { target-path = "/aliases"; __overlay__ { spi0 = "/soc/spi@5010000"; spi1 = "/soc/spi@5011000"; }; }; fragment@1 { target-path = "/soc/spi@5011000"; __overlay__ { spi1_pins: spi1-pins { pins = "PH6\0PH7\0PH8"; function = "spi1"; }; spi1_cs0_pin: spi1-cs0-pin { pins = "PH5"; function = "spi1"; }; }; }; fragment@2 { target-path = "/soc/spi@5011000"; __overlay__ { #address-cells = <0x01>; #size-cells = <0x00>; pinctrl-names = "default\0default"; pinctrl-0 = <&spi1_pins>, <&spi1_cs0_pin>; status = "okay"; mmc@0 { reg = <0x00>; compatible = "mmc-spi-slot"; voltage-ranges = <0xce4 0xce4>; spi-max-frequency = <0x2faf080>; status = "okay"; }; }; }; }; Now I could compile it without any error, but in /dev there is still only one mmcblk. root@orangepizero2w:allwinner/overlay # dmesg | grep -i 'spi' [ 1.415511] spi-nor spi0.0: ZB25VQ128A (16384 Kbytes) [ 24.548702] platform 5011000.spi: deferred probe pending -
External SD Card using SPI on Orange Pi Zero 2W
kreestyahn replied to kreestyahn's topic in Allwinner sunxi
Like this? /dts-v1/; /plugin/; / { compatible = "allwinner,sun50i-h616"; fragment@0 { target-path = "/aliases"; __overlay__ { spi0 = "/soc/spi@5010000"; spi1 = "/soc/spi@5011000"; }; }; fragment@1 { target = <&spi1>; __overlay__ { spi1_pins: spi1-pins { pins = "PH6", "PH7", "PH8"; function = "spi1"; }; spi1_cs0_pin: spi1-cs0-pin { pins = "PH5"; function = "spi1"; }; }; }; fragment@2 { target = <&spi1>; __overlay__ { #address-cells = <1>; #size-cells = <0>; pinctrl-0 = <&spi1_pins>; pinctrl-names = "default", "default"; status = "okay"; mmc@0 { reg = <0>; compatible = "mmc-spi-slot"; voltage-ranges = <3300 3300>; spi-max-frequency = <50000000>; status = "okay"; }; }; }; }; -
External SD Card using SPI on Orange Pi Zero 2W
kreestyahn replied to kreestyahn's topic in Allwinner sunxi
I have created an sun50i-h616-spi-sd.dts: /dts-v1/; /plugin/; / { compatible = "allwinner,sun50i-h616"; fragment@0 { target = <&spi1>; __overlay__ { #address-cells = <1>; #size-cells = <0>; status = "okay"; mmc@0 { reg = <0>; compatible = "mmc-spi-slot"; voltage-ranges = <3300 3300>; spi-max-frequency = <50000000>; status = "okay"; }; }; }; }; compiled it and added into /boot/dtb/allwinner/overlay orangepiEnv.txt: verbosity=1 bootlogo=false console=both disp_mode=1920x1080p60 overlay_prefix=sun50i-h616 rootdev=UUID=6cd6cb54-48bc-4b6a-a615-2abfb7d74fe0 rootfstype=ext4 overlays=pi-i2c1 spi-sd usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u only the main SD is detected: root@orangepizero2w:/ # ls /dev/mmc* /dev/mmcblk1 /dev/mmcblk1p1 root@orangepizero2w:/ # dmesg | grep -i spi dmesg | grep -i mmc [ 1.415702] spi-nor spi0.0: ZB25VQ128A (16384 Kbytes) [ 1.451348] mmc_spi spi1.0: SD/MMC host mmc0, no WP, no poweroff, cd polling [ 1.451348] mmc_spi spi1.0: SD/MMC host mmc0, no WP, no poweroff, cd polling [ 1.482498] sunxi-mmc 4021000.mmc: allocated mmc-pwrseq [ 1.482663] sunxi-mmc 4020000.mmc: Got CD GPIO [ 1.508525] sunxi-mmc 4020000.mmc: initialized, max. request size: 16384 KB, uses new timings mode [ 1.546705] mmc1: host does not support reading read-only switch, assuming write-enable [ 1.548649] mmc1: new high speed SDHC card at address 0001 [ 1.549859] mmcblk1: mmc1:0001 EITSD 7.50 GiB [ 1.552553] mmcblk1: p1 [ 1.712888] sunxi-mmc 4021000.mmc: initialized, max. request size: 16384 KB, uses new timings mode [ 1.731008] mmc2: new high speed SDIO card at address 8800 [ 3.149516] EXT4-fs (mmcblk1p1): mounted filesystem with writeback data mode. Quota mode: none. [ 6.629778] EXT4-fs (mmcblk1p1): re-mounted. Quota mode: none. I can't show you the physical connections because the orange pi is built into a custom board that I don't have access to right now, but the microSD module it connected to the SPI1-MOSI, -MISO, -CLK, -CS0 pins. -
Hello, I have connected a microSD module to the SPI1 CS0 pins Is there a way to mount an SPI device? I tried, but I got this error: mount: /mnt/sdcard: /dev/spidev1.0 is not a block device. What is the best way to easily manage files on this secondary SD card?
-
Thanks, So I have an SD Card module connected to SPI1 (CS0) pins. root@orangepizero2w:~# dmesg | grep -i 'spi' [ 1.336073] sun50i-h616-pinctrl 300b000.pinctrl: pin-64 (5010000.spi) status -517 [ 1.336093] sun6i-spi 5010000.spi: Error applying setting, reverse things back [ 1.336368] sun50i-h616-pinctrl 300b000.pinctrl: pin-230 (5011000.spi) status -517 [ 1.336385] sun6i-spi 5011000.spi: Error applying setting, reverse things back [ 1.349503] spi-nor spi0.0: supply vdd not found, using dummy regulator [ 1.364641] spi-nor spi0.0: spi-nor-generic (16384 Kbytes) [ 234.215538] /dev/spidev1.0: Can't lookup blockdev spidev-test: root@orangepizero2w:/home/kvl/spidev-test# ./spidev_test -D /dev/spidev1.0 -v spi mode: 0x0 bits per word: 8 max speed: 500000 Hz (500 KHz) TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@....▒..................▒. RX | FF FF FF FF FF FF FC 17 FF FF FF FF FF FF FF FF FF FF F0 5F FF FF FF FF FF FF FF FF FF FF FF FF | ......▒...........▒_............ armbian-config> System/Hardware: armbian-config> device tree:
-
Yeah, I just realized that after the reinstall everything worked fine. Maybe I just messed up something before. Thank you for your help! Now I have another issue with SPI. Can I write here or should I open a new topic?
-
Well.. there was a little problem so i reinstalled the whole OS. Currently I only modified armbianEnv.txt. I added this line: overlays:i2c0 I also installed armbian-config and found i2c0-pi in System/Hardware so I enabled it. The device tree is currently unmodified so it has default configuration. Should I remove the PI7-8 from rgmii-pins and then change the i2c0-pins to "PI8\0PI7"? It has also a i2c0-pi-pins. Which one should I modify? i2c0-pi-pins { pins = "PI5\0PI6"; function = "i2c0"; phandle = <0x56>; }; i2c0-pins { pins = "PI6\0PI7"; function = "i2c0"; phandle = <0x1e>; };
-
Hi, How to enable i2c on PI8(SDA) and PI7(SCL)? I'm newbie in linux and not really understand what am I actually doing so I tried to make it with chatgpt but still not working. root@orangepizero2w:/# sudo i2cdetect -y 0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- It can't see any device, but there should be one on the 0x21. Could somebody help me out with this? dmesg | grep i2c [ 0.739582] i2c_dev: i2c /dev entries driver [ 0.739878] mv64xxx_i2c 7081400.i2c: can't get pinctrl, bus recovery not supp orted [ 0.740303] i2c 0-0036: Fixed dependency cycle(s) with /soc/pinctrl@300b000 [ 1.340117] sun50i-h616-pinctrl 300b000.pinctrl: unsupported function i2c0 on pin PI8 [ 1.340132] sun50i-h616-pinctrl 300b000.pinctrl: unsupported function i2c0 on pin PI7 [ 1.340141] mv64xxx_i2c 5002000.i2c: there is not valid maps for state defaul t [ 1.340264] sun50i-h616-pinctrl 300b000.pinctrl: unsupported function i2c0 on pin PI8 [ 1.340279] sun50i-h616-pinctrl 300b000.pinctrl: unsupported function i2c0 on pin PI7 [ 1.340287] mv64xxx_i2c 5002000.i2c: there is not valid maps for state defaul t [ 1.341370] axp20x-i2c 0-0036: AXP20x variant AXP313a found [ 1.342890] axp20x-i2c 0-0036: AXP20X driver loaded [ 269.046993] i2c i2c-2: mv64xxx: I2C bus locked, block: 1, time_left: 0 [ 271.094978] i2c i2c-2: mv64xxx: I2C bus locked, block: 1, time_left: 0 Tried to edit device tree via armbian-config (now it is probably kinda messy): armbianEnv.txt: verbosity=1 bootlogo=false console=both disp_mode=1920x1080p60 overlay_prefix=sun50i-h618 overlays=i2c0 i2c1 i2c2 i2c3 uart5 param_uart1_rtscts=1 param_uart2_rtscts=2 param_uart2_rtscts=3 param_uart2_rtscts=4 param_uart2_rtscts=5 rootdev=UUID=88b03ed8-436d-4226-bf01-975ceef8cc1b rootfstype=ext4 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
-
I cannot receive data on serial port ttyS5. I able to write onto it, but the reading doesnt work. I'm using this https://github.com/officialdoniald/Xamarin.Android.SerialPort . I tried using adb shell commands like "cat < /dev/ttyS5" but there is no received data either. When I try to send data with "LibSerialPort.WriteLine("text")" I can see it in Hercules Terminal so the writing works. In Visual Studio Output there is this line: [c.SerialPortPoc] type=1400 audit(0.0:532): avc: denied { read write } for name="ttyS5" dev="tmpfs" ino=2487 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:serial_device:s0 tclass=chr_file permissive=1 app=SerialPortPoc.SerialPortPoc Device: Orange Pi Zero 2, Android 10