Difference between revisions of "MultiMediaCard"

From ArmadeusWiki
Jump to: navigation, search
m (Put your rootfs on the MMC/SD)
(Put your rootfs on the MMC/SD)
Line 70: Line 70:
 
===Put your rootfs on the MMC/SD===
 
===Put your rootfs on the MMC/SD===
 
* Buildroot should be configured to generate a tar-ed rootfs '''(done by default)''', if not:
 
* Buildroot should be configured to generate a tar-ed rootfs '''(done by default)''', if not:
[armadeus] $ make menuconfig
+
<pre class="host">
 +
$ make menuconfig
 +
</pre>
 +
 
 
<pre class="config">
 
<pre class="config">
Target filesystem options --->
+
Filesystem images  --->
 +
...
 +
    [*] tar the root filesystem
 +
          Compression method (no compression) --->
 +
    ()    other random options to pass to tar
 +
...
 
</pre>
 
</pre>
[[Image:Menuconfig_tar_rootfs.png]]
+
 
 
<pre class="host">
 
<pre class="host">
[armadeus] $ make
+
$ make
 
</pre>
 
</pre>
 
* and then uncompress the rootfs to the SD card:
 
* and then uncompress the rootfs to the SD card:
 
<pre class="host">
 
<pre class="host">
$ make shell_env
+
$ make shell_env
$ source armadeus_env.sh
+
$ source armadeus_env.sh
$ sudo tar xvf $ARMADEUS_ROOTFS_TAR -C /media/mmc
+
$ sudo tar xvf $ARMADEUS_ROOTFS_TAR -C /media/mmc
$ sudo umount /media/mmc
+
$ sudo umount /media/mmc
 
</pre>
 
</pre>
  

Revision as of 11:29, 13 February 2012

Instructions to use the MultiMediaCard (MMC/SD) on your Armadeus board

Introduction

You can use standard MMC/SD/miniSD/microSD cards with your Armadeus board:

All needed drivers are included in the standard Armadeus Linux image.

Card insertion

You should see something like that on the Linux console:

 # imx-mmc imx-mmc.0: card inserted
 mmc0: host does not support reading read-only switch. assuming write-enable.
 mmc0: new SD card at address 01b0
 mmcblk0: mmc0:01b0 SD512 500224KiB
  mmcblk0: p1

Note : If the special files /dev/mmcblk0, /dev/mmcblk0p1 /dev/mmcblk0p2 ... /dev/mmcblk0p7 are NOT present on your filesystem, create them by hand :

 # mknod /dev/mmcblk0 b 179 0
 # mknod /dev/mmcblk0p1 b 179 1
 # mknod /dev/mmcblk0p2 b 179 2
 ...
 # mknod /dev/mmcblk0p7 b 179 7

(It happened to me after upgrading an APF9328+DevLight from version 2.3 to 3.1)

Mounting the MMC/SD

  • Just mount the MMC like you will do on your PC:
 # mount /dev/mmcblk0p1 /media/mmc
  • Then, you can access the MMC's files from the /media/mmc directory

If you have problems with vfat code page, include the missing code page into the kernel.

Booting from MMC/SD

When your rootfs is too big to be put on the APF Flash, you can always use a MMC/SD like a Hard Drive and boot from it (this is possible because standard Armadeus kernel is compiled with the MMC driver built in).

Prepare your card

  • On your APF board (to avoid to crash your Host HD), create a good partition table:
 # /sbin/fdisk /dev/mmcblk0
 Delete all existing partion with 'd'
 Create a primary partion: 'n' then 'p' then '1'
 Change bootflag to Linux: 't' then '83'
 Save partition table: 'w'
 (To quit without saving: 'm')
  • Then, on your PC, format your MMC with Ext2 filesystem (booting on FAT is bad :-) ):
 $ sudo mkfs.ext2 /dev/sdX1   (replace X with your MMC reader drive letter, if your Laptop has an integrated
                                           MMC reader then use mmcblk0p1 instead of sdX1)
  • If not automatically detected/mounted by your distribution, mount your MMC/SD on your Host filesystem (for example in /media/mmc):
 $ sudo mkdir -p /media/mmc
 $ sudo mount /dev/sdX1 /media/mmc    (replace X with your MMC reader drive letter, if your Laptop has an integrated
                                                   MMC reader then use mmcblk0p1 instead of sdX1)

Put your rootfs on the MMC/SD

  • Buildroot should be configured to generate a tar-ed rootfs (done by default), if not:
$ make menuconfig
Filesystem images  --->
...
    [*] tar the root filesystem
          Compression method (no compression)  --->
    ()    other random options to pass to tar
...
$ make
  • and then uncompress the rootfs to the SD card:
$ make shell_env
$ source armadeus_env.sh
$ sudo tar xvf $ARMADEUS_ROOTFS_TAR -C /media/mmc
$ sudo umount /media/mmc

Boot

  • Insert the MMC/SD/microSD in the corresponding slot of your Armadeus board and then under U-Boot do:
 BIOS> run mmcboot
  • if you want to automatically boot from SD at each startup, modify the bootcmd U-Boot macro:
 BIOS> setenv bootcmd run mmcboot
 BIOS> saveenv

(default bootcmd when you receive your board is run jffsboot = boot from FLASH)

Performances

Troubleshots

VFAT Code Page

If you encounter this message (or something similar):

Unable to load NLS charset cp437
FAT: codepage cp437 not found

you have to add the charset to the supported kernel ones:

$ make linux26-menuconfig
File systems  ---> 
    -*- Native language support  --->
        <*>   Codepage 437 (United States, Canada)
        ...
        <*>   NLS ISO 8859-1  (Latin 1; Western European Languages)
        ...

Links