Topic: WRT54G v3 and SD Card Mod

Hey all,

Well, I finally got a WRT - and I must say, its worth the money.

But of course, I needed the extra storage so  I added the SD card reader. Everything is wired up, and it all looks good (no multimeter to test with today).

Here is the section that needed to be changed in the driver for the v3 to work:

#define SD_DI (1 << 5)
#define SD_DO (1 << 4)
#define SD_CLK (1 << 3)
#define SD_CS (1 << 7)

Did I change everything right? Did I miss changing something?

When I load the module and check dmesg, I'm stuck with:

mmc Hardware init
mmc Card init
mmc Card init *1*
mmc Card init *2*
mmc: error in mmc_card_config (2)
mmc: error in mmc_init (-1)

Its a 1gig SD card if that makes any difference.

Any help much appreciated,

Re: WRT54G v3 and SD Card Mod

It really depends on where you solderd your wires

heres mine:

#define SD_DI  (1 << 2) //white led
#define SD_DO  (1 << 3) //orange led
#define SD_CLK (1 << 4) //cisco switch
#define SD_CS  (1 << 7) //dmz led

note: i connected SD_CS from the sd card to ground (vss or vss2) because connecting it to the dmz led made it not work. Also, for the white and orange leds, you have to solder the right side of the leds, if you are lookeing at the router from the front.

Re: WRT54G v3 and SD Card Mod

I'm just curious, since you wired the SD card to your LEDs, does that mean you cannot use the LEDs for status indicators?  Do they flash with SD activity or anything like that?

Re: WRT54G v3 and SD Card Mod

you cant use the leds for anything else, but by default openwrt doesnt use them. And yes, they light up when the sd card is read or written to, so it makes fro a nice read/write indicator wink

Re: WRT54G v3 and SD Card Mod

So I got everything wired up like its supposed to. And I checked - all ports on the SD card reader that should get power do (measurements below). However, I still get the same old error.

Once and a while it works, but even then it will only mount and work for about 5 minutes. Unmount it and it won't work, have to reboot and pray it works. Any ideas?

Volt measurements:
Pin 1 (CS)  --->  Ground, tested and working
Pin 2 (DI)  --->   3.3v (hooked to front switch, right pin)
Pin 3 (VSS)  --->   Ground, tested and working
Pin 4 (VDD)  --->   3.3v (hooked to JP1 pin 1)
Pin 5 (CLK)  --->   3.3v (hooked to amber led, right side)
Pin 6 (VSS2)  --->   Ground, tested and working
Pin 7 (DO)  --->   3.3v (hooked to white led, right side)

Now, they may not be exactly 3.3v, but they are close, and I know thats what the majority of the board works with, so thats why I put that. Analog multimeters aren't the most accurate

If you need more info, post here or yell at fooker in #wrt54g on


6 (edited by tharude 2005-08-20 21:57:40)

Re: WRT54G v3 and SD Card Mod


All was well done with my mod. I've checked almost 10 times all the soldering and wiring. Compiled the module mmc.o inserted and.... nothing. The result was broken SD card.... I'm using WRT v2.2 all wiring was done like in v3.0 since they are not so different. Checked the signaling with GPIO tool a couple of times just to be shure for myself and all was perfect, so what is the reason to burn a brand new 128MB SD card upon you??

here is the wiring:

1 - CS - GPIO7 (DMZ LED right pin at the beginning, after that putted to GND)
2 - DI - GPIO5 - RA10 as described in
3 - Vss - GND - pin 10 on JP1
4 - Vdd - 3.3v powered by pin 1 on JP1
5 - CLK - GPIO3 - RP4 pin 3 as described in
6 - Vss2 - GND - pin 10 on JP1
7 - DO - GPIO4 - next to RA13 pin (before the switch which is not present in v2.2)

Both 3 and 6 are properly grounded - measured between antenna GND and pin 9,10 on JP1 GND. Later added the ChipSelect (CS) to the same GND.

I'll try to return my SD back since it is with 3 years warranty but that's not my point. Does someone at all succeeded with this mod? Is it tested on v2.2 WRT's or we are the pioneers at this area?

I can also provide some photos of my mod but i dont think that they will be useful for now.

Please help!
Best regards!

P.S. Here is my output from insmod mmc.o:

mmc Hardware init
mmc Card init
mmc Card init
mmc: error in mmc_card_init (1)
mmc: error in mmc_init (-1)

here is the output after compile:

/var/tmp/WRT/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -O2 -DMODULE -D__KERNEL__ -W -Wall -Wstrict-prototypes -Wmissing-prototypes -fno-strict-aliasing -mips32 -isystem /var/tmp/WRT/openwrt/build_mipsel/linux/include  -fno-pic -mno-abicalls -mlong-calls   -c -o mmc.o mmc.c
mmc.c: In function `mmc_open':
mmc.c:278: warning: unused variable `device'
mmc.c: At top level:
mmc.c:324: warning: unused parameter 'filp'
/var/tmp/WRT/openwrt/build_mipsel/linux/include/asm/uaccess.h:130: warning: unused parameter 'type'
mmc.c:276: warning: unused parameter 'inode'
mmc.c:49: warning: 'gpioaddr_control' defined but not used
mmc.c:517: warning: 'mmc_check_media_change' defined but not used

The warnings they say are normal.....

Re: WRT54G v3 and SD Card Mod

There is pics right on the wiki of what you have to do. And yes, the 2.2 and 3.0 are different.

Re: WRT54G v3 and SD Card Mod

Did you make it on v2.2? Or you just talk about it? It's triple and quadriple checked with wiki and other sites too!! I can use wiki well and google too, unfortunately there is a lot of different info appearing for this mod!

9 (edited by tharude 2005-08-20 22:11:28)

Re: WRT54G v3 and SD Card Mod

and NOT, v2.2 and v3.0 are not so different because there is no ADMTEK chip inside the v2.2 WRT it's with Broadcom ( BCM5325EKQM ) one, same like in v3.0!!

If i make this mod working on my WRT, i'll make a complete guide for v2.2 routers since they are popular in Bulgaria and there is not a complete guide on how to do this on v2.2 router with photos.

Re: WRT54G v3 and SD Card Mod

Yes I have a 2.2 with a sd card. thank you.

Re: WRT54G v3 and SD Card Mod

Ok then, can you post some photos of your soldering points somewhere? It will be very helpful not only for me but for lot of the people asking questions around!

10X in advance!

Re: WRT54G v3 and SD Card Mod

I must admit myself as the most dumb bastard on the WWW !!! smile

A short notice to all modders planning to use a soldered slot for SD from an old card reader. Check carefully each pin inside the slot corresponds to which pin out of the slot!! mine was with 9-th pin leaded out to the last position so the slot was positioned like that:

        My SLOT                  Other
inside  -->  outside   -->   normal slot
9        -->      9        -->      1
1        -->      1        -->      2
2        -->      2        -->      3
3        -->      3        -->      4
4        -->      4        -->      5
5        -->      5        -->      6
6        -->      6        -->      7
7        -->      7        -->      8
8        -->      8        -->      9

So, check your slots before solder it!! Maybe somebody, lucky as me will get the same reversed slot.

Best wishes!