It is often not easy to use company network to flash application, due to network security (proxy, etc...). We will see in this tutorial, how to flash a Linux application in a SD card with ONLY a SD card reader and simple standard Linux commands.
A Linux application is divided in 3 parts:
We will flash sequentially these 3 parts
With the SD card Reader, we will flash the yellow part. In the [...]/ltib/rootfs/boot/ folder
$ sudo dd if=u-boot.bin of=/dev/sdb bs=512 skip=2 seek=2 && sudo sync
With the SD card reader, we will flash the green part. Keep in mind that 1MB=1048576B -> Kernel Offset.
$ sudo dd if=uImage of=/dev/sdb bs=1048576 seek=1 && sudo sync
To launch the Kernel, you need to configure U-boot.
115kbps, 8 bits, 1 stop and no parity
DS1 | DS2 | DS3 | DS4 | DS5 | DS5 | DS7 | DS8 | DS9 | DS10 | |
Boot from SD/MMC Card | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 |
BBG U-Boot > printenv
To print environnement variables
BBG U-Boot > setenv bootcmd_mmc 'run bootargs_base bootargs_mmc;mmc read 0 ${loadaddr} 0x800 0x1800;bootm'
"0x1800" is the size of the kernel. Must be bigger than uImage Kernel file (0x1800x512Byte=3MB)
Script for LTIB1007's u-boot on i.MX51 EVK (copy/paste in the hyperterminal):
setenv bootcmd_mmc 'run bootargs_base bootargs_mmc; mmc read 0 ${loadaddr} 800 1800 ; bootm' setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/mmcblk0p1 rootwait rw init=/init' setenv bootargs_base' setenv bootargs console=ttymxc0,115200 di1_primary console=tty1' setenv bootcmd 'run bootcmd_mmc' saveenv
Script for LTIB1007's u-boot on i.MX53 EVK (copy/paste in the hyperterminal):
setenv bootcmd_mmc 'run bootargs_base bootargs_mmc; mmc read 0 ${loadaddr} 800 1800 ; bootm' setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/mmcblk0p1 rootwait rw init=/init' setenv bootargs_base 'setenv bootargs console=ttymxc0,115200 di0_primary console=tty1' setenv bootcmd 'run bootcmd_mmc' saveenv
BBG U-Boot > printenv bootdelay=3 baudrate=115200 loadaddr=0x90800000 netdev=eth0 ethprime=FEC0 uboot_addr=0xa0000000 uboot=u-boot.bin kernel=uImage bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=${serveri p}:${nfsroot},v3,tcp bootcmd_net=run bootargs_base bootargs_nfs; tftpboot ${loadaddr} ${kernel}; boot m load_uboot=tftpboot ${loadaddr} ${uboot} ethact=FEC0 bootargs=console=ttymxc0,115200 di1_primary root=/dev/mmcblk0p1 rootwait rw init =/init bootcmd_mmc=run bootargs_base bootargs_mmc; mmc read 0 ${loadaddr} 800 1800 ; bo otm bootargs_mmc=setenv bootargs ${bootargs} root=/dev/mmcblk0p1 rootwait rw init=/i nit bootargs_base=setenv bootargs console=ttymxc0,115200 di1_primary bootcmd=run bootcmd_mmc stdin=serial stdout=serial stderr=serial</br> Environment size: 748/131068 bytes BBG U-Boot >
With the SD card reader, create an ext3 partition. You can use gparted, a graphical partition manager tool. Launch gparted:
$ sudo gparted
Create a new ext3 partition, with 20MB of offset:
To copy rootfs folder generated by LTIB, type in the shell:
$ sudo cp -r /[…]/ltib/rootfs/* /media/FreescaleSD/ && sudo sync
Put the SD in the slot slot and launch the application. Password is root.