Custom machine to Colibri iMX6S - newbie

Hey there,

I’m new to toradex and yocto project, and after reading and searching the internet and watching toradex webinars, I thought I was ready to start my work.

First of all, I cloned the toradex bsp platform using the LinuxImageV2.8 branch, and I set the machine to (MACHINE ?= “colibri-imx6”) by editing the local.conf file and built using the bitbake console-tdx-image command.

So after a few hours, the compilation was finished and I copy the resulting image to a USB flash drive using the “update.sh” script and tested it on my Colibri iMX6S card, and everything is working fine.

After that I try to create a custom machine configuration. (Followed the “Webinar On-Demand: Part 2 (Advanced) - Building Embedded Linux Images with the Yocto Project” Webinar on youtube).

The new machine configuration is named: colibri-imx6-df63ng

To create my custom machine, I had a look at the “meta-toradex-nxp” layer dir and I found only the “colibri-imx6ull.conf”, and a include dir that contains the “colibri-imx6.inc”.

I try using those files by copying the “colibri-imx6ull.conf” file to “colibri-imx6-df63ng.conf” and “colibri-imx6.inc” to “colibri-imx6-df63ng.inc” and changed the local.conf file to use my machine by inserting the line MACHINE ?= “colibri-imx6-df63ng”. So now when I try to build using bitbake console-tdx-image, I got errors.

Doing much more internet searches I found a configuration to “Colibri iMX6” and I tried it and the build works like a charm, but the “update.sh” script failed with no img file again. I looked at the generated image tar file and there was an “u-boot.imx” file but no “u-boot.img” file.

Than I put the parameter “UBOOT_SUFFIX = “img”” to my machine configuration file and now I’m getting the error below:

 1. ERROR: console-tdx-image-2.8b4-r0 do_rootfs: Unable to install packages. Command '/home/vbalestero/df63ng/oe-core-tdx/build/tmp-glibc/work/colibri_imx6_df63ng-angstrom-linux-gnueabi/console-tdx-image/2.8b4-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /home/vbalestero/df63ng/oe-core-tdx/build/tmp-glibc/work/colibri_imx6_df63ng-angstrom-linux-gnueabi/console-tdx-image/2.8b4-r0/opkg.conf -t /home/vbalestero/df63ng/oe-core-tdx/build/tmp-glibc/work/colibri_imx6_df63ng-angstrom-linux-gnueabi/console-tdx-image/2.8b4-r0/temp/ipktemp/ -o /home/vbalestero/df63ng/oe-core-tdx/build/tmp-glibc/work/colibri_imx6_df63ng-angstrom-linux-gnueabi/console-tdx-image/2.8b4-r0/DF63NG_Console-Image_2.8.4/rootfs  --force_postinstall --prefer-arch-to-version   install locale-base-en-us' returned 255:

    Collected errors: 
    opkg_prepare_url_for_install: Couldn't find anything to satisfy 'locale-base-en-us'. 

 2. ERROR: console-tdx-image-2.8b4-r0 do_rootfs: Function failed: do_rootfs
 3. ERROR: Logfile of failure stored in: /home/vbalestero/df63ng/oe-core-tdx/build/tmp-glibc/work/colibri_imx6_df63ng-angstrom-linux-gnueabi/console-tdx-image/2.8b4-r0/temp/log.do_rootfs.8540
 4. ERROR: Task (/home/vbalestero/df63ng/oe-core-tdx/build/../layers/meta-smar-df63ng/recipes-images/images/console-tdx-image.bb:do_rootfs) failed with exit code '1'

So my questions are:

what machine configuration is used when compiling a console-tdx-image using the default machine “colibri-imx6” ?

What machine configuration I can use to make my own machine to work on my Colibri iMX6S ?

