OpenWrt Forum Archive

Topic: Fon 2100 sd mmc error

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

hey all,
I recently configured my fon to run openwrt 8.09 and installed the mmc_over_gpio packages and an sd slot.  when i run the init script i get the following error.

root@OpenWrt:~# /etc/init.d/mmc_over_gpio start
configfs on /config type configfs (rw)
mkdir: cannot create directory '/config/gpiommc/default': No such file or directory

when i make the directories by hand i get the same message and ls /config reveals there is no directories there.
has anyone been able to get this to work at all? I know some one has.
I'm running: openwrt 8.09, atheros, on a fon v2100.

(Last edited by haxwithaxe on 2 Sep 2009, 03:30)

bump.
I really would appreciate some input. I've tried compiling all sorts of drivers from all over the web for the fon and had no luck running them so i'd really like to use the openwrt package for this.

(Last edited by haxwithaxe on 2 Sep 2009, 03:39)

same problem here with backfire...

michelinok wrote:

same problem here with backfire...

With backfire install:

luci-app-mmc-over-gpio

Then activate mmc in the web-settings.

haxwithaxe:

try the following!

cd /etc/config
vi mmc_over_gpio

press i to start edit mode
Type in the exact following

config 'mmc_over_gpio'
    option 'name' 'default'
    option 'DI_pin' '1'
    option 'DO_pin' '3'
    option 'CLK_pin' '4'
    option 'CS_pin' '7'
    option 'mode' '0'
    option 'enabled' '1'

then save by first pressing ESC then :wq
then press enter

(Thats ESCAPE then COLON then w then q then ENTER)

then test by doing:

/etc/init.d/mmc_over_gpio start

mount /dev/mmcblk0p1 /mnt/mmc

EDIT:
to actually mount the filesystem I think you need to install

kmod-nls-base
kmod-nls-cp437
kmod-nls-iso8859-1

And:

kmod-fs-vfat      // If you want to mount FAT
kmod-fs-ext2     // ext2
kmod-fs-ext3     // ext3

(Last edited by Jakkvurt on 10 Jul 2010, 16:22)

1) I don't use web server, how can i start the mmc?
2) I've followed your istruction, but i cannot use the mmc at all, this is my config:

This is my configuration (own compiled image,latest svn updated to some days ago...):

root@OpenWrt:~# opkg list_installed
aircrack-ng - 1.1-1
base-files - 50-r22096
block-hotplug - 0.1.0-2
block-mount - 0.1.0-2
busybox - 1.16.2-1
cifsmount - 1.5-2
dnsmasq - 2.55-1
dropbear - 0.52-5
ettercap - NG-0.7.3-2
glib1 - 1.2.10-1
gpioctl - 1.0-1
hotplug2 - 1.0-beta-2
iptables - 1.4.8-1
iptables-mod-conntrack - 1.4.8-1
iptables-mod-nat - 1.4.8-1
kernel - 2.6.32.14-1
kmod-crc-ccitt - 2.6.32.14-1
kmod-crc-itu-t - 2.6.32.14-1
kmod-crc7 - 2.6.32.14-1
kmod-fs-cifs - 2.6.32.14-1
kmod-ipt-conntrack - 2.6.32.14-1
kmod-ipt-core - 2.6.32.14-1
kmod-ipt-nat - 2.6.32.14-1
kmod-ipt-nathelper - 2.6.32.14-1
kmod-madwifi - 2.6.32.14+r3314-4
kmod-mmc - 2.6.32.14-1
kmod-mmc-over-gpio - 2.6.32.14-4
kmod-mmc-spi - 2.6.32.14-1
kmod-spi-bitbang - 2.6.32.14-1
kmod-spi-gpio-old - 2.6.32.14-1
libc - 0.9.30.1-50
libgcc - 4.3.3+cs-50
libiconv - 1.11-1
libiptc - 1.4.8-1
libltdl - 1.5.26-1
libncurses - 5.7-2
libnet1 - 1.1.2.1-2
libnl-tiny - 0.1-1
libopenssl - 0.9.8o-1
libpcap - 1.0.0-2
libpcre - 8.02-1
libpthread - 0.9.30.1-50
librt - 0.9.30.1-50
libuci - 12012009.5-2
libxtables - 1.4.8-1
mc - 4.6.2-1
mdk3 - v6-1
nano - 2.2.4-1
opkg - 528-1
screen - 4.0.3-2
swconfig - 6
uci - 12012009.5-2
uclibcxx - 0.2.2-3
udevtrigger - 106-1
wireless-tools - 29-4
wpad-mini - 20100418-2
zlib - 1.2.3-5
root@OpenWrt:~#


