OpenWrt Forum Archive

Topic: Fonera 2200 MMC Card driver load was reset the device

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

Hello community,

I make the hack on my fonera 2200 to put mmc card.
After all the work when loading the mmc driver this makes system halt.
I get the driver from http://fon.testbox.dk/packages/mmc/phro … 14_762.ipk to kernel 2.6.21.5. I try the Legend an the  Kamikaze firwares and is always the same problem.
With wiring and without make always the system halt.

debug on serial port:

mmc : 3-Pin Fon2200 Driver Built for Legend (john@phrozen.org)
Sending SIGKILL to all processes.
Requesting system halt.
System halted.

help is need

Tanks

Fix your GPIOs. IIRC, GPIO 5 was use for reset/halt on the fon.

So seams that this mmc driver use the GPIO5. Is strange this because also this driver is compiled for fonera 2200.
To fixed this I need to change the source of the driver to use the GPIO6 and recompile the driver, correct?

GPIO Pinout Fonera

GPIO     Description

0        TP3   
1        pin 5 of SW1
2        WLAN LED
3        pin 1 of SW1
4        pin 2 of SW1
5        RESET (!)
6        RESET button
7        pin 6 of SW1

Tanks

If you build latest trunk from source for the Fonera you can use the new mmc-over-gpio driver. The GPIOs for that driver are configurable in the init script.

(Last edited by forum2008 on 2 Jul 2008, 20:39)

The kmod-mmc-over-gpio exist compiled for the kernel 2.6.21.5 ?
Its possible to compile it from the atheros source of OpenWrt-SDK-atheros-2.6-for-Linux-i686 ?

Why not just compile latest trunk using the build-system and reflash?

Tell me who I make it.

My experience its only making modules from source. seams to me that is more easy that compile all the firmware.

Tanks for the quick responses

Hi, i'm intrested in this problem also, if you could explain how to solve it or to tell us what to do. :S

i took the latest trunk from svn of openwrt and i have compiled the mmc over gpio driver, am i right? or i'm missing something?

(Last edited by eikaf on 5 Jul 2008, 02:39)

Solved mmc with fonera 2200!!!!!

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
spi-gpio-mmc: MMC-Card "default" attached to GPIO pins 7,2,6,14
mmc_spi spi32766.0: can't change chip-select polarity
mmc0: new MMC card on SPI
mmcblk0: mmc0:0001 E0421  125440KiB
mmcblk0: p1


procedures:
svn from https://svn.openwrt.org/openwrt/trunk

type: cd trunk
type: make menuconfig
select mmc_over_gpio in kernel modules in builn in (*) option, save and exit the configuration

type: vi package/mmc_over_gpio/files/mmc_over_gpio.init

comment or clear the old line:
#add_device "default" 5 4 3 7 0

and put

add_device "default" 7 2 6 14 0

this 14 its a dummy gpio
do not put gpio 5, this will be reset your device.

type: make

The firmware was on trunk/bin directory
flash you device in redbot

the gpio pins was like:
http://fon.testbox.dk/packages/mmc/mmcm … 00mmc1.jpg
http://fon.testbox.dk/packages/mmc/mmcm … 00mmc2.jpg

The gpio5 its not need, makes your device reset

Tanks for all

nice job opensys it was all in finding the fake gpio wink finally we have it.

Hi all
I'm little confused how to correctly connect mmc to fon2200

opensys wrote:

Solved mmc with fonera 2200!!!!!
<...>
comment or clear the old line:
#add_device "default" 5 4 3 7 0

and put

add_device "default" 7 2 6 14 0

Using this photos http://fon.testbox.dk/packages/mmc/mmcm … 00mmc1.jpg, http://fon.testbox.dk/packages/mmc/mmcm … 00mmc2.jpg, I can understand that:
mmc pin 1 (chip select) an mmc pin3 and 6 must connect together to gorund, ok!
mmc pin 4 (vdd) to +3.3Volt, great!
Now we need 3 signal:
mmc pin 7 (data out)
mmc pin 5 (clock)
mmc pin 2 (data in)

The above photos suggest to use gpio2 gpio7 and gpio6 according to configuration (add_device "default" 7 2 6 14 0), but how to connect those gpio pin to mmc pin???
mmc7 with gpio7, mmc5 with gpio6, mmc2 with gpio2; is it correct?

Many thank for any help

(Last edited by claudyus on 8 Jul 2008, 16:38)

claudyus wrote:

Hi all
I'm little confused how to correctly connect mmc to fon2200

opensys wrote:

Solved mmc with fonera 2200!!!!!
<...>
comment or clear the old line:
#add_device "default" 5 4 3 7 0

and put

add_device "default" 7 2 6 14 0

.....
....
mmc7 with gpio7, mmc5 with gpio6, mmc2 with gpio2; is it correct?

I get

Jan  1 00:01:16 kernel: mmc_spi spi32766.0: ASSUMING 3.2-3.4 V slot power
Jan  1 00:01:16 kernel: mmc_spi spi32766.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
Jan  1 00:01:16 kernel: spi-gpio-mmc: MMC-Card "default" attached to GPIO pins 7,2,6,14
Jan  1 00:01:19 kernel: mmc_spi spi32766.0: can't change chip-select polarity
Jan  1 00:01:19 OpenWrt user.err kernel: mmc0: error -22 whilst initialising SDIO card

