Flashing helper script for the i.MX53 QSB and LTIB

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

Flashing helper script for the i.MX53 QSB and LTIB

1,469 Views
rlorriaux
Contributor I

Flashing an SD Card from scratch takes many steps and can be error-prone. The attached script will partition, format an SD Card, then write the files generated by LTIB in one single line.

 

It copies the bootloader, the kernel, then creates an ext3 partition where the root filesystem is copied.

32MB are reserved for the bootloader and the kernel. The rest of the SD Card is allocated for the ext3 partition.

 

Usage:

# export LTIB_PATH=~/training_mx53/linux/ltib (only needs to be done once in your current shell)

# ./flash_ltib.sh [SD Card block device]

 

The first command tells the script where the root directory of LTIB is located

You will be prompted for super-user rights (so you do not need to call the script with sudo)

 

Example:

# export LTIB_PATH=~/training_mx53/linux/ltib

# ./flash_ltib.sh /dev/sdb

 

Target setup:

To boot from the SD Card, you can set the following environment variables in U-Boot:

U-Boot> setenv bootargs_mmc 'setenv bootargs ${bootargs} console=tty1 root=/dev/mmcblk0p1 rootwait rw'
U-Boot> setenv loadk 'mmc read 0 ${loadaddr} 0x800 0x1800'
U-Boot> setenv bootcmd_mmc 'run bootargs_base bootargs_mmc; run loadk; bootm'
U-Boot> setenv bootcmd 'run bootcmd_mmc'

 

If you want the board to boot on the SD Card by default, you can save the environment using:

U-Boot> saveenv

 

Caution:

This script will repartition and reformat the block device. Make sure you are supplying the right parameter!

 

Note:

The script uses the unstripped version of the root filesystem.

Original Attachment has been moved to: 777-flash_ltib.sh

Labels (1)
0 Kudos
9 Replies

1,179 Views
JoaoPeixoto
Contributor I

Hello Remi,

Thanks for your help... The problem was solved :-)

In my previous reply I forgot to mention one detail ... the problem was not only the USB keyboard connected to the QSB board ... i.e. ... as I had problems at the boot was normal that it was not detected ... More serious was the fact that in the host I can't write anything via serial port ...
I finally discovered where the problem was ... I don't have the solution ... but I discovered that the problem was in minicom ... 
I can't send commands via minicom ... Today, I tried to send via gtkterm and could finally change the U-Boot :-)

Next step, create a custom image without X but with DirectFB and Qt... we'll see :-)))

0 Kudos

1,179 Views
rlorriaux
Contributor I

You interact with the bootloader using the serial console, which is how you got your logs. You will need to strike a key before it times out and enter the commands I have mentioned.

You definitely want to look at i.MX53_START_Linux_BSP_UserGuide.pdf supplied with the latest version of the Linux BSP (part of the documentation archive).

0 Kudos

1,179 Views
JoaoPeixoto
Contributor I
Remi, Thanks for your reply:-) Monday I will try this approach. I have only one question. To set the environment variables before copy the u-boot.bin to the SD, I must add them in the LTIB configuration, correct? Because in the QSB board I can't write nothing... I think the reason is because the boot can't detect the USB keyboard. Thanks again, Remi.
0 Kudos

1,179 Views
rlorriaux
Contributor I

You have to set the correct environment variables in U-Boot so that the kernel and rootfs are loaded from the SD Card. I have updated my post to reflect that.

0 Kudos

1,179 Views
JoaoPeixoto
Contributor I
Still with the same problem.
0 Kudos

1,179 Views
marshachang
NXP Employee
NXP Employee
So it works now? Or are you still having issues?
0 Kudos

1,179 Views
JoaoPeixoto
Contributor I
Hello Marsha,
Thanks for your reply :-).
I plug in the microSD card slot... In the SD card slot, the boot didn't work. I'm using a microSD with the same settings that the original microSD (Sandisk with 4Gb). I try format the microSD with different formats (fat, fat32, ext3) before the copy of u-boot and kernel (with dd command) and nothing.




Marsha Chang said:

Hello Joao, Are you placing the microSD card into the small microSD card slot, or are you plugging in the full sized SD card adapter with the microSD card inside? Just making sure as the i.MX53 Quick Start board boots from microSD.

0 Kudos

1,179 Views
marshachang
NXP Employee
NXP Employee

Hello Joao, Are you placing the microSD card into the small microSD card slot, or are you plugging in the full sized SD card adapter with the microSD card inside? Just making sure as the i.MX53 Quick Start board boots from microSD.

0 Kudos

1,179 Views
JoaoPeixoto
Contributor I

Hello,

I'm new in this area... and I've a "start" problem.

I try many times to flash a new SD Card (with default image and Custom image using LTIB) with differents sizes (1Gb, 4Gb and 8 Gb). I follow the flash_ltib.sh and the steps described in i.MX53_START_Linux_DemoImage_Readme.doc with no sucess... the problem occurs when I put the SD Card into QSB board and make boot. The error is the same:

*** Warning - bad CRC or MMC, using default environment

In:    serial                                                                  
Out:   serial                                                                  
Err:   serial                                                                  
Net:   got MAC address from IIM: 00:04:9f:01:aa:6d                             
FEC0 [PRIME]                                                                   
Hit any key to stop autoboot:  0                                               
FEC: enable RMII gasket                                                        
PHY indentify @ 0x0 = 0x0007c0f1                                               
*** ERROR: `serverip' not set                                                  
Wrong Image Format for bootm command                                           
ERROR: can't get kernel image!                                                 
MX53-LOCO U-Boot >

 

 

Thanks

0 Kudos