and this is the output of dmesg:

....
....
ath_ahb: wifi0: Atheros 2315 WiSoC: mem=0xb0000000, irq=3
IRQ 3/wifi0: IRQF_DISABLED is not guaranteed on shared IRQs
mmc_spi: Unknown symbol spi_register_driver
mmc_spi: Unknown symbol spi_sync
mmc_spi: Unknown symbol spi_bus_type
mmc_spi: Unknown symbol spi_setup
spi_bitbang: Unknown symbol spi_unregister_master
spi_bitbang: Unknown symbol spi_register_master
spi_gpio_old: Unknown symbol spi_bitbang_stop
spi_gpio_old: Unknown symbol spi_alloc_master
spi_gpio_old: Unknown symbol spi_new_device
spi_gpio_old: Unknown symbol spi_bitbang_start
gpiommc: Unknown symbol config_group_init
gpiommc: Unknown symbol configfs_unregister_subsystem
gpiommc: Unknown symbol configfs_register_subsystem
gpiommc: Unknown symbol config_item_init_type_name
gpiommc: Unknown symbol spi_gpio_next_id
root@OpenWrt:~#



/etc/init.d/mmc_over_gpio start
configfs on /config type configfs (rw)
mkdir: cannot create directory '/config/gpiommc/default': No such file or directory



Any idea on what should i do to make the mmc work?

michelinok wrote:

/etc/init.d/mmc_over_gpio start
configfs on /config type configfs (rw)
mkdir: cannot create directory '/config/gpiommc/default': No such file or directory

You have all the packages to interface the device properly!
But you will need some more to use a file-system later on.

Ok, it can't find it's config-file where it reads what GPIO goes where.

I can see you have nano, so use that instead of vi when making your config-file.

Do

cat /etc/init.d/mmc_over_gpio

and print the result here.
Also do

ls /etc/config/

and print the result here.

root@OpenWrt:~# cat /etc/init.d/mmc_over_gpio
#!/bin/sh /etc/rc.common
# Copyright (C) 2008 OpenWrt.org
START=90

#CONFIGFS_DIR="/etc/config/mmc_over_gpio"

CONFIGFS_DIR="/config/gpiommc"

# add_device(name, DI_pin, DO_pin, CLK_pin, CS_pin, mode)
add_device() {
        local dir="$CONFIGFS_DIR/$1"

        mkdir -p $dir
        [ $? -eq 0 ] || return 1
        echo $2 > $dir/gpio_data_in
        [ $? -eq 0 ] || return 1
        echo $3 > $dir/gpio_data_out
        [ $? -eq 0 ] || return 1
        echo $4 > $dir/gpio_clock
        [ $? -eq 0 ] || return 1
        echo $5 > $dir/gpio_chipselect
        [ $? -eq 0 ] || return 1
        echo $6 > $dir/spi_mode
        [ $? -eq 0 ] || return 1
        # XXX We have more config options available. Use defaults for now.

        echo 1 > $dir/register
        [ $? -eq 0 ] || return 1

        return 0
}

# remove_device(name)
remove_device() {
        local dir="$CONFIGFS_DIR/$1"

        rmdir $dir
}

mount_configfs() {
        # FIXME: This should probably be done somewhere else.
        mount | grep configfs
        if [ $? -eq 0 ]; then
                # already mounted
                return 0
        fi
        mkdir -p /config
        [ $? -eq 0 ] || return 1
        mount configfs -t configfs /config
        [ $? -eq 0 ] || return 1

        return 0
}

start_service() {
        local section="$1"
        config_get "name" "$section" "name"
        config_get "DI_pin" "$section" "DI_pin"
        config_get "DO_pin" "$section" "DO_pin"
        config_get "CLK_pin" "$section" "CLK_pin"
        config_get "CS_pin" "$section" "CS_pin"
        config_get "mode" "$section" "mode"
        config_get_bool "enabled" "$section" "enabled" '1'
        [ "$enabled" -gt 0 ] && add_device "$name" $DI_pin $DO_pin $CLK_pin $CS_                                                 pin $mode &
}

stop_service() {
        local section="$1"
        config_get "name" "$section" "name"
        remove_device "$name"
}

start() {
        # Make sure configfs is mounted
        mount_configfs
        [ $? -eq 0 ] || return 1

        config_load "mmc_over_gpio"
        config_foreach start_service "mmc_over_gpio"
}