using this configuration: mmc7 with gpio7, mmc5 with gpio6, mmc2 with gpio2

Any help is appreciated

solder the SD in this way
-SD pin 3,6 and 1 go to GND(All 3 pins to red points in the photo)
-SD pin 4 goes to Vcc (3.3V)
-pin 2 of SD linked to GPIO 7 (link it to power led like in the attached photo)
-pin 7 of SD linked to GPIO 2 (link it to wifi led like in the attached photo)
-pin 5 of SD linked to GPIO 6 (pin of reset button the green one)

look at this photo carefully, zoom it if necessary, u have to solder the low part of the resistors wink

http://www.picoodle.com/view.php?img=/4 … ;srv=img37

the only pin u don't have to use on the SD are the first and the last. 9 and 8
Bye

(Last edited by eikaf on 10 Jul 2008, 17:53)

looks like after configfs were applied to gpiommc this ain't working. i was not able to configure the mmcgpio device

(Last edited by metyl on 27 Jul 2008, 20:46)

metyl wrote:

looks like after configfs were applied to gpiommc this ain't working. i was not able to configure the mmcgpio device

Does not surprise me. Probably not tested at all...

Some update on this topic?
Someone that use the mmc driver from latest opewrt version can report a success experience...

Bye

As I said on another forum (www.fonerahacks.com) I have checked the latest openwrt trunk with:
- one working 1gb card (AData)
- one no-working 2gb card (Maxell)
- one no-working 4gb card (No brand)

Is there anyone who had success with cards of more than 1gb?

i have tried to recompile actual trunk release with LuCi but the kmod mmc does no longer work with it giving me this error.
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=7, do=2, clk=6, cs=14
mmc_spi spi32766.0: can't change chip-select polarity
mmc0: error -22 whilst initialising SDIO card

i think that the problem is dued to the fact that kmod-spio is not created, ticket related https://dev.openwrt.org/ticket/3273

help is appreciated

(Last edited by eikaf on 23 Oct 2008, 11:07)

I switched back my Fonera 2200 to OpenWrt  trunk version 11770.
Now it recognizes the 1Gb card as well as the 2Gb and the 4Gb ones. I think the problem arose when the mmc_over_gpio package was merged into the kernel (some more investigation later...).

This is the report of some partially successfull development.

As the system contains only a minimal set of packages:
- one new ext2 partition on the 4Gb card,
- one new 64Mb swap file on the new filesystem,
- uncompress openwrt-atheros-rootfs.tgz on the new filesystem,
- copy from remote host the whole packages directory,
- pivot_root on the filesystem,

Now all seems ok and I start to install new packages on the new rootfs: some packages are correctly installed, others, maybe the biggest ones, result always in "Segmentation fault" of other strange random errors.

Is this a timing or synch problem between the mmc kernel modules and my SD card? Is there a way to slow down the writing and reading speed on the card? Or is this another kind of problem?

(Last edited by 7M on 25 Oct 2008, 19:32)

7M wrote:

I switched back my Fonera 2200 to OpenWrt  trunk version 11770.
Now it recognizes the 1Gb card as well as the 2Gb and the 4Gb ones. I think the problem arose when the mmc_over_gpio package was merged into the kernel (some more investigation later...).

This is the report of some partially successfull development.

As the system contains only a minimal set of packages:
- one new ext2 partition on the 4Gb card,
- one new 64Mb swap file on the new filesystem,
- uncompress openwrt-atheros-rootfs.tgz on the new filesystem,
- copy from remote host the whole packages directory,
- pivot_root on the filesystem,

Now all seems ok and I start to install new packages on the new rootfs: some packages are correctly installed, others, maybe the biggest ones, result always in "Segmentation fault" of other strange random errors.

Is this a timing or synch problem between the mmc kernel modules and my SD card? Is there a way to slow down the writing and reading speed on the card? Or is this another kind of problem?

simply u took the compiled package from old trunk and pasted it on new one?
how did u switch between releases?

edit: some days ago i opened a ticket.
http://dev.openwrt.org/ticket/4129

(Last edited by eikaf on 27 Oct 2008, 21:07)

eikaf wrote:

how did u switch between releases?

edit: some days ago i opened a ticket.
http://dev.openwrt.org/ticket/4129

Simply:

$ mkdir kamikaze
$ svn co -r 11770 https://svn.openwrt.org/openwrt/trunk kamikaze
$ cd kamikaze
$ ./scripts/feeds update -a
$ ./scripts/feeds install ... some additional packages
$ make menuconfig
$ make V=99

Anyway, with the latest trunk I have the same error.

7M wrote:
eikaf wrote:

how did u switch between releases?

edit: some days ago i opened a ticket.
http://dev.openwrt.org/ticket/4129

Simply:

$ mkdir kamikaze
$ svn co -r 11770 https://svn.openwrt.org/openwrt/trunk kamikaze
$ cd kamikaze
$ ./scripts/feeds update -a
$ ./scripts/feeds install ... some additional packages
$ make menuconfig
$ make V=99

Anyway, with the latest trunk I have the same error.

thx for replay however i'm using 11744, it still works until you change kernel.

this is getting me crazy xD
the developer wrote it has been fixed but he did not test it on a fonera 2200...it still do not work on fonera 2200 and i'm going to flash it back to 11744...

Well, that's Opensource Software sad

The discussion might have continued from here.