OpenWrt Forum Archive

Topic: Dir-300 MMC Card

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

Hello my friends.

Just finished moding my d-link dir-300 with sd card over GPIO.

Every think worked smoothly untill I've tried to mount my card.


demesg |grep mmc:

root@OpenWrt:/# dmesg |grep mmc
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=4, do=7, clk=1, cs=3
mmc_spi spi32766.0: can't change chip-select polarity
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card on SPI
mmcblk0: mmc0:0000 ST128 121 MiB
 mmcblk0: p1

witch stakes that the card is working good, and properly connected.

Then

root@OpenWrt:/lib/modules/2.6.32.27# mkfs.ext2 /dev/mmcblk0p1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
31104 inodes, 124152 blocks
6207 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
16 block groups
8192 blocks per group, 8192 fragments per group
1944 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

checking the fs:

root@OpenWrt:/# e2fsck /dev/mmcblk0p1
e2fsck 1.41.12 (17-May-2010)
/dev/mmcblk0p1: clean, 11/31104 files, 5483/124152 blocks

Finally when I try to mount the fs:

root@OpenWrt:/# mount -t ext2 /dev/mmcblk0p1 /mnt/mmc/
mount: mounting /dev/mmcblk0p1 on /mnt/mmc/ failed: No such device

I've also tried to mount it using vfat:

root@OpenWrt:/# mkfs.vfat /dev/mmcblk0p1
mkfs.vfat 3.0.11 (24 Dec 2010)
root@OpenWrt:/# mount -t vfat /dev/mmcblk0p1 /mnt/mmc/
mount: mounting /dev/mmcblk0p1 on /mnt/mmc/ failed: No such device

vfat could not work properly becouse insmod gives this feedback

root@OpenWrt:/# insmod vfat
insmod: can't insert 'vfat': unknown symbol in module, or unknown parameter

As I understand that vfat could not work, don't have any idea why mounting the partition with ext2 doesn't work.

The mod is made from site below, but don't think its an issiue at this point.

http://tinyhack.com/2010/04/04/d-link-d … nd-sd-mod/

Could you point me in the right direction, cause I'm fighting with this from 2 days.

Regards, and thanks for interest.

PS. Sorry for my English, I know its not perfect.

hot-dog wrote:

Hello my friends.

Just finished moding my d-link dir-300 with sd card over GPIO.

Every think worked smoothly untill I've tried to mount my card.


demesg |grep mmc:

root@OpenWrt:/# dmesg |grep mmc
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=4, do=7, clk=1, cs=3
mmc_spi spi32766.0: can't change chip-select polarity
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card on SPI
mmcblk0: mmc0:0000 ST128 121 MiB
 mmcblk0: p1

witch stakes that the card is working good, and properly connected.

Then

root@OpenWrt:/lib/modules/2.6.32.27# mkfs.ext2 /dev/mmcblk0p1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
31104 inodes, 124152 blocks
6207 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
16 block groups
8192 blocks per group, 8192 fragments per group
1944 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

checking the fs:

root@OpenWrt:/# e2fsck /dev/mmcblk0p1
e2fsck 1.41.12 (17-May-2010)
/dev/mmcblk0p1: clean, 11/31104 files, 5483/124152 blocks

Finally when I try to mount the fs:

root@OpenWrt:/# mount -t ext2 /dev/mmcblk0p1 /mnt/mmc/
mount: mounting /dev/mmcblk0p1 on /mnt/mmc/ failed: No such device

I've also tried to mount it using vfat:

root@OpenWrt:/# mkfs.vfat /dev/mmcblk0p1
mkfs.vfat 3.0.11 (24 Dec 2010)
root@OpenWrt:/# mount -t vfat /dev/mmcblk0p1 /mnt/mmc/
mount: mounting /dev/mmcblk0p1 on /mnt/mmc/ failed: No such device

vfat could not work properly becouse insmod gives this feedback

root@OpenWrt:/# insmod vfat
insmod: can't insert 'vfat': unknown symbol in module, or unknown parameter

As I understand that vfat could not work, don't have any idea why mounting the partition with ext2 doesn't work.

The mod is made from site below, but don't think its an issiue at this point.

http://tinyhack.com/2010/04/04/d-link-d … nd-sd-mod/

Could you point me in the right direction, cause I'm fighting with this from 2 days.

Regards, and thanks for interest.

PS. Sorry for my English, I know its not perfect.

I have used that guide and it works.

Make sure you have installed:
kmod-nls-cp437
kmod-nls-iso8859-1

Hope this helps.

john

Well it solved the problem. Thank You very much.
Regards

Glad it worked.

-john

I'm curious what version are you using? 8.09.2 or 10.03.1rcX?

dark_skeleton wrote:

I'm curious what version are you using? 8.09.2 or 10.03.1rcX?

In my case:
It wasn't 10.03.1rcX. It has been some time so it was probably  8.09.1 or 8.09.2.
Did a bit of tweaking.
Throughput wasn't that great; about 150 k bits per second (~20-30 k bytes per sec).

I've flashed it with a different package now (Gargoyle-Backfire).

~john

That's exactly the speed I was having in 8.09.2
Also, what kind of tweaking?
I assume you're still using DIR-300? Would you mind checking the speeds of MMC/SD card on that gargoyle? (I just googled, it's openwrt but with a few custom packages that are supposed to make your life easier, right? No significant changes?)

The problem I'm having now with 10.03.1-rc* (any RC) is that the speed is... wait for it... 0.5kB/s. Yeah, half a kilobyte. And it's for vfat, for ext3 it's even around 0.32kB/s (checked using dd if=/dev/zero of=/mnt/sd/whatever with a stopwatch, stopped it when the blue LED turned off) Mounting a partition takes about a minute, listing its contents takes two minutes... Of course 100% CPU usage, it's not like it works slower because it uses less cpu - it uses the same amount of cpu power but works 50x slower...

Even created a ticket for it ->https://dev.openwrt.org/ticket/9292

I would love to hear your results

(Last edited by dark_skeleton on 24 Apr 2011, 14:25)

dark_skeleton wrote:

That's exactly the speed I was having in 8.09.2
Also, what kind of tweaking?
I assume you're still using DIR-300? Would you mind checking the speeds of MMC/SD card on that gargoyle? (I just googled, it's openwrt but with a few custom packages that are supposed to make your life easier, right? No significant changes?)

The problem I'm having now with 10.03.1-rc* (any RC) is that the speed is... wait for it... 0.5kB/s. Yeah, half a kilobyte. And it's for vfat, for ext3 it's even around 0.32kB/s (checked using dd if=/dev/zero of=/mnt/sd/whatever with a stopwatch, stopped it when the blue LED turned off) Mounting a partition takes about a minute, listing its contents takes two minutes... Of course 100% CPU usage, it's not like it works slower because it uses less cpu - it uses the same amount of cpu power but works 50x slower...

Even created a ticket for it ->https://dev.openwrt.org/ticket/9292

I would love to hear your results

I hack at routers for a hobby.

I'm not using the DIR-300 (A verion) for this anymore. Too slow.
I did the MMC/SD hack  as a "challenge project".
The tweaks I did were compiling various firmware removing any process or package that I did not need to reduce the cpu load.

With Gargoyle there is no room in flash for the MMC/SD hack.
For now I have set it up as a "wireless-bridge".

I have moved to other routers, WRT160nl, Routerboard Pro and a Dlink DVA-g3810bn.


~john

The discussion might have continued from here.