How to boot a board from a SD card

From RidgeRun Developer Connection

(Difference between revisions)
Jump to:navigation, search
(Creating a SD card image)
(Instruction to boot from SD card using the SDK 2011Q2)
Line 12: Line 12:
# Press ENTER in the ''Firmware deployment mode'' option.
# Press ENTER in the ''Firmware deployment mode'' option.
# Select ''Deploy all the firmware to an SD card''.
# Select ''Deploy all the firmware to an SD card''.
-
# Now you can choose how to flash your SD card with the images as is shown below.
+
# Now you can choose how to flash your SD card with the images: creating a sdcard image or write the images directly to your SD card. Both methods are shown in the following sections.
== Creating a SD card image ==
== Creating a SD card image ==
Line 18: Line 18:
This is the default option, you will see the ''Flash SD card image into loopback file instead of real SD'' option selected. This method creates a SD image that then you will be able to write to a real SD card. In order to do this follow the next steps:
This is the default option, you will see the ''Flash SD card image into loopback file instead of real SD'' option selected. This method creates a SD image that then you will be able to write to a real SD card. In order to do this follow the next steps:
-
1. Select the size of the image you want to create by typing it the ''Size of loopback device for SD card'', by default it is set to 512MB and in most of the cases this value is enough.<br>
+
1. Select the size of the image you want to create by typing it the ''Size of loopback device for SD card'', by default it is set to 128MB and in most of the cases this value is enough.<br>
2. Exit you configuration wizard and type ''make install'' into your SDK's path. A warning message will be prompted, just type ''yes'' and wait until the process finishes.<br>
2. Exit you configuration wizard and type ''make install'' into your SDK's path. A warning message will be prompted, just type ''yes'' and wait until the process finishes.<br>
3. After that a file called ''sdcard.img'' will be created into the ''<mySDKPath>/images/'' directory. <br>
3. After that a file called ''sdcard.img'' will be created into the ''<mySDKPath>/images/'' directory. <br>
4. Insert a SD card in your PC and wait until it is mounted. <br>
4. Insert a SD card in your PC and wait until it is mounted. <br>
-
5. Type ''mount'' and verify the name of the device associated to your SD card as is shown in the following image:<br>
+
5. Type ''mount'' and verify the name of the device associated to your SD card as is shown below:<br>
 +
<pre>
 +
'''/dev/sdb1''' on /media/boot type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush)
 +
</pre>
-
6. Go to the ''images'' directory and run the following command:  
+
6. Umount the media by typing the following command:
 +
 
 +
<pre>
 +
sudo umount <directory where your SD card was mounted i.e. /media/boot >
 +
</pre>
 +
 
 +
7. Go to the ''images'' directory and run the following command:  
<pre>
<pre>
Line 33: Line 42:
Where '''sdX'' represents the device name gotten in 5.
Where '''sdX'' represents the device name gotten in 5.
-
7. Once the process finishes insert the SD card into your board and turn ON the dip switch 2, then power on the board, it will start booting from your SD card now.<br>
+
8. Once the process finishes insert the SD card into your board and turn ON the dip switch 2, then power on the board, it will start booting from your SD card now.<br>
== Write to the SD card directly ==
== Write to the SD card directly ==
 +
 +
This method allows you to write a SD card directly using your SDK storing the kernel and bootloader images on it. In order to do that you must follow the next steps:
 +
 +
1. Unselect the option ''Flash SD card image into loopback file instead of real SD''.<br>
 +
2. Repeat steps 5 and 6 of the previous section. <br>
 +
3. In step 1 a new option called ''SD device on Linux host'' will appear, type the name of the device associated with your SD card on it.<br>
 +
4. Save the changes and exit to your SDK's path.<br>
 +
5. Run ''make install'' and wait until the SD card has been wrote.<br>
 +
6. Once the process finishes insert the SD card into your board and turn ON the dip switch 2, then power on the board, it will start booting from your SD card now.<br>

Revision as of 22:29, 12 May 2011

Contents

Introduction

In this section it will be shown how to boot your board directly from your SD card. For this tutorial it will be used the Stable Release of the SDK for the LeopardBoard DM368 (called 2011Q2) but in most of SDKs you will find similar options.

Instruction to boot from SD card using the SDK 2011Q2

In our new Stable Release of the SDK (called 2011Q2) and later versions you will be able to find a new option to boot your board from the SD card, this means you will be able to load the bootloader and kernel images directly from a SD card. For this example we will use NFS for file system.

  1. Got to you SDK's path: cd <mySDKPath>.
  2. Run make config.
  3. Go to Installer Configuration.
  4. Press ENTER in the Firmware deployment mode option.
  5. Select Deploy all the firmware to an SD card.
  6. Now you can choose how to flash your SD card with the images: creating a sdcard image or write the images directly to your SD card. Both methods are shown in the following sections.

Creating a SD card image

This is the default option, you will see the Flash SD card image into loopback file instead of real SD option selected. This method creates a SD image that then you will be able to write to a real SD card. In order to do this follow the next steps:

1. Select the size of the image you want to create by typing it the Size of loopback device for SD card, by default it is set to 128MB and in most of the cases this value is enough.
2. Exit you configuration wizard and type make install into your SDK's path. A warning message will be prompted, just type yes and wait until the process finishes.
3. After that a file called sdcard.img will be created into the <mySDKPath>/images/ directory.
4. Insert a SD card in your PC and wait until it is mounted.
5. Type mount and verify the name of the device associated to your SD card as is shown below:

'''/dev/sdb1''' on /media/boot type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush)

6. Umount the media by typing the following command:

sudo umount <directory where your SD card was mounted i.e. /media/boot >

7. Go to the images directory and run the following command:

sudo dd if=sdcard.img of=/dev/sdX

Where 'sdX represents the device name gotten in 5.

8. Once the process finishes insert the SD card into your board and turn ON the dip switch 2, then power on the board, it will start booting from your SD card now.

Write to the SD card directly

This method allows you to write a SD card directly using your SDK storing the kernel and bootloader images on it. In order to do that you must follow the next steps:

1. Unselect the option Flash SD card image into loopback file instead of real SD.
2. Repeat steps 5 and 6 of the previous section.
3. In step 1 a new option called SD device on Linux host will appear, type the name of the device associated with your SD card on it.
4. Save the changes and exit to your SDK's path.
5. Run make install and wait until the SD card has been wrote.
6. Once the process finishes insert the SD card into your board and turn ON the dip switch 2, then power on the board, it will start booting from your SD card now.

Navigation
Toolbox