Below is my layer structure and configuration files to my machine:

 1. met-smar-df63ng
 2. ├── conf
 3. │   ├── layer.conf
 4. │   └── machine
 5. │       └── colibri-imx6-df63ng.conf
 6. ├── recipes-images
 7. │   └── images
 8. │       ├── console-tdx-image.bb
 9. │       ├── files
 10. │       │   └── colibri-imx6-df63ng
 11. │       │       ├── colibri-imx6-df63ng_bin -> ../../../../../meta-toradex-demos/recipes-images/images/files/colibri-imx6/colibri-imx6_bin
 12. │       │       ├── imx_flash -> ../../../../../meta-toradex-demos/recipes-images/images/files/colibri-imx6/imx_flash
 13. │       │       └── update.sh
 14. │       └── tdx-image-fstype.inc
 15. └── recipes-kernel
 16.     └── linux
 17.         ├── linux-toradex-rt-4.9-1.0.x
 18.         │   ├── 0001-spi-changed-microchip-mcp25xx-status-for-DF63-NG.patch
 19.         │   └── colibri-imx6-df63ng
 20.         │       └── defconfig
 21.         └── linux-toradex-rt_4.9-1.0.x.bbappend

meta-smar-df63ng/conf/layer.conf:

 1. \# We have a conf and classes directory, append to BBPATH
 2. BBPATH .= ":${LAYERDIR}"
 3. 
 4. \# We have recipes-* directories, add to BBFILES
 5. BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
 6. 
 7. BBFILE_COLLECTIONS += "smar-df63ng-layer"
 8. BBFILE_PATTERN_smar-df63ng-layer = "^${LAYERDIR}/"
 9. BBFILE_PRIORITY_smar-df63-layer = "96"
 10. 
 11. \# Let us add layer-specific bbappends which are only applied when that
 12. \# layer is included in our configuration
 13. BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bbappend' % layer \
 14. ...............for layer in BBFILE_COLLECTIONS.split())}"
 15. \# Add layer-specific bb files too
 16. BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bb' % layer \
 17. ...............for layer in BBFILE_COLLECTIONS.split())}"
 18. 
 19. LAYERDEPENDS_smar-df63ng-layer = " \
 20. ....core \
 21. ....freescale-layer \
 22. ....fsl-arm-extra \
 23. ....toradex-bsp-common-layer \
 24. ....toradex-nxp-layer \
 25. "

meta-smar-df63ng/conf/machine/colibri-imx6-df63ng.conf:

 1. \#@TYPE: Machine
 2. \#@NAME: Toradex Colibri iMX6DL/S
 3. \#@SOC: i.MX6DL
 4. \#@DESCRIPTION: Machine configuration for Toradex Colibri iMX6 SOM
 5. \#@MAINTAINER: Max Krummenacher 
 6. 
 7. MACHINEOVERRIDES =. "mx6:mx6dl:"
 8. 
 9. include conf/machine/include/imx-base.inc
 10. include conf/machine/include/tune-cortexa9.inc
 11. 
 12. PREFERRED_PROVIDER_virtual/kernel ??= "linux-toradex-rt"
 13. KERNEL_DEVICETREE += "imx6dl-colibri-eval-v3.dtb imx6dl-colibri-cam-eval-v3.dtb imx6dl-colibri-aster.dtb"
 15. \#KERNEL_DEVICETREE_use-mainline-bsp += "imx6dl-colibri-eval-v3.dtb"
 16. KERNEL_IMAGETYPE = "zImage"
 17. \# The kernel lives in a seperate FAT partition, don't deploy it in /boot/
 18. RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
 19. 
 20. PREFERRED_PROVIDER_u-boot ?= "u-boot-toradex"
 21. PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-toradex"
 22. SPL_BINARY = "SPL"
 23. \# The SPL configures the DDR RAM depending on the module it runs on. Thus there
 24. \# is no need to distingush between the different module types.
 25. \# For recovery mode we build a U-Boot with save timings for all known Apalis iMX6
 26. \# Note: The last config will be symlinked to U_BOOT_BINARY which is crucial for
 27. \# certain image formats.
 28. UBOOT_CONFIG ??= "spl"
 29. \UBOOT_CONFIG[spl] = "colibri_imx6_defconfig,,u-boot.img"
 30. \UBOOT_MAKE_TARGET = ""
 31. 
 32. IMAGE_FSTYPES += "tar.xz"
 33. \# wic support
 34. WKS_FILE = "sdimage-bootpart.wks"
 35. 
 36. SERIAL_CONSOLE ?= "115200 ttymxc0"
 37. 
 38. TORADEX_PRODUCT_IDS = "0014 0015 0016 0017"
 39. 
 40. MACHINE_FEATURES += "screen usbgadget usbhost vfat ext2 alsa touchscreen wifi bluetooth 3g"

