U-boot build problem in LTIB and creating a new uSD card process

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

U-boot build problem in LTIB and creating a new uSD card process

9,838 Views
snirnisim
Contributor III

hello everyone,

for the past two weeks i tried learning how to make a new uSD card with minimal configuration to boot the QSB.

i've followed the "ltib_build_host_setup.pdf" document and now i'm having a PC running UBUNTU 10.04LTS with all relvant packages. i installed LTIB from "L2.6.35_11.09.01_ER_source" and followed the instruction (which i can't say i fully understand...) in the "i.MX53_START_Linux_BSP_UserGuide" PDF. for the beging i wanted to just compile the minimun configuration selecting the proper "LOCO" board.

i'm rapidly getting the error :

These packages failed to build:
u-boot

Build Failed

Exiting on error or interrupt

( full terminal plot in attached "log.txt" file).

i hope someone can help me solve this asap.

if someone can explain me please the proccess of moving the files (that LTIB will create when build will successed) to a uSD, which i inserted to the PC runinig linux, with a SD adapter and a usb to SD converter, and then which commands i have to use after i'm moving the card to the QSB in order to setenv for U-boot and properly boot the board.

sorry about the my english and i hope i'ts clearly enough.

thanks in advance,

snir

Labels (1)
73 Replies

875 Views
snirnisim
Contributor III

well thanks again.

i tried using the arguments you mentined but i only got the penguin in the vga and this message in hyperterminal:

 

regulator_init_complete: incomplete constraints, leaving DA9052_LDO8 on regulator_init_complete: incomplete constraints, leaving DA9052_LDO6 on regulator_init_complete: incomplete constraints, leaving DA9052_LDO5 on regulator_init_complete: incomplete constraints, leaving DA9052_LDO4 on regulator_init_complete: incomplete constraints, leaving DA9052_LDO3 on regulator_init_complete: incomplete constraints, leaving DA9052_LDO2 on regulator_init_complete: incomplete constraints, leaving DA9052_LDO1 on mxc_rtc mxc_rtc.0: setting system clock to 1970-01-01 00:00:00 UTC (0) Root-NFS: No NFS server available, giving up. VFS: Unable to mount root fs via NFS, trying floppy. List of all partitions: b300         3872256 mmcblk0 driver: mmcblk   b301         3839535 mmcblk0p1 No filesystem could mount root, tried:  jffs2 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) [<80037538>] (unwind_backtrace+0x0/0xf0) from [<80412cdc>] (panic+0x6c/0xe0) [<80412cdc>] (panic+0x6c/0xe0) from [<80008ddc>] (mount_block_root+0x1cc/0x20c) [<80008ddc>] (mount_block_root+0x1cc/0x20c) from [<80009028>] (prepare_namespace +0x11c/0x174) [<80009028>] (prepare_namespace+0x11c/0x174) from [<800084a0>] (kernel_init+0x12 0/0x168) [<800084a0>] (kernel_init+0x120/0x168) from [<800339e0>] (kernel_thread_exit+0x0 /0x8)

 

sorry to bother you but i just need to understand once how to do it correctly so i could start using the board for the project.

i can't believe it's so complicated and annoing. i hope that after i will make it work one time it will be more easy to modifiy the system to the project needs, such as boot commands and networking file sharing from sata drive.

 

thank you very much for your support.

snir.

0 Kudos

875 Views
StevieRG
Contributor II

The environment tells u-boot and the kernel what options you want enabled and how you want to boot the system. You probably find at the moment that at the start of your boot you get some message like "Bad checksum", this is because environment is not set. My environment settings (bootargs) to get a basic VGA display and other things are:

setenv lvds 'video=mxcdi0fb:RGB666,XGA ldb'

setenv lcd 'video=mxcdi0fb:RGB24,SEIKO-WVGA'
setenv vga 'video=mxcdi1fb:GBR24,VGA-XGA di1_primary tve'
setenv hdmi 'video=mxcdi0fb:RGB24,1024x768M@60'

