Yocto image using mfgtool.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Yocto image using mfgtool.

7,265 次查看
rohitreddy
Contributor I

Hi,

This is Rohit, I am trying to get yocto wokring on a ARM Board (EMB-3500 iMX6).

The board doesn't support booting from Memory card. So we use the mfgtools to flash the image to on board Nand. We have Ubuntu Image which works with no issue.

The Ubuntu Image has 3 files,

1. rootfs.tar.bz2

2. u-boot.bin

3. uImage

I have build a Yocto iMX6qSabreauto core-image-full-cmdline image, copied the "core-image-full-cmdline-imx6qsabreauto.tar.bz2" and "uImage-imx6qsabreauto.bin" in place of "rootfs.tar.bz2" and "uImage"

Tried to flash the image to Nand, it fails to boot. I get following error,

MMC read: dev # 3, block # 2048, count 8192 ... 8192 blocks read: OK

## Booting kernel from Legacy Image at 10800000 ...

   Image Name:   Linux-3.10.17-1.0.0_ga+g232293e

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    5264120 Bytes =  5 MB

   Load Address: 10008000

   Entry Point:  10008000

   Verifying Checksum ... Bad Data CRC

ERROR: can't get kernel image!

I have tried to use the working kernel (Ubuntu - uImage). The kernel loads, but the board turns off automatically. I get following message before it turn off,

EXT3-fs: barriers not enabled

kjournald starting.  Commit interval 5 seconds

EXT3-fs (mmcblk0p1): using internal journal

EXT3-fs (mmcblk0p1): recovery complete

EXT3-fs (mmcblk0p1): mounted filesystem with writeback data mode

VFS: Mounted root (ext3 filesystem) on device 179:1.

Freeing init memory: 212K

Any help in fixing this issue is really appreciated.

Thanks,

Rohit

标签 (4)
0 项奖励
回复
4 回复数

1,913 次查看
yahuicao
Contributor III

Hi Rohit:

        Ubuntu and Yocto configuration differ in several places mentioned below:   

  • the Ubuntu parameter and Yocto parameter in U-boot is different, and you'd better burn the  u-boot image provided by the Yocto into iNAND when booting Yocto using the MFGTool.
  • the Ubuntu partition map is different from Yocto.

      When booting the Ubuntu, u-boot image is located starting from the 1KB address of SD Card, and uImage is located starting from 1MB address of SD Card, and filesystem is located in the first partition, whose type is ext.

      When booting the Yocto,  u-boot image is located starting from the 1KB address of SD Card, while uImage is stored in the first partition, whose type is FAT and filesystem is located in the second partition, whose type is ext.

I print the Yocto's u-boot parameter:

baudrate=115200

boot_fdt=try

bootcmd=mmc dev ${mmcdev};if mmc rescan; then if run loadbootscript; then run bootscript; else if run loaduimage; then run mmcboot; else run netboot; fi; fi; else run ni

bootcmd_mfg=run mfgtool_args;bootm ${loadaddr} ${initrd_addr} ${fdt_addr};

bootdelay=1

bootscript=echo Running bootscript from mmc ...; source

console=ttymxc0

ethact=FEC

ethaddr=00:04:9f:02:19:3c

ethprime=FEC

fdt_addr=0x18000000

fdt_file=imx6q-sabresd.dtb

fdt_high=0xffffffff

initrd_addr=0x12C00000

initrd_high=0xffffffff

ip_dyn=yes

loadaddr=0x12000000

loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};

loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}

loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}

mfgtool_args=setenv bootargs console=ttymxc0,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.idVendor=0x066F g_mass_storage.idPr

mmcargs=setenv bootargs console=${console},${baudrate} ${smp} root=${mmcroot}

mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootm ${loadaddr} - ${fdt_addr}; else if ;

mmcdev=1

mmcpart=1

mmcroot=/dev/mmcblk0p2 rootwait rw

netargs=setenv bootargs console=${console},${baudrate} ${smp} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp

netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${uimage}; if test ${boot_fd;

script=boot.scr

uimage=uImage

So in order to boot the yocto into the iNAND, here is the referenced partition table :

partition 1            FAT                (store the uImage and .dtb file)

partition 2            ext                  (store the filesystem)

you need manually create the first (FAT)partition and second(ext) partition, store the corresponding file into the partition.

if you wish to burn the Yocto into the iNAND using the MFGTool, I suggest that you need to modify the configuration in the MFGTool.

in <mfgtool dir>/Profiles/MX6Q Linux Update/OS Firmware/ucl2.xml

take the Sabre-SD for example.

<LIST name="Sabre-SD" desc="Choose SD as media">

  <CMD state="BootStrap" type="boot" body="BootStrap" file ="u-boot-mx6q-sabresd.bin" >Loading U-boot</CMD>

  <CMD state="BootStrap" type="load" file="uImage" address="0x10800000"

  loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Loading Kernel.</CMD>

  <CMD state="BootStrap" type="load" file="initramfs.cpio.gz.uboot" address="0x10C00000"

  loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Loading Initramfs.</CMD>

  <CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>

  <!-- -->

  <CMD state="Updater" type="push" body="mknod block,mmcblk1,/dev/mmcblk1,block"/>

  <CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>

  <CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>

  <CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk1"> Partitioning...</CMD>

  <CMD state="Updater" type="push" body="mknod block/mmcblk1,mmcblk1p1,/dev/mmcblk1p1,block"/>

  <CMD state="Updater" type="push" body="send" file="files/u-boot-mx6q-sabresd.bin">Sending u-boot.bin</CMD>

  <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 skip=1 conv=fsync">write u-boot.bin to sd card</CMD>

  <CMD state="Updater" type="push" body="send" file="files/uImage">Sending kernel uImage</CMD>

  <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk1 bs=1M seek=1 conv=fsync">write kernel image to sd card</CMD>

  <CMD state="Updater" type="push" body="$ mkfs.ext3 -j /dev/mmcblk1p1">Formatting rootfs partition</CMD>

  <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk1p1"/>

  <CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk1p1 /mnt/mmcblk1p1"/>

  <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblk1p1" file="files/rootfs.tar.bz2">Sending and writting rootfs</CMD>

  <CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>

  <CMD state="Updater" type="push" body="$ umount /mnt/mmcblk1p1">Unmounting rootfs partition</CMD>

  <CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

</LIST>

you need to modify the xml script to do the following thing:

1. dd the u-boot image into the iNAND

2. create the first (FAT)partition and second(ext) partition, store the uImage and .dtb file into the FAT partition, store the filesystem files into the ext2 parition.

Before the MFGTool support the Yocto officially, this is gone be a little bit compliated for the beginners.

0 项奖励
回复

1,913 次查看
rohitreddy
Contributor I

Thanks yahuicao for the reply.

I have creating 2 Partitions on the On board NAND FAT and EXT.

I have copied the u-boot-imx6qsabreauto.imx, uImage--3.10.17-r0-imx6qsabreauto-20140606174532.bin and  core-image-full-cmdline-imx6qsabreauto-20140606174532.rootfs.tar.bz2 to files directory, changed the ucl2.xml accordingly and tried to burn the Image. It wont boot into u-boot also.

I want make sure if I am using the right files.

I have build a uboot for nand (UBOOT_CONFIG=“nand” but still not able to boot.

0 项奖励
回复

1,913 次查看
yahuicao
Contributor III

Well, you just mentioned you have created 2 partitions on the board? So you manually created the parations instead of MFGTool?

and could you attach your ucl2.xml and the burning log of the MFGTool? I can check it.


Just Now, I checked the freescale website and I found the MFGTool for the 3.10.17 has been released, and it supported the Yocto.

I think it will be your answer. :-)


i.MX 6Family Manufacturing Toolkit for L3.10.17

0 项奖励
回复

1,913 次查看
rohitreddy
Contributor I

Yahui,

I have downloaded the MFGTool for the 3.10.17 and selected "eMMC" tried to burn the image.

Nothing shows up on the serial. So we used the old uImage, u-boot-mx6q-sabresd.bin and initramfs.cpio.gz.uboot. Again we are getting the same error

NET: Registered protocol family 26

TCP cubic registered

NET: Registered protocol family 17

can: controller area network core (rev 20090105 abi 8)

NET: Registered protocol family 29

can: raw protocol (rev 20090105)

hub 2-1:1.0: USB hub found

hub 2-1:1.0: 7 ports detected

can: broadcast manager protocol (rev 20090105 t)

Bluetooth: RFCOMM TTY layer initialized

Bluetooth: RFCOMM socket layer initialized

Bluetooth: RFCOMM ver 1.11

Bluetooth: BNEP (Ethernet Emulation) ver 1.3

Bluetooth: BNEP filters: protocol multicast

Bluetooth: HIDP (Human Interface Emulation) ver 1.2

lib80211: common routines for IEEE802.11 drivers

VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4

Bus freq driver module loaded

Bus freq driver Enabled

mxc_dvfs_core_probe

DVFS driver module loaded

rtc-rx8025 1-0032: setting system clock to 1970-01-02 01:38:01 UTC (92281)

EXT3-fs: barriers not enabled

kjournald starting.  Commit interval 5 seconds

EXT3-fs (mmcblk0p1): using internal journal

EXT3-fs (mmcblk0p1): recovery complete

EXT3-fs (mmcblk0p1): mounted filesystem with writeback data mode

VFS: Mounted root (ext3 filesystem) on device 179:1.

Freeing init memory: 212K

0 项奖励
回复