AnsweredAssumed Answered

Problem when booting from sd card - TWRLS1021a

Question asked by Andreas Schmelter on Aug 10, 2016

Hi,

 

I'm sorry, but I'm facing the next problem. After compiling my custom kernel, I cant boot it from the sd card.

 

At first I boot the OOBE-Demo delivered with the board. This works fine. The boot from the sd card works and I see the output of my hdmi port on my monitor.

 

Then I tried to boot my custom kernel.

 

I used the following switch configuration:

 

For SD-card boot:

- switch the SW3[1] to ‘0’, set the SW2[1:8] to ‘0x00101111’.

- SW2[1:8] 0x00101111, SW3[1:8] 0x01100001.

 

I setup the bootseektor of the sd card as it is described in the QuickStart.

 

At this point I have on question. When I write the bootloader to my card, why do I use sdb and not sdb1??

 

After this I create a seccond partition (sdb2) with ext2 FS on the card. The steps are described here.

 

Deploy Filesystem to the SD Card

Once the U-Boot network parameters have been set, follow the steps below to deploy the filesystem to the SD card:

  1. Connect the card reader with SD card to the Linux Host PC.
  2. Create the partitions by "fdisk /dev/sdb", one MS-DOS partition(sdb1 and this partition usually for u-boot) and one ext2 partition(sdb2) in the SD card. #fdisk /dev/sdb
  3. Use the mkfs.ext2 command to create the filesystems. # mkfs.vfat /dev/sdb1 # mkfs.ext2 /dev/sdb2
  4. Create temp directory in host PC and mount the ext2 partition to the temp. # mkdir /temp # mount /dev/sdb2 /temp # cd /temp
  5. Mount the target board type .iso (eg. QorIQ-SDK-V1.7-PPCE6500-<release date>-yocto.iso) to get the tarball (eg. QorIQ_SDK_V1.7_E6500_<release date>_ROOTFS_Image.tar.gz) on host PC.# mount -o loop QorIQ-SDK-V1.7-PPCE6500-<release date>-yocto.iso /work
  6. Copy the file system to harddisk by extracing the QorIQ_SDK_V1.7_E6500_<release date>_ROOTFS_Image.tar.gz. Remove the tarball after extracting rootfs. # cp QorIQ_SDK_V1.7_E6500_<release date>_ROOTFS_Image.tar.gz # sudo tar -zxvf QorIQ_SDK_V1.7_E6500_<release date>_ROOTFS_Image.tar.gz # rm QorIQ_SDK_V1.7_E6500_<release date>_ROOTFS_Image.tar.gz

     I modified the data in step 6 to use my creeated files.

  1. Make sure the kernel image and dtb file are in /temp/boot directory, then umount the /temp.# cp uImage and uImage.dtb to /temp/boot folder # umount /temp

 

The I setup the u-boot environment on the board:

 

Setting U-Boot Environment

You can place the ext2 filesystem and kernel on the SD card, then the kernel can boot up automatically after the board is powered on or after reset. Prior to this deployment, make sure U-Boot parameters have been set up:

# setenv bootfile uImage 
# setenv fdtfile uImage.dtb
# setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw
rootdelay=5 console=$consoledev,$baudrate;mmcinfo;ext2load mmc 0:2 $loadaddr   /boot/$bootfile;ext2load mmc 0:2
$fdtaddr /boot/$fdtfile;bootm $loadaddr - $fdtaddr'
# save

After this I plug in the SD card to the target board and power on.

 

After this I get the following error message from the board. The error message says how to use ext2load correctly. I think that means, that something is wrong with my commands that I configured into u-boot on the board. I marked it red a few line above. But what is wrong with this command???

 

This is my boot message:

 

Device: FSL_SDHC                                                          
Manufacturer ID: 3                                                        
OEM: 5344                                                                 
Name: SL08G                                                               
Tran Speed: 50000000                                                      
Rd Block Len: 512                                                         
SD version 3.0                                                            
High Capacity: Yes                                                        
Capacity: 7.4 GiB                                                         
Bus Width: 4-bit                                                          
Erase Group Size: 512 Bytes                                               
ext2load - load binary file from a Ext2 filesystem                        
                                                                  
Usage:                                                                    
ext2load <interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]       
- load binary file 'filename' from 'dev' on 'interface'               
to address 'addr' from ext2 filesystem.                             
ext2load - load binary file from a Ext2 filesystem                        
                                                                  
Usage:                                                                    
ext2load <interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]       
- load binary file 'filename' from 'dev' on 'interface'               
to address 'addr' from ext2 filesystem.                             
bootm - boot application image from memory                                
                                                                  
Usage:                                                                    
bootm [addr [arg ...]]                                                    
- boot application image stored in memory                             
passing arguments 'arg ...'; when booting a Linux kernel,         
'arg' can be the address of an initrd image                       
When booting a Linux kernel which requires a flat device-tree     
a third argument is required which is the address of the          
device-tree blob. To boot that kernel without an initrd image,    
use a '-' for the second argument. If you do not pass a third     
a bd_info struct will be passed instead                           
                                                                  
Sub-commands to do part of the bootm sequence.  The sub-commands must be  
issued in the order below (it's ok to not issue all sub-commands):        
start [addr [arg ...]]                                            
loados  - load OS image                                           
ramdisk - relocate initrd, set env initrd_start/initrd_end        
fdt - relocate flat device tree                               
cmdline - OS specific command line processing/setup               
bdt - OS specific bd_t processing                             
prep- OS specific prep before relocation or go                
go  - start OS                                                

=>

 

 

 

 

Thanks for helping!

 

Regards,

Andreas

Outcomes