recipes-images\images\console-tdx-image.bb:

 1. SUMMARY = "Toradex Embedded Linux Console Demo"
 2. SUMMARY_append_apalis-tk1-mainline = " (Mainline)"
 3. 
 4. LICENSE = "MIT"
 5. 
 6. \#start of the resulting deployable tarball name
 7. export IMAGE_BASENAME = "Console-Image"
 8. IMAGE_NAME_apalis-imx6 = "Apalis-iMX6_${IMAGE_BASENAME}"
 9. IMAGE_NAME_apalis-t30 = "Apalis-T30_${IMAGE_BASENAME}"
 10. IMAGE_NAME_apalis-tk1 = "Apalis-TK1_${IMAGE_BASENAME}"
 11. IMAGE_NAME_apalis-tk1-mainline = "Apalis-TK1-Mainline_${IMAGE_BASENAME}"
 12. IMAGE_NAME_colibri-imx6 = "Colibri-iMX6_${IMAGE_BASENAME}"
 13. ` IMAGE_NAME_colibri-imx6-df63ng = "DF63NG_${IMAGE_BASENAME}" `
 14. IMAGE_NAME_colibri-imx6ull = "Colibri-iMX6ULL_${IMAGE_BASENAME}"
 15. IMAGE_NAME_colibri-imx7 = "Colibri-iMX7_${IMAGE_BASENAME}"
 16. IMAGE_NAME_colibri-imx7-emmc = "Colibri-iMX7-eMMC_${IMAGE_BASENAME}"
 17. IMAGE_NAME_colibri-pxa = "Colibri-PXA_${IMAGE_BASENAME}"
 18. IMAGE_NAME_colibri-t20 = "Colibri-T20_${IMAGE_BASENAME}"
 19. IMAGE_NAME_colibri-t30 = "Colibri-T30_${IMAGE_BASENAME}"
 20. IMAGE_NAME_colibri-vf = "Colibri-VF_${IMAGE_BASENAME}"
 21. IMAGE_NAME = "${MACHINE}_${IMAGE_BASENAME}"
 22. 
 23. SYSTEMD_DEFAULT_TARGET = "graphical.target"
 24. 
 25. \#create the deployment directory-tree
 26. require recipes-images/images/tdx-image-fstype.inc
 27. 
 28. IMAGE_LINGUAS = "en-us"
 29. \#IMAGE_LINGUAS = "de-de fr-fr en-gb en-us pt-br es-es kn-in ml-in ta-in"
 30. \#ROOTFS_POSTPROCESS_COMMAND += 'install_linguas; '
 31. 
 32. DISTRO_UPDATE_ALTERNATIVES ??= ""
 33. ROOTFS_PKGMANAGE_PKGS ?= '${@oe.utils.conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "${ROOTFS_PKGMANAGE} ${DISTRO_UPDATE_ALTERNATIVES}", d)}'
 34. 
 35. CONMANPKGS ?= "connman connman-plugin-loopback connman-plugin-ethernet connman-plugin-wifi connman-client"
 36. 
 37. \#don't install some id databases
 38. \#BAD_RECOMMENDATIONS_append_colibri-vf += " udev-hwdb cpufrequtils "
 39. 
 40. \#deploy the X server for the tegras
 41. \#this adds a few MB to the image, but all graphical HW acceleration is
 42. \#available only on top of X, this is not required for nouveau based build.
 43. \#IMAGE_INSTALL_append_tegra = " ${XSERVER} xterm xclock"
 44. \#IMAGE_INSTALL_append_tegra124 = " ${XSERVER} xterm xclock"
 45. 
 46. ` DF63NG_PKGS = "sthttpd" `
 47. 
 48. IMAGE_INSTALL += " \
 49. `....${DF63NG_PKGS} \ `
 50. ....angstrom-packagegroup-boot \
 51. ....packagegroup-basic \
 52. ....udev-extra-rules \
 53. ....${CONMANPKGS} \
 54. ....${ROOTFS_PKGMANAGE_PKGS} \
 55. ....timestamp-service \
 56. ....packagegroup-base-extended \
 57. "
 58. 
 59. require recipes-images/images/tdx-extra.inc
 60. 
 61. IMAGE_DEV_MANAGER   = "udev"
 62. IMAGE_INIT_MANAGER  = "systemd"
 63. IMAGE_INITSCRIPTS   = " "
 64. IMAGE_LOGIN_MANAGER = "busybox shadow"
 65. 
 66. inherit core-image