stop() {
        config_load "mmc_over_gpio"
        config_foreach stop_service "mmc_over_gpio"
}
root@OpenWrt:~#





root@OpenWrt:~# ls /etc/config/
dhcp           dropbear       fstab          mmc_over_gpio  network        system         timeserver     wireless
root@OpenWrt:~#

>mkdir: cannot create directory '/config/gpiommc/default': No such file or directory

kmod-gpio-dev ?

lexxai wrote:

>mkdir: cannot create directory '/config/gpiommc/default': No such file or directory

kmod-gpio-dev ?

Doesn't seem to exist:

root@OpenWrt:~# opkg list *gpio*
gpioctl - 1.0-1 - Tool for controlling gpio pins
kmod-i2c-gpio - 2.6.32.14-1 - Kernel modules for a very simple bitbanging I2C driver utilizing the
arch-neutral GPIO API to control the SCL and SDA lines.
kmod-i2c-gpio-custom - 2.6.32.14-2 - Kernel module for register a custom i2c-gpio platform device.
kmod-input-gpio-buttons - 2.6.32.14-1 - Kernel module for support polled GPIO buttons input device
kmod-leds-gpio - 2.6.32.14-1 - Kernel module for LEDs on GPIO lines
kmod-mmc-over-gpio - 2.6.32.14-4 - Support for driving an MMC/SD card over GPIO pins via SPI.
kmod-spi-gpio - 2.6.32.14-1 - This package contains the GPIO-based bitbanging SPI Master
kmod-spi-gpio-old - 2.6.32.14-1 - This package contains the GPIO based bitbanging SPI controller driver
kmod-w1-gpio-custom - 2.6.32.14-2 - Kernel module to register a custom w1-gpio platform device.
kmod-w1-master-gpio - 2.6.32.14-1 - Kernel module for the GPIO 1-wire bus master driver
luci-app-mmc-over-gpio - 0.9+svn6215-1 - mmc_over_gpio
root@OpenWrt:~#

For those who have a working mmc with fonera2100 + backfire, please post the output of opkg list_installed, it would be a nice start point smile

michelinok wrote:

root@OpenWrt:~# ls /etc/config/
dhcp           dropbear       fstab          mmc_over_gpio  network        system         timeserver     wireless
root@OpenWrt:~#

Do:

cat /etc/config/mmc_over_gpio

and post here.

Mine says:

config 'mmc_over_gpio'
    option 'name' 'default'
    option 'DI_pin' '1'
    option 'DO_pin' '3'
    option 'CLK_pin' '4'
    option 'CS_pin' '7'
    option 'mode' '0'
    option 'enabled' '1'

Yours should too.

On request:

