MMC Driver / Adaptor
MultiMediaCard for the FOX
Driver
This driver is a loadable module for Acme's FOX board running Linux 2.6.
It works well with a variety of popular MMC compatible cards, including the 2 GB SD and the new 4 GB HCSD cards.
The basic connections are the same as the hardware described in this Acme article.
Support is present for insert detection and an activity LED, which require some extra I/O pins.
As this is a replacement for the MMC driver in the SDK, you'll need to have a kernel on your FOX with MMC support disabled in the SDK.
Installation should be straightforward:
Extract the source into the 'devboard-R2_01' directory, this should create the directory 'afm/mmc'.
Possibly set the hardware options in 'mmc.h' and run 'make' in the 'mmc' directory.
Copy the file 'mmc.ko' to a writable place on the FOX (eg. '/tmp').
Execute 'insmod mmc.ko' on the FOX.
Insert a MMC/SD card and type 'mount -t vfat /dev/mmc1 /mnt/0', the card's contents should now be available in the '/mnt/0' directory on the FOX. If not, check the system log for error messages.
Note that using the '-o sync' option makes accessing the card slow, as this breaks the stream mode. Also the additional wear could cause premature card failure.
Execute 'umount /mnt/0' before ejecting a card, otherwise data corruption could occur.
The LED will be lit when the card is mounted, and flashes if data is transferred.
To make a flash image with the driver included, add the line 'sub afm/mmc' to the 'devboard-R2_01/configure-files/post' file. If the 'post' file does not exist, create it. Don't forget to run './configure'.
The module should now be included in the '/lib/modules/2.6.15' directory of the flash image after the next top level make.
Software files
MMC module V1.01 source
Compiled MMC module V1.01 using glibc
Adaptor
For easy integration, I designed a small adaptor pcb that can be mounted to a carrier board holding the FOX and other components. The image to the right shows the connections that need to be made to the FOX board. The dotted lines indicate the optional insert detect and activity LED. The insert detect also requires a pull-up resistor.
If the adaptor is wired as indicated, it will also support the lock switch on the SD card. (The lock switch is actually just a slider) This is rather crudely done in the connector housing by cutting the power line to the card, which means the card cannot be mounted.
The SD/MMC connector is fabricated by Multicomp and can be obtained through Farnell. The pcb is used with the traces on top, as the connector is a smd component.
The LED and capacitor are mounted on the same side as the connector. The underside holds the two 6-pin pinheaders and the LED resistor.
It is advisable to put a 10uF capacitor on the power lines near the adaptor.
Hardware files
These files are copyrighted, they are free for non-commercial or evaluation use.
They come without any warranty whatsoever, it's up to the user to verify their suitability for a particular application.
Schematic
PCB layout
© AFM Design, All Rights Reserved