setenv bootcmd_obds 'ext2load mmc 0:1 0x70800000 /unit_tests/obds.bin; go 70800000'
setenv bootargs_base 'setenv bootargs console=ttymxc0,115200 ${vga}'
setenv bootargs_nfs 'setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp'
setenv bootcmd_net 'run bootargs_base bootargs_nfs; tftpboot ${loadaddr} ${kernel}; bootm'
setenv bootargs_mmc 'set bootargs ${bootargs} root=/dev/mmcblk0p1 rw rootwait'

setenv bootcmd_mmc 'run bootargs_base bootargs_mmc; mmc dev 0; mmc read ${loadaddr} 0x800 0x1800; bootm'

setenv bootcmd 'run bootcmd_mmc'

saveenv

I'm not using ethernet so I'm not sure about this, I haven't tried it, but you might be able to change the line above that sets bootcmd_mmc to this:

setenv bootcmd_mmc 'run bootargs_base bootargs_nfs bootargs_mmc; mmc dev 0; mmc read ${loadaddr} 0x800 0x1800; bootm'

... this then includes the bootargs for networking. When you do this you could find your boot seems to hang for a long time at some point when it tries to find a dhcp router, it's OK, it will timeout after a while. If you plug an ethernet cable in to a router, this hang won't be there and the board will be assigned an ip address.

Remember after setting up or changing any bootargs like above, you must run:

saveenv

... then what you entered will be stored. Then reboot the system.

0 Kudos

875 Views
snirnisim
Contributor III

Steve G, thank you very much! i'm now actually booting the board with a new uSD with my compiled kernel bootloader and filesystem.

thank you very much.

now i'm trying to setenv correctly. where can i find the options for the enviroment setting?

i need ethernet, vga and one usb can you suggest the propre enviroment for me?

what is enviroment actually means?

 

thank you again for every thing.

0 Kudos

875 Views
snirnisim
Contributor III

o.k i will try using the reset and power disconnection and inform you if it works. thank you Steve G.

Yuri Muhin - what do you mean with "u-boot and kernel are out of filesystem"?

thank you again about the reset of the information.

0 Kudos

875 Views
Yuri
NXP Employee
NXP Employee

1.

> ... but nothing was on the uSD. 

Maybe add "sync" command.
Also note, u-boot and kernel are out of file system.

2.
> ... should use ./ltib- c?

Of course, kernel should be built before u-boot.

U-boot environment variables may be found in Freescale Linux User Guide(s).
They are set manually after boot. 
 

0 Kudos

875 Views
StevieRG
Contributor II

Glad the script worked for you snir. I wonder if maybe your SD is OK, but you are seeing the QSB power-up problem and it makes you think your SD has a problem, there are several threads which describe it, such as:

http://imxcommunity.org/group/imx53quickstartboard/forum/topics/imx53-qsb-powerup-hangs

I get this problem all the time too. When you power on you just see the LEDs and nothing appears to work. But if you press and hold the reset button for some seconds sometimes it starts. Sometimes you have to disconnect power and reconnect and then hold reset a few times. It seems this is known and there are some patches though I haven't had chance to look at them myself yet. I have a feeling the u-boot that ships with the QSB might have some fixes as standard so it works, but the self-build u-boot do not.

0 Kudos

875 Views
snirnisim
Contributor III

thank you every one.

Yuri Muhin - i used the commands you specified and it finally built sucessfully, thank you very much. there was only one problem with the last command that keep prompting: "167kb hane been copied" but nothing was on the uSD. another question would be how can i configure the kernel when using the commands you suggested? where between the 3 first command i should use ./ltib- c?

i used Steve G  script and finally it worked fine and i got the files on the uSD, but yet i moved the uSD from the host PC to the QSB and i just didn't get anything in the debug. all leds remain blue but hyperterminal doesn't show any u-Boot log that i can use. are there any further things i should do to finally get it woked? i just wanted a  a self-copmiled working uSD with self-configured kernel, how could it be so copmlicated??

 

thank you in advanced,

snir

0 Kudos

875 Views
Yuri
NXP Employee
NXP Employee


