How to boot from a SD card with U-BOOt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to boot from a SD card with U-BOOt

2,329 Views
Jean-PaulLePape
Contributor I

Hello,

 I have an i.MX28 EVK board and used the script mk_mx28_sd to load uboot (ixm28_ivt_uboot.sb) on the SD card. The SD card is loaded on the second partition.

 The File system is loaded on the third partition.

I would like to know how can I configure UBOOT to be able to boot the kernel from the SD card. perhaps i nee to change the partition on the SD card?

By default UBOOT will try to find and boot the kernel from the network.

Thanks for your help,

:-)

Labels (1)
0 Kudos
2 Replies

1,272 Views
WilliamHuang
NXP Employee
NXP Employee

Hi All,

        I tried this steps for another way and it is working on L2.6.35_10.12.01.

 

root@william-desktop:~# fdisk -u /dev/sdb

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First sector (62-7744511, default 62): 16384

Last sector, +sectors or +size{K,M,G} (16384-7744511, default 7744511): 1064960

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 2

First sector (62-7744511, default 62): 1064961

Last sector, +sectors or +size{K,M,G} (1064961-7744511, default 7744511): 1081345

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 3

First sector (62-7744511, default 62): 1081346

Last sector, +sectors or +size{K,M,G} (1081346-7744511, default 7744511):

Using default value 7744511

 

Command (m for help): t

Partition number (1-4): 2

Hex code (type L to list codes): 53

Changed system type of partition 2 to 53 (OnTrack DM6 Aux3)

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

 

 

 

 

time sudo ./sdimage -f ./imx28_ivt_uboot.sb -d /dev/sdb

time sudo dd if=./uImage of=/dev/sdb bs=512 seek=256 conv=sync,notrunc

time sudo dd if=./rootfs.ext2 of=/dev/sdb3 bs=2048;sync

 

MX28 U-Boot > run bootcmd_mmc

0 Kudos

1,272 Views
Jean-PaulLePape
Contributor I

Hi All,

 So I was able to solve this problem. This is the solution for anybody that may be interested (I'm using a 3.2.1 kernel):

1) Create 4 partitions on your SD card. from your development machine you will probably have something like this:

                  /dev/sdb1

                  /dev/sdb2
                  /dev/sdb3
                  /dev/sdb4
2) the sizes of my partitions are:

                  /dev/sdb1 : 32 MB

                  /dev/sdb2: 32 MB
                  /dev/sdb3: 50 MB
                  /dev/sdb4: The remaining space

4) Load U-Boot (imx28_ivt_uboot.sb) on the second partition: /dev/sdb2

5) Load your new kernel (uImage) on the third partition: /dev/sdb3

5) Load the file system on the fourth partition: /dev/sdb4

6) boot the device

7) Enter into U-BOOT

8) Change the bootcmd and the bootargs. From in U-BOOT your command should look like this:

    setenv bootcmd 'fatload mmc 0:3 0x42000000 uImage; bootm 0x42000000'

    setenv bootargs 'console=ttyAMA0, 115200 root=/dev/mmcblk0p4 rootfs=ext3 rw rootwait"

    saveenv

9) reboot

If anybody as a question concerning these steps please feel free to ask.

Take care,

:-)

0 Kudos