OpenWrt Forum Archive

Topic: SD Card Hack (gpio)

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi there!

I'm trying to get my sd-card via gpio working in openwrt 15.05 

Hardware Hack:
http://s9.postimg.org/fhxolpbjv/dir_615_sd_card_h4ck.jpg

Luci Settings:
http://imgur.com/fcNS3i6l.png


root@OpenWrt:/# lsmod | grep gpio (rmmod'ed gpio_button_hotplug && rmmod leds_gpio, just in case!)

configfs               16496  2 gpiommc
gpiommc                 3616  2 
spi_bitbang             2448  1 spi_gpio_old
spi_gpio_old            2400  1 gpiommc

root@OpenWrt:~# /etc/init.d/mmc_over_gpio enable
root@OpenWrt:~# /etc/init.d/mmc_over_gpio start

configfs on /config type configfs (rw,relatime)
root@OpenWrt:~# sh: write error: Device or resource busy

dmesg:

[   22.910000] gpiommc gpiommc.0: no of_node; not parsing pinctrl DT
[   22.920000] gpio-mmc: Failed to request mmc_spi module.
[   22.930000] spi-gpio spi-gpio.0: no of_node; not parsing pinctrl DT
[   22.940000] spi-gpio: probe of spi-gpio.0 failed with error -16
[   22.960000] gpio-mmc: MMC-Card "openwrt_sd" attached to GPIO pins di=7, do=0, clk=9, cs=14

I didn't tried to mount or create a filesystem bcause I can't access the device (sd card over gpio / spi) at all!
I can't find any entries under /dev ether.

Thank's for your attention! Any help appreciated!

Hi

I've tried the same (or similar) without success. Probably those GPIOs are not usable, without anyone's confirmation or at least some hints there's no point in doing this. Read the topic I've started here ->https://forum.openwrt.org/viewtopic.php?id=63182

anarchy99 wrote:

Hi

I've tried the same (or similar) without success. Probably those GPIOs are not usable, without anyone's confirmation or at least some hints there's no point in doing this. Read the topic I've started here ->https://forum.openwrt.org/viewtopic.php?id=63182

Hi!

Thank's for your reply. The weird thing is that other people did this with success! There is even a (half) tutorial mention this on the device I use: https://wiki.openwrt.org/toh/d-link/dir … dir-615_h1

I just get realy confused about the software/modules... these are changing names almost every version. And the tutorials I find are starting from v.8.... over 12.. 14.....

Ohh... that's not easy...
Probably you need to be a programmer of open-wrt to be able doing this sad

Sorry for asking this stupid question. R U doing this so that your device will have an external storage on an SD card?

So you're using already tested configuration, I'd assume you need to unload other modules or recompile without them (such as leds, buttons etc.) since you got  write error: Device or resource busy

mazilo wrote:

Sorry for asking this stupid question. R U doing this so that your device will have an external storage on an SD card?

Whatever... I wanted to do extroot to have more (or better to have some) storage for system, apps etc.

But for now I just need to be able to "see" the devices.
Next ist do be able to mount filesystem... then later there is work to do for extroot/overlay and all these things.

One by one for now wink

OK and thank you.

anarchy99 wrote:

So you're using already tested configuration, I'd assume you need to unload other modules or recompile without them (such as leds, buttons etc.) since you got  write error: Device or resource busy

Can this really be? I heard that gpio can even co-exist...

Eventhough I think I unloaded all gpio related modules (see up).

Do have a tip for me which modules I should -NOT- include? I have no glue... and chaos calmer changed a lot again ... I think °-°

Just did a clean install of Chaos Calmer to be sure there is no "bad" config:

  • Clean Install Chaos Calmer 15.05

  • Installed luci-app-mmc-over-gpio (comes with: kmod-mmc, kmod-mmc-over-gpio, kmod-mmc-spi, kmod-mmc-spi, kmod-spi-bitbang, kmod-spi-gpio-old)

  • Open the luci-app-mmc-over-gpio frontend and configured the gpio ports & activated the card

  • Checked gpio-requesting modules via "lsmod | grep gpio"

  • Kicked the one I don't want: "rmmod gpio_button_hotplug && rmmod leds_gpio"

  • Checked again with "lsmod | grep gpio" whats left:
    #############OUTPUT#############
    configfs               16496  2 gpiommc
    gpiommc                 3616  2
    spi_bitbang             2448  1 spi_gpio_old
    spi_gpio_old            2400  1 gpiommc

    #################################

  • Tried to initiate the thing via "/etc/init.d/mmc_over_gpio start"
    #############OUTPUT#############
    configfs on /config type configfs (rw,relatime)
    sh: write error: Device or resource busy

    #################################

  • Went for a reboot and tried again: "/etc/init.d/mmc_over_gpio start"
    #############OUTPUT#############
    configfs on /config type configfs (rw,relatime)
    sh: write error: Device or resource busy

    #################################

No luck.

An here the part from dmesg:

###################################OUTPUT###################################
[   22.990000] gpiommc gpiommc.0: no of_node; not parsing pinctrl DT
[   23.000000] gpio-mmc: Failed to request mmc_spi module.
[   23.010000] spi-gpio spi-gpio.0: no of_node; not parsing pinctrl DT
[   23.020000] spi-gpio: probe of spi-gpio.0 failed with error -16
[   23.040000] gpio-mmc: MMC-Card "default" attached to GPIO pins di=7, do=0, clk=9, cs=14
############################################################################

The discussion might have continued from here.