SOM Programming
Prepare the SD card image
For onboard emmc writing you can use some script files present on engicam-test-hw image.
First of all, you need to create the SD card image.
Enter into the yocto build directory (it depends on your installation type)
example:
/home/user/yocto/fsl-community-bsp
(the path depends on you yocto version)
Then run the command of the configuration environment:
MACHINE=<machine target> source engicam-setup-environment <target build direcotry>
example:
MACHINE=icoremx6quad . engicam-setup-environment quad/
the build the image
bitbake engicam-test-hw
At the end of the procedure, you have to write your image on SD card.
cd tmp/deploy/images/icoremx6quad/
sudo dd if=engicam-demo-qt-<machine target>.sdcard of=/dev/sd<X> bs=10M && sync
where <X> is the device index
eMMC Programming
To create images booting from eMMC you need to modify your local.conf and change the UBOOT_CONFIG as follows
UBOOT_CONFIG="emmc"
Remember to set UBOOT_CONFIG="emmc"
Choose the file with the emmc word in the name. ex. uImage-imx6ul-gea-emmc.dtb
It's possible to program the eMMC by SD card scripts To enable these scripts in the sd card image you need to include the recipe engicam-emmc-tools (available into the layer meta-engicam) in your image
To enable the EMMC from Linux you need to load a specific device tree. Change the fdt_file in the u-boot console as follows
fdt_file=imx6ul-gea-emmc.dtb
Run the system from SD card. You can choose to program your eMMC via TFTP or via USB
Programming via TFTP
Once an image was compiled, into the target folder choice following files will be available:
/tmp/deploy/images/<machine target>/engicam-demo-qt-<machine target>.tar.bz2
/tmp/deploy/images/<machine target>/u-boot.imx[1]
/tmp/deploy/images/<machine target>/uImage-<machine target>.bin
/tmp/deploy/images/<machine target>/uImage-<file>.dtb[2]
The files will be copied into the virtual machine in the directory "tftpboot". Copy the files in the directory and rename them as follows:
• engicam-demo-qt-<machine target>.tar.bz2 → rootfs.tar.bz2
• uImage-<machine target>.bin → uImage
• uImage-<file>.dtb → <file>.dtb
• u-boot.imx → u-boot.imx
Now it's possible to use the following scripts to program the eMMC:
emmc_boot_tftp.sh : write the u-boot. Require u-boot.imx in the tftpboot directory
emmc_fs_tftp.sh : write the root filesystem. Require rootfs.tar.bz2 in the tftpboot directory
emmc_ker_tftp.sh : write the kernel. Require uImage in the tftpboot directory
emmc_dtb_tftp.sh : write the device tree. Require a dtb file in the tftpboot directory
emmc_ker_dtb_tftp.sh : write the kernel and the device tree.
emmc_fs_ker_dtb_tftp.sh : write the kernel, the device tree and the root filesystem.
For the usage and parameters run the script with the parameter -h
Programming via USB
Once an image was compiled, into the target folder choice following files will be available:
/tmp/deploy/images/<machine target>/engicam-demo-qt-<machine target>.tar.bz2
/tmp/deploy/images/<machine target>/engicam-demo-qt-<machine target>.sdcard
/tmp/deploy/images/<machine target>/u-boot.imx (1)
/tmp/deploy/images/<machine target>/uImage-<machine target>.bin
/tmp/deploy/images/<machine target>/uImage-<file>.dtb (2)
The files will be copied and renamed into an USB drive as follows:
engicam-demo-qt-<machine target>.tar.bz2 → rootfs.tar.bz2
engicam-demo-qt-<machine target>.sdcard → engicam-demo-qt.sdcard
uImage-<machine target>.bin → uImage
uImage-<file>.dtb → uImage.dtb
u-boot.imx → u-boot.imx
Insert the usb drive in your board and mount it:
mount /dev/sda1 /mnt
Now it's possible to use the following scripts to program the eMMC:
emmc_boot.sh : write the u-boot. Require u-boot.imx in the usb drive
emmc_fs.sh : write the root filesystem. Require rootfs.tar.bz2 in the usb drive
emmc_ker.sh : write the kernel. Require uImage in the usb drive
emmc_dtb.sh : write the device tree. Require a dtb file in the usb drive
emmc_ker_dtb.sh : write the kernel and the device tree. The required files are the union of (i)(j)
emmc_fs_ker_dtb.sh : write the kernel, the device tree and the root filesystem. The required files are the union of (h)(i)(j)
emmc_sdcard.sh : write the entire emmc. Require an sdcard image in the usb drive
For the usage and parameters run the script with the parameter -h
NAND programming by Linux TFTP
There is the possibility to program the module using TFTP, passing by the SD card (it's not possible to program the NAND during its use). The virtual machine already includes an FTP server installed and ready to use. Copy the programming file inside the TFTP folder:
cp tmp/deploy/images/ <machine target> /engicam-demo-qt- <machine target> .tar.bz2 /tftpboot/rootfs.tar.bz2
cp tmp/deploy/images/ <machine target> /uImage /tftpboot/
cp tmp/deploy/images/ <machine target> / uImage-<file>.dtb /tftpboot/uImage.dtb
cp tmp/deploy/images/ <machine target> /u-boot.imx /tftpboot
Now it's possible to use the following script to program the following elements:
export serverip=192.168.xxx.xxx
tftp_boot.sh
tftp_kernel.sh
tftp_fs.sh
For the usage and parameters run the script with the parameter -h