NeethuVP Posted January 15, 2020 Share Posted January 15, 2020 Hi, I need to add a second SD card reader to my Orangepi zero. I tried with this link https://github.com/nopnop2002/STM32_TFT_8bit . But it doesn't work. I read that SPI is not enabled in Orangepi kernel and i checked with ls /dev/*spi* and the output was - ls: cannot access '/dev/*spi*': No such file or directory. So i edited the /boot/armbinaEnv.txt as adding "overlays=spi-spidev" and rebooted. then checked ls /dev/*spi* and out is - /dev/spidev0.0. But my code is not working..Can you tell me what is wrong here ? These are my pin configuration SD CARD OPI zero ------------------------------------------------------------ GND (6) GND (6) VCC (4) 3.3V (1) MISO (7) Pin#21(SPI MISO) MOSI (2) Pin#19(SPI MOSI) SCK (5) Pin#23(SPI SCLK) CS (1) Pin#26(SPI CE) 1 Link to comment Share on other sites More sharing options...
martinayotte Posted January 15, 2020 Share Posted January 15, 2020 25 minutes ago, NeethuVP said: So i edited the /boot/armbinaEnv.txt as adding "overlays=spi-spidev" and rebooted. then checked ls /dev/*spi* and out is - /dev/spidev0.0 It is not enough to add the spi-spidev overlay, you also need to specify which bus with "param_spidev_spi_bus" parameter. In OPiZero, it is the SPI1 which is expose on header, so, you must add "param_spidev_spi_bus=1" . Be aware that this won't be easy to handle on software side. If I were you, I would go to more easy way : use USB-SdCard adaptor on USB port ... EDIT: If the USB port is already in use, there are 2 other USB ports on the 13 pins header ... Link to comment Share on other sites More sharing options...
NeethuVP Posted January 16, 2020 Author Share Posted January 16, 2020 18 hours ago, martinayotte said: It is not enough to add the spi-spidev overlay, you also need to specify which bus with "param_spidev_spi_bus" parameter. In OPiZero, it is the SPI1 which is expose on header, so, you must add "param_spidev_spi_bus=1" . Edited the param_spidev_spi_bus=1" and nothing worked for me. How can i enable External SD card via gpio pins? Link to comment Share on other sites More sharing options...
martinayotte Posted January 16, 2020 Share Posted January 16, 2020 5 hours ago, NeethuVP said: How can i enable External SD card via gpio pins? Look at the OPiZero header pinout here : https://linux-sunxi.org/Xunlong_Orange_Pi_Zero#Expansion_Port Then, get/purchase a female USB connector, and solder wires as follow : https://components101.com/connectors/usb-type-a-female Make sure the wires are a short as possible to avoid interferences... Link to comment Share on other sites More sharing options...
NeethuVP Posted January 30, 2020 Author Share Posted January 30, 2020 On 1/16/2020 at 7:30 PM, martinayotte said: Look at the OPiZero header pinout here : https://linux-sunxi.org/Xunlong_Orange_Pi_Zero#Expansion_Port Then, get/purchase a female USB connector, and solder wires as follow : https://components101.com/connectors/usb-type-a-female Make sure the wires are a short as possible to avoid interferences... hi , successfully connected my SD card to Orangepi USB pins.. And the lsusb output of OPI is Quote Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hubBus 004 Device 002: ID aaaa:8816 MXT how to display the files in ma SD card? Link to comment Share on other sites More sharing options...
martinayotte Posted January 30, 2020 Share Posted January 30, 2020 4 hours ago, NeethuVP said: how to display the files in ma SD card? You need to mount the SDCard using "mount /dev/sda1 /mnt" and then "ls -l /mnt" ... Link to comment Share on other sites More sharing options...
Recommended Posts