base-files - 42-r20728
block-hotplug - 0.1.0-1
block-mount - 0.1.0-1
busybox - 1.15.3-2
dnsmasq - 2.52-2
dropbear - 0.52-4
firewall - 1-10
fuse-utils - 2.8.3-1
gpioctl - 1.0-1
hotplug2 - 1.0-beta-1
iptables - 1.4.6-2
iptables-mod-conntrack - 1.4.6-2
iptables-mod-nat - 1.4.6-2
kernel - 2.6.30.10-1
kmod-crc-ccitt - 2.6.30.10-1
kmod-crc-itu-t - 2.6.30.10-1
kmod-crc7 - 2.6.30.10-1
kmod-fs-vfat - 2.6.30.10-1
kmod-fuse - 2.6.30.10-1
kmod-ipt-conntrack - 2.6.30.10-1
kmod-ipt-core - 2.6.30.10-1
kmod-ipt-nat - 2.6.30.10-1
kmod-ipt-nathelper - 2.6.30.10-1
kmod-madwifi - 2.6.30.10+r3314-4
kmod-mmc - 2.6.30.10-1
kmod-mmc-over-gpio - 2.6.30.10-4
kmod-mmc-spi - 2.6.30.10-1
kmod-nls-base - 2.6.30.10-1
kmod-nls-cp437 - 2.6.30.10-1
kmod-nls-iso8859-1 - 2.6.30.10-1
kmod-ppp - 2.6.30.10-1
kmod-spi-bitbang - 2.6.30.10-1
kmod-spi-gpio-old - 2.6.30.10-1
lftp - 4.0.5-2
libart - 2.3.20-3
libc - 0.9.30.1-42
libexpat - 2.0.1-1
libfreetype - 2.3.9-2
libfuse - 2.8.3-1
libgcc - 4.3.3+cs-42
libiptc - 1.4.6-2
liblua - 5.1.4-6
libncurses - 5.7-2
libnl-tiny - 0.1-1
libopenssl - 0.9.8m-3
libow - 2.7p21-1
libpng - 1.2.41-1
libpthread - 0.9.30.1-42
libreadline - 5.2-2
librrd - 1.2.30-1
librt - 0.9.30.1-42
libuci - 12012009.5-1
libuci-lua - 12012009.5-1
libusb - 0.1.12-2
libxtables - 1.4.6-2
lua - 5.1.4-6
luci - 0.9.0-1
luci-admin-core - 0.9.0-1
luci-admin-full - 0.9.0-1
luci-admin-mini - 0.9.0-1
luci-app-firewall - 0.9.0-1
luci-app-initmgr - 0.9.0-1
luci-app-mmc-over-gpio - 0.9.0-1
luci-cbi - 0.9.0-1
luci-core - 0.9.0-1
luci-http - 0.9.0-1
luci-i18n-english - 0.9.0-1
luci-ipkg - 0.9.0-1
luci-lmo - 0.9.0-1
luci-nixio - 0.9.0-1
luci-sgi-cgi - 0.9.0-1
luci-sys - 0.9.0-1
luci-theme-base - 0.9.0-1
luci-theme-openwrt - 0.9.0-1
luci-uci - 0.9.0-1
luci-uvl - 0.9.0-1
luci-web - 0.9.0-1
mtd - 12
nano - 2.2.3-1
openssh-sftp-server - 5.4p1-1
opkg - 513-2
owfs - 2.7p21-1
owhttpd - 2.7p21-1
owserver - 2.7p21-1
ppp - 2.4.4-5
rrdtool - 1.2.30-1
swconfig - 5
uci - 12012009.5-1
uclibcxx - 0.2.2-2
udevtrigger - 106-1
uhttpd - 7
wireless-tools - 29-4
wpad-mini - 20100309-1
zlib - 1.2.3-5

(Last edited by Jakkvurt on 11 Jul 2010, 14:18)

yes,mine is equal to yours.
I'm using this hw config:

http://www.dd-wrt.com/wiki/index.php/La … re_SD-Card

And with dd-wrt was working very well.

Dunno what's wrong atm! sad
Very desperate!

And still getting this on dmesg:

mmc_spi: Unknown symbol spi_register_driver
mmc_spi: Unknown symbol spi_sync
mmc_spi: Unknown symbol spi_bus_type
mmc_spi: Unknown symbol spi_setup
spi_bitbang: Unknown symbol spi_unregister_master
spi_bitbang: Unknown symbol spi_register_master
spi_gpio_old: Unknown symbol spi_bitbang_stop
spi_gpio_old: Unknown symbol spi_alloc_master
spi_gpio_old: Unknown symbol spi_new_device
spi_gpio_old: Unknown symbol spi_bitbang_start
gpiommc: Unknown symbol config_group_init
gpiommc: Unknown symbol configfs_unregister_subsystem
gpiommc: Unknown symbol configfs_register_subsystem
gpiommc: Unknown symbol config_item_init_type_name
gpiommc: Unknown symbol spi_gpio_next_id
root@OpenWrt:~#

and:

root@OpenWrt:~# /etc/init.d/mmc_over_gpio reload
rmdir: '/config/gpiommc/default': No such file or directory
mount: mounting configfs on /config failed: No such device
root@OpenWrt:~#



PS: I'm using 2.6.32.14 kernel...can this be the problem?

(Last edited by michelinok on 11 Jul 2010, 14:32)

This is my info:

Linux version 2.6.30.10 (openwrt@wrt1.marcant.net) (gcc version 4.3.3 (GCC) ) #24 Tue Apr 6 14:59:59 CEST 2010

I don't know, maybe opkg fetches the wrong packages for your kernel?
Did you compile it yourself? Then try to compile the mmc packages as well.

(Last edited by Jakkvurt on 11 Jul 2010, 14:34)

I don't think it's a kernel ver. releated problem...

Jakkvurt wrote:

This is my info:

Linux version 2.6.30.10 (openwrt@wrt1.marcant.net) (gcc version 4.3.3 (GCC) ) #24 Tue Apr 6 14:59:59 CEST 2010

I don't know, maybe opkg fetches the wrong packages for your kernel?
Did you compile it yourself? Then try to compile the mmc packages as well.

I'll give a try now...i'll try to compile mmc modules by myself...

Rebuilded from scratch,including modules in the image (not adding modules with opkg!).
Now I get this:

