Experience with SDHC mod on WRT54GL

Discussion in 'Tomato Firmware' started by etchie, Mar 15, 2011.

  1. etchie

    etchie Networkin' Nut Member

    Hello modders,

    since I have modded my router recently, I'd like to share some info about it.
    I am currently running fresh tomato-slodki-ND-1.28.02 firmware with SDHC mod.

    This is my set up:
    router WRT54GL v1.1
    CPU speed 250 MHz
    SDHC: 16GB Class 10 (manufacturer A-DATA)

    SDHC has 2 partitions: 1st partition is 64MB type swapfs, 2nd partition with all remaining space is now ext2 type. Optware is installed on this partition too. I decided to use swapfs to expand router's available memory. I was getting 'Memory allocation error' when I tried to install some programs from optware. (e.g. mediatomb) Installing swap space did the trick.

    Command for adding a swap space is:
    swapon /dev/mmc/disc0/part1
    Based on well-known testing method:
    sync; date; dd if=/dev/zero of=/mmc/test.bin bs=1024 count=102400; sync; date
    sync; date; dd if=/mmc/test.bin of=/dev/null bs=1024 count=102400; sync; date
    I measured these interesting results concerning speed of SDHC card:

    partition type: VFAT, writing speed 931 kB/s, reading speed 528 kB/s
    partition type: EXT2, writing speed 826 kB/s, reading speed 531 kB/s
    partition type: EXT3, writing speed 731 kB/s, reading speed 485 kB/s

    Tests were repeated 2 times for each partition type with similar results. I took the best results for each partition. I decided to keep ext2 type because of speed. It was not possible to use VFAT for installation of optware, so etx2 was a compromise for me.

    So far, so good. But there is a conflict between SD mod and tomato firmware as well. The conflict is not a big issue. However it might be annoying and makes scripts based on holding of SES button unusable. For example I used to have SSH started after holding SES for couple of seconds. Problem itself is caused by linking GPIO4 signal from CPU to DO (data out) pin of SD/SDHC card. This is a standard modification when we want SD card running. As far as I know, WRT54GL has no other option for this but GPIO4. So far nobody was able to find where e.g. GPIO5 is connected. Never mind. Standard purpose of GPIO4 is to react on SES button located on front panel. But if SD card is connected to the same pin in parallel, every communication with SD card acts as if SES button was pressed. System log is then overfull by messages 'SES pushed. Count was...'. Enabled scripts or events linked to SES button are run randomly too. It is not a big deal when you have active 'Reboot' or 'Toggle Wireless' in 'SES/AOSS Button' menu in such case. As a temporary solution I kill buttons process in startup. Maybe a permanent solution would be to modify buttons.c in firmware source to check if SD card communication is active and thus allow evaluate pressing of SES button only in case when there is no communication with SD card for some time. On the other hand pressing of SES button during communication with SD card must definitely cause an error in data sent from the card. Probably corrupted files on SD card too. So the best solution would be to find mentioned GPIO5 - if ever possible.

    Happy modding !
  2. etchie

    etchie Networkin' Nut Member

    I noticed one very unpleasant thing in the file system on my SDHC card. I am running out of free space quite quickly. I see the smallest writable area on my 16GB card is exactly 256kB. It means that every small file occupies at least 256kB. Optware installed lots of the small files. I am not familiar very well with Linux file systems but I am convinced this is not an ext2 issue. It seems like a problem with bigger SDHC card and maybe addressing possibilities/issue of SPI interface which interconnects router and the card. Can anybody share info what is the smallest addressable space on SD cards of different sizes? What about 32GB cards? Is the smallest addressable space 512kB? It would mean that it is not any advantage to buy a bigger card.

    Update: I have to correct previous info a little bit. I checked the sizes of the files via Samba server running in router. I was connected from Win XP and the info concerning "Size on disk" and total size of all files I saw in Windows. Then later I tried the same thing from Ubuntu but there is no such thing like "Size on disk" in file properties. As well I checked the available SD card space directly via console and it was okay. So it is probably not an issue as I wrote above. It seems to be an issue of Samba server and Windows combination. In first moments I was very surprised cause Windows indicated taken space more then 1.5GB and the real total size of all files was round about 50MB.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice