Recently we bought the i.MX6Q-SDB board and I need to jump quickly to the application development. The board was supplied with bootable SD card with Android. I want to keep this SD and prepare another one based on Linux. After several hours of researching and studding many pdf documents I was frustrated that I don't see simple instruction how prepare such SD. So my questions are:
1) I see 2 possible BSP to work with: fsl-yocto-3.10.17_1.0.0 or L3.0.35_4.1.0. Which one is more suitable for rapid development?
2) Do I need to compile uImage & rootfs, or may I use the created binaries from L3.0.35_4.1.0_130816_images_MX6?
* I prefer to work on Windows + Cygwin
3) Can I boot the Linux image directly via TFTP loading from original "MX6Q SABRESD U-Boot >"?
4) I need the simple instruction how to burn uBoot + Linux from L3.0.35_4.1.0_130816_images_MX6 to new SD card.
Thanks in advance.
Sergey
Solved! Go to Solution.
I manged to get Linux image working, using the next :
$ sudo dd if=u-boot-imx6qsabresd_sd.imx of=/dev/sdb bs=512 seek=2 conv=fsync
$ sudo dd if=uImage_imx_v7_defconfig of=/dev/sdb bs=512 seek=2048 conv=fsync
$ sudo dd if=uImage-imx6q-sabresd.dtb of=/dev/sdb bs=512 seek=20480 conv=fsync
$ sudo fdisk /dev/sdb
The following are parameters for fdisk (each followed by <ENTER>):
u [switch the unit to sectors instead of cylinders]
d [repeat this until no partition is reported by the 'p' command ]
n [create a new partition]
p [create a primary partition]
1 [the first partition]
+20M [20MB, enough space for thekernel, the boot loader and its configuration data]
<enter> [using the default value will create a partition that spans to the last sector
of the medium]
w [ this writes the partition table to the medium and fdisk exits]
$ sudo mkfs.ext3 /dev/sdb1
$ mkdir /home/user/mountpoint
$ sudo mount /dev/sdb1 /home/user/mountpoint
$ sudo mount -o loop -t ext3 fsl-image-weston-imx6qdlsolo.ext3 /home/user/rootfs
$ cd /home/user/rootfs
$ sudo cp -a * /home/user/mountpoint
$ sudo umount /home/user/mountpoint
$ sudo umount /home/user/rootfs
Under U-boot after SD boot.
U-boot> setenv loadaddr 0x12000000
U-boot> setenv loadaddr 0x12000000
U-boot> setenv fdt_high 0xffffffff
U-boot> setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'
U-boot> setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/mmcblk0p1 rootwait rw video=mxcfb1:dev=ldb,LDB-XGA,if=RGB666'
U-boot> setenv bootcmd_mmc 'run bootargs_base bootargs_mmc;mmc dev 1;mmc read ${loadaddr} 0x800 0x3000;mmc read ${fdt_addr} 0x5000 0x800;bootm ${loadaddr} - ${fdt_addr}'
U-boot> setenv bootcmd 'run bootcmd_mmc'
Reset ....
Upon succeeding to load the Linux from SD card I need to run one of GStreamer tests. The suggested fsl-image-weston-imx6qdlsolo.ext3 contains GStreamer tools but, unfortunately, it doesn't contain gst-fsl-plugins (neither mfw_v4lsrc nor vpuenc).
Is it possible to download from somewhere the gst-fsl-plugins binaries? Or I need to compile it by myself? What is the correct place of binaries/sources to download in case I have fsl-yocto-3.10.17_1.0.0 kernel?
Hi,
I did exactly as it was explained. Have used dd tool on Linux PC to burn these 2 files:
u-boot-imx6qsabresd_sd.imx
uImage_imx_v7_defconfig
But when butting u-boot stops at the following lines:
------------------------------------------------
mmc1 is current device
** Unrecognized filesystem type **
** Unrecognized filesystem type **
Booting from net ...
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
Retry count exceeded; starting again
------------------------------------------------
Where have I mistaken?
It is needed to stop U-boot (just after initial boot) and configure U-boot
environment for required boot options. Please take a look at section 8.2
(Run the Image from MMC/SD) of "i.MX_6_SABRE-SD_Linux_User's_Guide.pdf"
[Yocto docs].
Have a great day,
Yuri
--------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
--------------------------------------------------------------------------------------------
Thanks, I already found this section 8.2, but after doing it I encountered a problem discussed here: https://community.freescale.com/thread/324033 (Bad Data CRC before kernel starts). I changed ${loadaddr} 0x800 0x2000 -> ${loadaddr} 0x800 0x3000 as it was suggested. And the kernel started to boot!!! But the second described problem of mmcblk0p2 / mmcblk0p1 still present. Changing it from 02 to 01 doesn't help:
...
input: gpio-keys.27 as /devices/soc0/gpio-keys.27/input/input6
snvs_rtc 20cc034.snvs-rtc-lp: setting system clock to 1970-01-01 00:33:38 UTC (2018)
ALSA device list:
#0: wm8962-audio
#1: imx-hdmi-soc
VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -6
Please append a correct "root=" boot option; here are the available partitions:
1f00 32 mtdblock0 (driver?)
b300 1931264 mmcblk0 driver: mmcblk
b308 7757824 mmcblk1 driver: mmcblk
b320 128 mmcblk1rpmb (driver?)
b318 2048 mmcblk1boot1 (driver?)
b310 2048 mmcblk1boot0 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2kernel)
Please help!!
Let me look at U-boot environment (U-boot command "pri")
U-Boot > pri
baudrate=115200
boot_fdt=try
bootargs_base=setenv bootargs console=ttymxc0,115200
bootargs_mmc=setenv bootargs ${bootargs} root=/dev/mmcblk0p2 rootwait rw video=mxcfb1:dev=ldb,LDB-XGA,if=RGB666 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24
bootcmd=run bootcmd_mmc
bootcmd_mfg=run mfgtool_args;bootm ${loadaddr} ${initrd_addr} ${fdt_addr};
bootcmd_mmc=run bootargs_base bootargs_mmc;mmc dev 1;mmc read ${loadaddr} 0x800 0x3000;mmc read ${fdt_addr} 0x5000 0x800;bootm ${loadaddr} - ${fdt_addr}
bootdelay=1
bootscript=echo Running bootscript from mmc ...; source
console=ttymxc0
ethact=FEC
ethaddr=00:04:9f:02:df:d2
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.idProduct=0x37FF g_mass_storage.iSerialNumber="" enable_wait_mode=off
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 test ${boot_fdt} = try; then bootm; else echo WARN: Cannot load the DT; fi; fi; else bootm; fi;
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_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootm ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootm; else echo WARN: Cannot load the DT; fi; fi; else bootm; fi;
script=boot.scr
uimage=uImage
Environment size: 2211/8188 bytes
Also, the most simple way :
$ sudo dd if=fsl-image-gui-imx6qsabresd.sdcard of=/dev/sdb bs=1M
Where the fsl-image-gui-imx6qsabresd.sdcard file may be found? I have only fsl-image-x11-imx6qdlsolo.sdcard (from L3.10.17_1.0.0_ga_140404_images_MX6.tar.gz)
The file "fsl-image-gui-imx6qsabresd.sdcard" has been mentioned just as an example.
~Yuri.
I manged to get Linux image working, using the next :
$ sudo dd if=u-boot-imx6qsabresd_sd.imx of=/dev/sdb bs=512 seek=2 conv=fsync
$ sudo dd if=uImage_imx_v7_defconfig of=/dev/sdb bs=512 seek=2048 conv=fsync
$ sudo dd if=uImage-imx6q-sabresd.dtb of=/dev/sdb bs=512 seek=20480 conv=fsync
$ sudo fdisk /dev/sdb
The following are parameters for fdisk (each followed by <ENTER>):
u [switch the unit to sectors instead of cylinders]
d [repeat this until no partition is reported by the 'p' command ]
n [create a new partition]
p [create a primary partition]
1 [the first partition]
+20M [20MB, enough space for thekernel, the boot loader and its configuration data]
<enter> [using the default value will create a partition that spans to the last sector
of the medium]
w [ this writes the partition table to the medium and fdisk exits]
$ sudo mkfs.ext3 /dev/sdb1
$ mkdir /home/user/mountpoint
$ sudo mount /dev/sdb1 /home/user/mountpoint
$ sudo mount -o loop -t ext3 fsl-image-weston-imx6qdlsolo.ext3 /home/user/rootfs
$ cd /home/user/rootfs
$ sudo cp -a * /home/user/mountpoint
$ sudo umount /home/user/mountpoint
$ sudo umount /home/user/rootfs
Under U-boot after SD boot.
U-boot> setenv loadaddr 0x12000000
U-boot> setenv loadaddr 0x12000000
U-boot> setenv fdt_high 0xffffffff
U-boot> setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'
U-boot> setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/mmcblk0p1 rootwait rw video=mxcfb1:dev=ldb,LDB-XGA,if=RGB666'
U-boot> setenv bootcmd_mmc 'run bootargs_base bootargs_mmc;mmc dev 1;mmc read ${loadaddr} 0x800 0x3000;mmc read ${fdt_addr} 0x5000 0x800;bootm ${loadaddr} - ${fdt_addr}'
U-boot> setenv bootcmd 'run bootcmd_mmc'
Reset ....
Yuri, many thanks! Now it works. I do not know where it was my mistake, but now it is loading. May be the problem was in fsl-image-fb-imx6qdlsolo.ext3 image, now I have used suggested fsl-image-weston-imx6qdlsolo.ext3
Strictly speaking neither Yocto nor LTIB packages are not intended for development.
They are intended for different configuration building. Nevertheless it is possible
to get kernel sources and configure, say, Eclipse configuration for applications design
for both approaches. It makes sense to use Yocto, since LTIB will not used more for
new releases.
As for boot SD preparing, please refer to section 7 (Using a Linux Host to Set Up
an SD/MMC Card) of of “i.MX_6_SABRE-SD_Linux_User's_Guide.pdf” in
fsl-yocto-3.10.17_1.0.0 documentation. Of course You may use kernel, U-boot and rootFS
from demo images.
TFTP may be used, as shown in section 6 (Download Images by Bootloader or NFS).
Have a great day,
Yuri
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Yuri, thanks for your explanation. But still wonder is it possible to use cfimager (cfimager-imx.exe) on Windows to burn bootable SD containing uBoot with Linux?
cfimager was not tested with i.MX6