recipes-images\images\tdx-image-fstype.inc:

 1. \#create the deployment directory-tree
 2. 
 3. include conf/tdx_version.conf
 4. 
 5. PV = "${TDX_VER_PACKAGE_MIN}"
 6. BURNFLASH := "${THISDIR}/files/${MACHINE}"
 7. IMAGE_DIR = "${IMAGE_NAME}_${TDX_VER_ITEM}"
 8. IMAGE_ROOTFS = "${WORKDIR}/${IMAGE_DIR}/rootfs"
 9. 
 10. UBOOT_EXT = "bin"
 11. UBOOT_EXT_mx6 = "img"
 12. UBOOT_EXT_colibri-imx6ull = "imx"
 13. ` UBOOT_EXT_colibri-imx6-df63ng = "imx" `
 14. UBOOT_EXT_mx7 = "imx"
 15. UBOOT_EXT_vf = "imx"
 16. UBOOT_SYMLINK = "u-boot-${MACHINE}.${UBOOT_EXT}"
 17. UBOOT_SYMLINK_tegra = "u-boot-dtb-tegra-${MACHINE}.${UBOOT_EXT}"
 18. UBOOT_SYMLINK_tegra124 = "u-boot-dtb-tegra-${MACHINE}.${UBOOT_EXT}"
 19. UBOOT_SYMLINK_tegra124m = "u-boot-dtb-tegra-${MACHINE}.${UBOOT_EXT}"
 20. UBOOT_BINARY = "u-boot.${UBOOT_EXT}"
 21. UBOOT_BINARY_colibri-imx7 = "u-boot-nand.${UBOOT_EXT}"
 22. UBOOT_BINARY_colibri-imx6ull = "u-boot-nand.${UBOOT_EXT}"
 23. UBOOT_BINARY_tegra = "u-boot-dtb-tegra.${UBOOT_EXT}"
 24. UBOOT_BINARY_tegra124 = "u-boot-dtb-tegra.${UBOOT_EXT}"
 25. UBOOT_BINARY_tegra124m = "u-boot-dtb-tegra.${UBOOT_EXT}"

Hi

Note that the MACHINE name is, among other things, used to find the file <MACHINE>.conf file. In the case of the colibri-imx6 machine we unstreamed that into meta-freescale-3rdparty/conf/machine/colibri-imx6.conf. By some magic the meta-toradex-nxp/conf/machine/colibri-imx6.inc is included at the end colibri-imx6.conf.

So could you try again and use

cat meta-freescale-3rdparty/conf/machine/colibri-imx6.conf meta-toradex-nxp/conf/machine/colibri-imx6.inc > colibri-imx6-df63ng.conf

as the base of your own machine file.

I guess that the failure

 Collected errors: 
 opkg_prepare_url_for_install: Couldn't find anything to satisfy 'locale-base-en-us'.

is caused by changing your machine to first be an i.MX 6ULL and then i.MX6. That probably confused the package generation. I would delete all buildoutput, i.e. rm -rf build/tmp-glibc and then restart the build which will use a lot of stuff out of sstate and should be quite fast. If that does not help I would also delete both sstate and buildoutput, i.e. rm -rf build/tmp-glibc build/sstate-cache.

Max

Hi max.tx,
I tried your tips and its works very good.
Thank you very much.