http://www.imxdev.org/wiki/index.php?title=All_Boards_U-boot

To get u-boot sources under the LTIB:

./ltib -m prep -p u-boot


To build U-boot :

./ltib m scbuild p u-boot

To deploy  :

./ltib m scdeploy p u-boot


To create bootable SD on host PC:

sudo dd if=u-boot.bin of=/dev/sda bs=512 seek=2



Also the next may be useful :

http://www.imxdev.org/wiki/index.php?title=All_Boards_U-boot

0 Kudos

875 Views
StevieRG
Contributor II

Maybe this will help with the second part of your question, about how to transfer your build onto an SD card. Here is a script I use (many thanks and acknowledgements to the original authors). You may need to adapt it for your own SD card device and paths - please don't use it until you have checked these - it is capable of erasing a drive! I place this in my ltib directory and run it from there in a terminal.

-------------------------------------------------------------------------------------------

#! /bin/sh

################################################################################
#
# Flashes the images produced by LTIB on a block device
#
# By RL (Adeneo Embedded http://www.adeneo-embedded.com/)
# Adapted by Steve G

#
# USAGE:
# ./flash_ltib.sh
#
# WARNING: reformats and partitions the block device! Make sure you are using
# the correct device node!
#
################################################################################


#######################################
# Constants (customizable)
#######################################

LTIB_PATH=$(pwd)

echo "Path to LTIB: $LTIB_PATH"


#######################################
# Check input parameters
#######################################

# IMPORTANT: YOU MAY NEED TO CHANGE THIS TO MATCH YOUR OWN DEVICE !!!!!!!!!!!
SDCARD_DEV=/dev/sdb

# Simplify the device to its minimal expression
SDCARD_DEV="$(dirname $SDCARD_DEV)/$(basename $SDCARD_DEV)"

if [ -z $SDCARD_DEV ]; then
echo "\ERROR: Must set the destination device\n"
echo "Syntax: $0 [device]"
echo "Example: $0 /dev/sdg\n"
exit 1
fi

# Make sure we are not trying to write to the primary partition
if [ $SDCARD_DEV = "/dev/sda" ]; then
echo "\nERROR: Forbidden to write to /dev/sda\n"
echo "Syntax: $0 [device]"
echo "Example: $0 /dev/sdg\n"
exit 1
fi

# Check that we are writing to a block device
if [ ! -b $SDCARD_DEV ]; then
echo "\nERROR: $SDCARD_DEV is not a block device\n"
exit 1
fi


#######################################
# Copy the bootloader
#######################################

BOOTLOADER_IMG=$LTIB_PATH/rootfs/boot/u-boot.bin

echo "Path to BOOTLOADER: $BOOTLOADER_IMG"

echo "Copying u-boot..."
sudo dd if=$BOOTLOADER_IMG of=$SDCARD_DEV bs=512 || exit 1
sync

#######################################
# Copy the kernel
#######################################

KERNEL_IMG=$LTIB_PATH/rootfs/boot/uImage

echo "Path to KERNEL: $KERNEL_IMG"

echo "Copying kernel..."
sudo dd if=$KERNEL_IMG of=$SDCARD_DEV bs=512 seek=2048 || exit 1
sync

#######################################
# Create Partition Table
#######################################

# Unmount everyone
sudo umount ${SDCARD_DEV}*

# Check if the device name is mmcblkX
if echo "${SDCARD_DEV}" | grep -q mmcblk; then
PART_NAME=${SDCARD_DEV}p1
else
PART_NAME=${SDCARD_DEV}1
fi

SIZE=`sudo fdisk -l ${SDCARD_DEV} | grep Disk | awk '{print $5}'`
CYLINDERS=`echo $SIZE/8225280 | bc`

if [ $CYLINDERS -eq 0 ]; then
echo "\nERROR: 0 cylinders\n"
exit 1
fi

echo "DISK SIZE - $SIZE bytes"
echo "CYLINDERS - $CYLINDERS"

# Create a single ext3 partition while leaving space for U-Boot and kernel
{
echo 4,,,*
} | sudo sfdisk -H 255 -S 63 -C $CYLINDERS ${SDCARD_DEV}

