login o register
CALL NOW
+39 055 731 1387
Compare 0 Products     empty

Som Programming

Prepare the sdcard image

For onboard emmc wrting you can use some script files present on engicam-test-hw image.

First of all you need to create the sdcard imge.

Enter in to the yocto build directory (it depends on you 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 procedure you have to write you image on sdcard.

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 your sdcard image you need to include the recipe engicam-emmc-tools (availableinto the layer meta-engicam) to 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 followig 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 → <file>.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 followig 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 a 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

09 May 2018

Related Products