dmesg:

....
gpio-mmc: Failed to request mmc_spi module.
mmc_spi spi32766.0: ASSUMING 3.2-3.4 V slot power
mmc_spi spi32766.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
gpio-mmc: MMC-Card "default" attached to GPIO pins di=1, do=3, clk=4, cs=7
mmc_spi spi32766.0: can't change chip-select polarity
mmc0: host doesn't support card's voltages
mmc0: error -22 whilst initialising SDIO card
.....


/etc/init.d/mmc_over_gpio start:

configfs on /config type configfs (rw,relatime)


and no /dev  entry is created.

Any other suggestion?!?!

That is progress!
The reason why there is no /dev entry is because it cant connect with SD-card.
Some SD-cards use different voltages, try a different one. And check your soldering/diagram.

Also remove the resistors on the pcb, and the capacitors. And a 10k resistor between GPIO3 (SW1.1) and 3.3v is recommended by piranha.pwnz.org(site down). (I'm using it)

http://img714.imageshack.us/img714/8795/imagen021o.jpg

Jakkvurt wrote:

That is progress!
The reason why there is no /dev entry is because it cant connect with SD-card.
Some SD-cards use different voltages, try a different one. And check your soldering/diagram.

Also remove the resistors on the pcb, and the capacitors. And a 10k resistor between GPIO3 (SW1.1) and 3.3v is recommended by piranha.pwnz.org(site down). (I'm using it)

http://img714.imageshack.us/img714/8795/imagen021o.jpg

Good,tomorrow i'll try another mmc/sd (I have another one in my office), and i'll use a resistor (don't have one atm connected).
Maybe i'll put the sd card reader on the bottom and not inside smile

Just tryed another mmc,an old one of 32mb...same problem...

michelinok wrote:

Just tryed another mmc,an old one of 32mb...same problem...

Are both the capacitors and resistors on the fonera PCB removed? They are connected to the GPIO-pins and ruin the signal. Their position is about the same position on both the bottom and top side of the board close to the GPIO-pins. 

Are you sure the ground and power connections are correct? Do you have a multimeter tool to measure the voltage between GND and 3.3V on the SD-card?

Jakkvurt wrote:
michelinok wrote:

Just tryed another mmc,an old one of 32mb...same problem...

Are both the capacitors and resistors on the fonera PCB removed? They are connected to the GPIO-pins and ruin the signal. Their position is about the same position on both the bottom and top side of the board close to the GPIO-pins. 

Are you sure the ground and power connections are correct? Do you have a multimeter tool to measure the voltage between GND and 3.3V on the SD-card?

I think everything it's ok because some month ago it was working well with dd-wrt.
I removed only the capacitors,anyway today i'll try adding the resistor and removing the other resistors and re-wire everything.
Atm I gotta go to work sad

I'll write here later...

Jakkvurt wrote:

That is progress!
The reason why there is no /dev entry is because it cant connect with SD-card.
Some SD-cards use different voltages, try a different one. And check your soldering/diagram.

Also remove the resistors on the pcb, and the capacitors. And a 10k resistor between GPIO3 (SW1.1) and 3.3v is recommended by piranha.pwnz.org(site down). (I'm using it)

http://img714.imageshack.us/img714/8795/imagen021o.jpg

Please,sd3 and sd6 where have you connected those pins? it not clear on the picture...

michelinok wrote:
Jakkvurt wrote:

That is progress!
The reason why there is no /dev entry is because it cant connect with SD-card.
Some SD-cards use different voltages, try a different one. And check your soldering/diagram.

Also remove the resistors on the pcb, and the capacitors. And a 10k resistor between GPIO3 (SW1.1) and 3.3v is recommended by piranha.pwnz.org(site down). (I'm using it)

http://img714.imageshack.us/img714/8795/imagen021o.jpg

Please,sd3 and sd6 where have you connected those pins? it not clear on the picture...

GND. Which is 4 points around the antenna connector in the corner of the PCB.

(Last edited by Jakkvurt on 12 Jul 2010, 14:04)

Just tryed,triple checked,added the resistor 10k,removed the other 4 resistor (cap already removed...), same exact message... error -22....

I don't know what else can be wrong. Except GPIO and MMC/drivers being broken in some way in 2.6.32.14.
But I'm no expert at all when it comes to OpenWrt and Linux.

Is there an option for you to "go back" to the same kernel as I´m using? 2.6.30.10
Or du you need 2.6.32.14 for some other reason?

The discussion might have continued from here.