# Format the ext3 partition
echo "Formatting partition $PART_NAME..."
sudo mkfs.ext3 $PART_NAME -L linux_ltib || exit 1


#######################################
# Write the root filesytem
#######################################

#echo "Writing root filesystem..."

mkdir -p sdcard && \
sudo mount $PART_NAME sdcard && \
sudo cp -rpav $LTIB_PATH/rootfs/* sdcard && \
sudo cp directfbrc sdcard/etc && \
sudo umount sdcard
rmdir sdcard

sync && sync

# end of script

-------------------------------------------------------------------------------------------

Now you also asked about the bootargs for the QSB. I use the bootargs below, you can try these to begin with but you might have to modify them for your own uses, note that I'm not using the ethernet connection and I am selecting vga display. When you start the QSB, hit a key to stop u-boot and get the u-boot command prompt. Just copy and paste them. Don't forget to do the "saveenv" too, then reboot.

setenv lvds 'video=mxcdi0fb:RGB666,XGA ldb'
setenv lcd 'video=mxcdi0fb:RGB24,SEIKO-WVGA'
setenv vga 'video=mxcdi1fb:GBR24,VGA-XGA di1_primary tve'
setenv hdmi 'video=mxcdi0fb:RGB24,1024x768M@60'

setenv bootcmd_obds 'ext2load mmc 0:1 0x70800000 /unit_tests/obds.bin; go 70800000'

setenv bootargs_base 'setenv bootargs console=ttymxc0,115200 ${vga}'
setenv bootargs_nfs 'setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp'

setenv bootcmd_net 'run bootargs_base bootargs_nfs; tftpboot ${loadaddr} ${kernel}; bootm'

setenv bootargs_mmc 'set bootargs ${bootargs} root=/dev/mmcblk0p1 rw rootwait'

setenv bootcmd_mmc 'run bootargs_base bootargs_mmc; mmc dev 0; mmc read ${loadaddr} 0x800 0x1800; bootm'

setenv bootcmd 'run bootcmd_mmc'

saveenv

0 Kudos

875 Views
swapneelsangar
Contributor II

Dear sir,

  I try to create our own image file. For this purpose,

      I generate no-padding U-Boot by using given command and use this

no padding u-boot-mx53-loco-no-padding.bin file  to copying the boot

loader image and copying the kernal image. follow all command given in

section 7 of mx53 start linux bsp user guide.pdf.

     After that insert the microSD card in mx53 QSB ,connect serial port

and configure it to 115200-8-N-1. connect VGA monitor to QSB.

     connect power supply and press POWER switch so blue led on. but It

does not show any thing on hyper terminal also on VGA display. I

given command BBG U-Boot > printenv given in DOC-1554 but it does not

get this command.

     I attach my complete procedure which i done in command promt  from

start to end. Please check screenshot1 then screenshot2 and then

screenshot3. Is any thing is wrong in that ?

     procedure:

     1) Install LTIB on ubuntu 1004 upto step 2.2 at the point 8(

Install one package to rootfs)in mx53 start linux bsp user guide.pdf.

     1) insert microSD card in card reader and connect the reader to

ubuntu  pc.

     2)open command promt and follow all instructions which are given in

section 7(please see screen shot1,2 and 3.)

     3)After that insert the microSD card in mx53 QSB ,connect serial

port and configure it to 115200-8-N-1. connect VGA monitor to QSB.

     connect power supply and press POWER switch so blue led on. but It

does not show any thing on hyper terminal also on VGA display. I

given command BBG U-Boot > printenv given in DOC-1554 but it does not

get this command.

I follow all the procedure with out generating  no-padding U-Boot but the result is same.

        Please guide me if any thing is wrong in this procedure or in

command.

Thanks & Regards

swapneelScreenshot1.pngScreenshot2.pngScreenshot3.png


0 Kudos

875 Views
RandyKrakora
NXP Employee
NXP Employee

Try ccache -C, then rebuild, see if it persists.

0 Kudos