Variscite DART-6UL: U-boot integration succeeds with Yocto Sumo, but fails with Thud

Hello,

I would like to evaluate Mender on a small batch of our Variscite DART-6UL SoMs. I have successfully built a system image based on Yocto v2.5 Sumo, but I run into compilation errors with Yocto v2.6 Thud.

I have followed the corresponding integration guide on the Mender Hub, with some small changes described below:

  • “BRANCH” environment variable is set to “thud”
  • “MEDIA” environment variable is set to “emmc”
  • Using fslc-framebuffer distro instead of fslc-x11.

Using these settings (and vanilla bblayers), bitbake runs into an error at the compilation of U-boot. The log output (attached below) is very long, but I have witnessed the following lines inside:

error CONFIG_BOOTCOUNT_ENV is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-

The full log output is the following:

DEBUG: Executing shell function do_compile
NOTE: make -j 8 CROSS_COMPILE=arm-fslc-linux-gnueabi- CC=arm-fslc-linux-gnueabi-gcc  --sysroot=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot V=1 HOSTCC=gcc  -isystem/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/miklosj/thudtest/mender-variscite/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 PYTHON=nativepython STAGING_INCDIR=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/include STAGING_LIBDIR=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -C /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git O=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/build/mx6ul_var_dart_nand_defconfig mx6ul_var_dart_nand_defconfig
make: Entering directory '/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git'
make -C /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/build/mx6ul_var_dart_nand_defconfig KBUILD_SRC=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git \
-f /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/Makefile mx6ul_var_dart_nand_defconfig
make[1]: Entering directory '/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/build/mx6ul_var_dart_nand_defconfig'
make -f /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/Makefile.build obj=scripts/basic
ln -fsn /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git source
/bin/bash /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/mkmakefile \
    /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git . 2018 03
  GEN     ./Makefile
  gcc  -isystem/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/miklosj/thudtest/mender-variscite/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 -Wp,-MD,scripts/basic/.fixdep.d -Iscripts/basic -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/basic/fixdep /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/basic/fixdep.c  
rm -f .tmp_quiet_recordmcount
make -f /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/Makefile.build obj=scripts/kconfig mx6ul_var_dart_nand_defconfig
  cat /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/kconfig/zconf.hash.c_shipped > scripts/kconfig/zconf.hash.c
  cat /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/kconfig/zconf.lex.c_shipped > scripts/kconfig/zconf.lex.c
  cat /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/kconfig/zconf.tab.c_shipped > scripts/kconfig/zconf.tab.c
  gcc  -isystem/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/miklosj/thudtest/mender-variscite/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 -Wp,-MD,scripts/kconfig/.conf.o.d -Iscripts/kconfig -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer   -I/usr/include/ncursesw -DCURSES_LOC="<curses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE -c -o scripts/kconfig/conf.o /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/kconfig/conf.c
  gcc  -isystem/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/miklosj/thudtest/mender-variscite/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 -Wp,-MD,scripts/kconfig/.zconf.tab.o.d -Iscripts/kconfig -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer   -I/usr/include/ncursesw -DCURSES_LOC="<curses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/kconfig -Iscripts/kconfig -c -o scripts/kconfig/zconf.tab.o scripts/kconfig/zconf.tab.c
  gcc  -isystem/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/miklosj/thudtest/mender-variscite/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2  -o scripts/kconfig/conf scripts/kconfig/conf.o scripts/kconfig/zconf.tab.o  
scripts/kconfig/conf  --defconfig=arch/../configs/mx6ul_var_dart_nand_defconfig Kconfig
#
# configuration written to .config
#
make[1]: Leaving directory '/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/build/mx6ul_var_dart_nand_defconfig'
make: Leaving directory '/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git'
NOTE: make -j 8 CROSS_COMPILE=arm-fslc-linux-gnueabi- CC=arm-fslc-linux-gnueabi-gcc  --sysroot=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot V=1 HOSTCC=gcc  -isystem/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -L/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/miklosj/thudtest/mender-variscite/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 PYTHON=nativepython STAGING_INCDIR=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/include STAGING_LIBDIR=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/lib -C /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git O=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/build/mx6ul_var_dart_nand_defconfig
make: Entering directory '/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git'
make -C /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/build/mx6ul_var_dart_nand_defconfig KBUILD_SRC=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git \
-f /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/Makefile 
make[1]: Entering directory '/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/build/mx6ul_var_dart_nand_defconfig'
make -f /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/Makefile silentoldconfig
make -f /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/Makefile.build obj=scripts/basic
ln -fsn /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git source
/bin/bash /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/mkmakefile \
    /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git . 2018 03
rm -f .tmp_quiet_recordmcount
  GEN     ./Makefile
make -f /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/Makefile.build obj=scripts/kconfig silentoldconfig
mkdir -p include/config include/generated
test -e include/generated/autoksyms.h || \
    touch   include/generated/autoksyms.h
scripts/kconfig/conf  --silentoldconfig Kconfig
make -f /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/Makefile.autoconf || \
	{ rm -f include/config/auto.conf; false; }
mkdir -p include/asm
if [ -d /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/arch/arm/mach-mx6/include/mach ]; then	\
	dest=arch/arm/mach-mx6/include/mach;			\
else									\
	dest=arch/arm/include/asm/arch-mx6;	\
fi;									\
ln -fsn /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/$dest include/asm/arch
set -e; : '  CHK     include/config.h'; mkdir -p include/; 	(echo "/* Automatically generated - do not edit */"; for i in $(echo "IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" | sed 's/,/ /g'); do echo \#define CONFIG_$i | sed '/=/ {s/=/	/;q; } ; { s/$/	1/; }'; done; echo \#define CONFIG_BOARDDIR board/variscite/mx6ul_var_dart; echo \#include \<config_defaults.h\>; echo \#include \<config_uncmd_spl.h\>; echo \#include \<configs/"mx6ul_var_dart".h\>; echo \#include \<asm/config.h\>; echo \#include \<linux/kconfig.h\>; echo \#include \<config_fallbacks.h\>; echo \#include \<config_mender.h\>;) < /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/Makefile.autoconf > include/config.h.tmp; if [ -r include/config.h ] && cmp -s include/config.h include/config.h.tmp; then rm -f include/config.h.tmp; else : '  UPD     include/config.h'; mv -f include/config.h.tmp include/config.h; fi
mkdir -p spl/
  arm-fslc-linux-gnueabi-gcc  --sysroot=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot -E -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -fshort-wchar -O2 -fno-stack-protector -fno-delete-null-pointer-checks -g -fstack-usage -Wno-format-nonliteral -Werror=date-time  -D__KERNEL__ -D__UBOOT__   -D__ARM__ -Wa,-mimplicit-it=always  -mthumb -mthumb-interwork  -mabi=aapcs-linux  -mword-relocations  -fno-pic  -mno-unaligned-access  -ffunction-sections -fdata-sections -fno-common -ffixed-r9  -msoft-float   -pipe -Iinclude  -I/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include -I/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/arch/arm/include -include /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/linux/kconfig.h  -nostdinc -isystem /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/bin/arm-fslc-linux-gnueabi/../../lib/arm-fslc-linux-gnueabi/gcc/arm-fslc-linux-gnueabi/8.2.0/include -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/common.h > spl/u-boot.cfg.tmp && { grep 'define CONFIG_' spl/u-boot.cfg.tmp > spl/u-boot.cfg; rm spl/u-boot.cfg.tmp; } || { rm spl/u-boot.cfg.tmp; false; }
  arm-fslc-linux-gnueabi-gcc  --sysroot=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot -x c -DDO_DEPS_ONLY -M -MP -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -fshort-wchar -O2 -fno-stack-protector -fno-delete-null-pointer-checks -g -fstack-usage -Wno-format-nonliteral -Werror=date-time  -D__KERNEL__ -D__UBOOT__   -D__ARM__ -Wa,-mimplicit-it=always  -mthumb -mthumb-interwork  -mabi=aapcs-linux  -mword-relocations  -fno-pic  -mno-unaligned-access  -ffunction-sections -fdata-sections -fno-common -ffixed-r9  -msoft-float   -pipe -Iinclude  -I/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include -I/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/arch/arm/include -include /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/linux/kconfig.h  -nostdinc -isystem /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/bin/arm-fslc-linux-gnueabi/../../lib/arm-fslc-linux-gnueabi/gcc/arm-fslc-linux-gnueabi/8.2.0/include -MQ include/config/auto.conf /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/common.h > include/autoconf.mk.dep || { rm include/autoconf.mk.dep; false; }
  arm-fslc-linux-gnueabi-gcc  --sysroot=/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot -E -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -fshort-wchar -O2 -fno-stack-protector -fno-delete-null-pointer-checks -g -fstack-usage -Wno-format-nonliteral -Werror=date-time  -D__KERNEL__ -D__UBOOT__   -D__ARM__ -Wa,-mimplicit-it=always  -mthumb -mthumb-interwork  -mabi=aapcs-linux  -mword-relocations  -fno-pic  -mno-unaligned-access  -ffunction-sections -fdata-sections -fno-common -ffixed-r9  -msoft-float   -pipe -Iinclude  -I/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include -I/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/arch/arm/include -include /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/linux/kconfig.h  -nostdinc -isystem /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/recipe-sysroot-native/usr/bin/arm-fslc-linux-gnueabi/../../lib/arm-fslc-linux-gnueabi/gcc/arm-fslc-linux-gnueabi/8.2.0/include  -DDO_DEPS_ONLY -dM /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/common.h > u-boot.cfg.tmp && { grep 'define CONFIG_' u-boot.cfg.tmp > u-boot.cfg; rm u-boot.cfg.tmp; } || { rm u-boot.cfg.tmp; false; }
In file included from include/config.h:10,
                 from /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/common.h:21:
/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/config_mender.h:32:3: error: #error CONFIG_BOOTCOUNT_LIMIT is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
 # error CONFIG_BOOTCOUNT_LIMIT is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
   ^~~~~
In file included from include/config.h:10,
                 from /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/common.h:21:
/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/config_mender.h:37:3: error: #error CONFIG_BOOTCOUNT_ENV is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
 # error CONFIG_BOOTCOUNT_ENV is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
   ^~~~~
In file included from include/config.h:10,
                 from /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/common.h:21:
/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/config_mender.h:32:3: error: #error CONFIG_BOOTCOUNT_LIMIT is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
 # error CONFIG_BOOTCOUNT_LIMIT is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
   ^~~~~
In file included from include/config.h:10,
                 from /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/common.h:21:
/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/config_mender.h:37:3: error: #error CONFIG_BOOTCOUNT_ENV is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
 # error CONFIG_BOOTCOUNT_ENV is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
   ^~~~~
/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/Makefile.autoconf:82: recipe for target 'spl/u-boot.cfg' failed
make[2]: *** [spl/u-boot.cfg] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from include/config.h:10,
                 from /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/common.h:21:
/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/config_mender.h:32:3: error: #error CONFIG_BOOTCOUNT_LIMIT is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
 # error CONFIG_BOOTCOUNT_LIMIT is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
   ^~~~~
In file included from include/config.h:10,
                 from /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/common.h:21:
/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/include/config_mender.h:37:3: error: #error CONFIG_BOOTCOUNT_ENV is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
 # error CONFIG_BOOTCOUNT_ENV is required for Mender to work. Make sure that: 1) All the instructions at docs.mender.io/devices/integrating-with-u-boot have been followed. 2) All required layers are included in bblayers.conf, including any board specific layers such as meta-mender-<board>
   ^~~~~
/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/Makefile.autoconf:50: recipe for target 'include/autoconf.mk.dep' failed
make[2]: *** [include/autoconf.mk.dep] Error 1
/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/scripts/Makefile.autoconf:79: recipe for target 'u-boot.cfg' failed
make[2]: *** [u-boot.cfg] Error 1
make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
make[1]: Leaving directory '/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/build/mx6ul_var_dart_nand_defconfig'
Makefile:150: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Leaving directory '/home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git'
ERROR: oe_runmake failed
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_compile (log file is located at /home/miklosj/thudtest/mender-variscite/build/tmp/work/imx6ul_var_dart-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/temp/log.do_compile.30915)

So it seems that bitbake cannot execute the automatic patching of U-boot for some reason.

Could you give me some pointers to the possible cause of this error?
Thank you in advance.

I might be worth checking if the mender uboot patches are being applied:

https://docs.mender.io/hosted/devices/yocto-project/bootloader-support/u-boot/manual-u-boot-integration

What do you mean by “vanilla bblayers”? Can you post the contents?

Sorry. I just meant to say that I haven’t changed any of the recipes, and haven’t added any custom layers.

My bblayers.conf file:

LCONF_VERSION = "7"

BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"

BBFILES ?= ""
BBLAYERS = " \
  ${BSPDIR}/sources/poky/meta \
  ${BSPDIR}/sources/poky/meta-poky \
  \
  ${BSPDIR}/sources/meta-openembedded/meta-oe \
  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
  \
  ${BSPDIR}/sources/meta-freescale \
  ${BSPDIR}/sources/meta-freescale-3rdparty \
  ${BSPDIR}/sources/meta-freescale-distro \
  \
  ${BSPDIR}/sources/meta-browser \
  ${BSPDIR}/sources/meta-openembedded/meta-gnome \
  ${BSPDIR}/sources/meta-openembedded/meta-networking \
  ${BSPDIR}/sources/meta-openembedded/meta-python \
  ${BSPDIR}/sources/meta-openembedded/meta-filesystems \
  ${BSPDIR}/sources/meta-qt5 \
  ${BSPDIR}/sources/meta-swupdate \
  ${BSPDIR}/sources/meta-virtualization \
  ${BSPDIR}/sources/meta-variscite-fslc \
"
BBLAYERS += " \
  ${BSPDIR}/sources/meta-mender/meta-mender-core \
  ${BSPDIR}/sources/meta-mender/meta-mender-demo \
  ${BSPDIR}/sources/meta-mender-community/meta-mender-variscite \
"

My local.conf file:

MACHINE ??= 'imx6ul-var-dart'

DISTRO ?= 'fslc-framebuffer'

PACKAGE_CLASSES ?= "package_rpm"

EXTRA_IMAGE_FEATURES ?= "debug-tweaks"

USER_CLASSES ?= "buildstats image-mklibs image-prelink"

PATCHRESOLVE = "noop"

BB_DISKMON_DIRS ??= "\

STOPTASKS,${TMPDIR},1G,100K \

STOPTASKS,${DL_DIR},1G,100K \

STOPTASKS,${SSTATE_DIR},1G,100K \

STOPTASKS,/tmp,100M,100K \

ABORT,${TMPDIR},100M,1K \

ABORT,${DL_DIR},100M,1K \

ABORT,${SSTATE_DIR},100M,1K \

ABORT,/tmp,10M,1K"

PACKAGECONFIG_append_pn-qemu-native = " sdl"

PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"

CONF_VERSION = "1"

DL_DIR ?= "${BSPDIR}/downloads/"

ACCEPT_FSL_EULA = "1"

# Appended fragment from meta-mender-community/templates

# This really saves a lot of disk space!

INHERIT += "rm_work"

# The name of the disk image and Artifact that will be built.

# This is what the device will report that it is running, and different updates

# must have different names because Mender will skip installation of an Artifact

# if it is already installed.

MENDER_ARTIFACT_NAME = "release-1"

INHERIT += "mender-full"

DISTRO_FEATURES_append = " systemd"

VIRTUAL-RUNTIME_init_manager = "systemd"

DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"

VIRTUAL-RUNTIME_initscripts = ""

# Build for Hosted Mender

#

# To get your tenant token:

# - log in to https://hosted.mender.io

# - click your email at the top right and then "My organization"

# - press the "COPY TO CLIPBOARD"

# - assign content of clipboard to MENDER_TENANT_TOKEN

#

#MENDER_SERVER_URL = "https://hosted.mender.io"

#MENDER_TENANT_TOKEN = ""

# Build for Mender demo server

#

# https://docs.mender.io/getting-started/create-a-test-environment

#

# Uncomment below and update IP address to match the machine running the

# Mender demo server

#MENDER_DEMO_HOST_IP_ADDRESS = "192.168.0.100"

# Build for Mender production setup (on-prem)

#

# https://docs.mender.io/artifacts/building-for-production

#

# Uncomment below and update the URL to match your configured domain

# name and provide the path to the generated server.crt file.

#

# NOTE! It is recommend that you provide below information in your custom

# Yocto layer and this is only for demo purposes. See linked documentation

# for additional information.

#MENDER_SERVER_URL = "https://docker.mender.io"

#FILESEXTRAPATHS_prepend_pn-mender := "<DIRECTORY-CONTAINING-server.crt>:"

#SRC_URI_append_pn-mender = " file://server.crt"

# Mender storage configuration

#

# More details on these variables is available at

# https://docs.mender.io/devices/yocto-project/partition-configuration#configuring-storage

#

# Also, please be sure to check other config files as other

# layers, config fragments, etc may attempt to set values

# for specific platforms. Using "bitbake -e <image-name>"

# can help determine which files are setting these values

# in a given configuration.

#

# MENDER_STORAGE_TOTAL_SIZE_MB = "2048"

# MENDER_BOOT_PART_SIZE_MB = "16"

# MENDER_DATA_PART_SIZE_MB = "1024"

# MENDER_STORAGE_DEVICE = "/dev/mmcblk0"

# MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}1"

# MENDER_DATA_PART = "${MENDER_STORAGE_DEVICE_BASE}4"

# MENDER_ROOTFS_PART_A = "${MENDER_STORAGE_DEVICE_BASE}2"

# MENDER_ROOTFS_PART_B = "${MENDER_STORAGE_DEVICE_BASE}3"

# Appended fragment from meta-mender-community/meta-mender-variscite/templates

DISTRO ?= 'fslc-x11'

# This will make sure that our SPL + u-boot.img is embedded in the sdimg at

# a 1kb offset.

MENDER_IMAGE_BOOTLOADER_FILE = "u-boot-spl.img"

MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = "2"

# Remove the unneeded VFAT boot partition

IMAGE_BOOT_FILES = ""

MENDER_BOOT_PART_SIZE_MB = "0"

# Standard partition alignment from upstream wks file

MENDER_PARTITION_ALIGNMENT = "4194304"

# Cleanup image types generated

IMAGE_FSTYPES_remove = "tar.gz ext4 wic.gz wic.bmap multiubi mender.bmap"

# disable uefi

MENDER_FEATURES_ENABLE_append = " mender-uboot "

MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"

# Appended fragment from meta-mender-community/meta-mender-variscite/templates

# eMMC Settings

MENDER_STORAGE_DEVICE_var-som-mx6 = "/dev/mmcblk0"

MENDER_UBOOT_STORAGE_DEVICE_var-som-mx6 = "1"

# var-som-solo does not support UBoot in eMMC. We have to use

# nand and do a separate flash write to ensure it is stored

# there. Note that the environment is still stored in

# eMMC due to MENDER_UBOOT_STORAGE_DEVICE.

UBOOT_CONFIG_var-som-mx6 = "nand"

# The imx6ul-var-dart board has either eMMC or NAND.

# The board under test does not have eMMC.

MENDER_FEATURES_ENABLE_append = " mender-image-sd "

MENDER_STORAGE_TOTAL_SIZE_MB_var-som-mx6 = "1024"

MENDER_STORAGE_TOTAL_SIZE_MB_imx6ul-var-dart = "1024"

I can also see that the U-boot auto-patching is enabled. Or at least, the MENDER_UBOOT_AUTO_CONFIGURE variable is set to 1.

The next thing, I would check is if actually your uboot is being patched.

Based on my setup which is sumo (your mileage may vary):

I would navigate into the work directory for uboot which should be something like:
/build/tmp/<configname>/work/<product-machinename>/u-boot-variscite/<version>/

change into the git directory in the above directory and do the following to see if the defines have been patched in.

git diff | grep BOOTCOUNT

you should see something like

+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_BOOTCOUNT_ENV

if you don’t see anything then it would probably look like the patching isn’t happening.

I changed into the said directory, and ran git diff | grep BOOTCOUNT as you’ve mentioned.

This is the output:

+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y

These aren’t C #defines, but entries in a defconfig file. The #defines from your example are missing. So it indeed seems that the actual patching isn’t carried out.

I think this means that you are on a newer version of varisicites uboot than me, as this looks like its now a feature of uboot and no longer needs to be patched. my uboot is 2017 version and i have to manage the patches myself as they wouldn’t apply to my version of uboot directly from mender recipe.

looks like it was added in uboot as a feature in 2018

sorry not sure then, at this point i would normally take a look at the patch files that mender is applying to see if this sheds any light on why the errors are being thrown, maybe @drewmoseley has more ideas?

Thanks for the inputs, for the time being I will try the manual patching.

According to the Board Integration page, Mender has been tested successfully with Thud. Does it mean that U-boot auto-patching is supposed to work with a certain U-boot version?

If so, could downgrading U-boot to a specific commit solve the issue? By looking at the meta-variscite-fslc layer’s repo, I can see that U-boot has been changed a lot of times, seemingly independently from the layer’s other developments.

i think somewhere in the docs it does mention the minimum uboot that auto-patching works with, but i’m casting my memory back a long way now. I have a feeling that in newer versions they changed to chaining uboot and grub so they no longer need to patch uboot as heavily, but i might be wrong on this.

That certainly is the idea but it obviously is tricky and requires testing on each platform. The grub-efi mechanism is even easier, if the base U-Boot for the platform supports EFI boot.

It’s on my list to clean up and get the Variscite boards working on newer branches (hopefully with Grub-EFI) but it will likely be a few weeks before I get to spend any time on it.

Drew

It turned out that the U-boot configuration fails only if I use the eMMC template instead of the SD card template from meta-mender-community/mender-variscite/templates to create my local.conf file. With the SD-card template, the U-boot patching didn’t yield any errors, and I was able to build a working Thud-based SD card image.

In the meantime, I’ve come across a topic on this matter:
How to write DART-6UL image to eMMC

I don’t really understand how the original poster got the eMMC booting to work, but it seems that he may have used a local.conf initially tailored to SD-card booting, with a few changes made to the MENDER_STORAGE_DEVICE and MENDER_STORAGE_TOTAL_SIZE_MB variables to boot from eMMC.

Does this procedure make sense, or am I missing out something?

Yeah, that makes sense. I don’t recall what the differences between the SDCard and eMMC configs are but it should be just a few things.
Drew

does make sense, as i am not using those templates for my dart imx6 with emmc mender build

Hi @miklosj

It has been about a year since I passed through this process and I tried hard. When I gave these two variables (MENDER_STORAGE_DEVICE and MENDER_STORAGE_TOTAL_SIZE_MB) the appropriate values to the board, I managed to run it with eMMC. I cannot remember in detail right now, but I will check what I give these values for you. I was dealing with Mender at my old company and therefore I need to access internal documents. I still have a friend working at my old company and I will ask for the necessary information, but you may have to wait a few days for this.

Emre

Hi again @miklosj
I used these values. Hope it helps.

MENDER_STORAGE_TOTAL_SIZE_MB = “7456”
MENDER_STORAGE_DEVICE = “/dev/mmcblk1”
MENDER_IMAGE_BOOTLOADER_FILE = “u-boot-spl.img”
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = “2”
MENDER_BOOT_PART_SIZE_MB = “0”

eMMC Settings

MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd "
MENDER_STORAGE_TOTAL_SIZE_MB_imx6ul-var-dart = “7456”
MENDER_STORAGE_DEVICE_imx6ul-var-dart = “/dev/mmcblk1”

PREFERRED_PROVIDER_u-boot = “u-boot-variscite”

Thank you very much for sharing this!

I could generate an .sdimg with the settings you’ve listed. I booted the DART-6UL from an sd card, then copied the eMMC .sdimg onto the eMMC, by running
dd if=core-image-base-imx6ul-var-dart.sdimg of=/dev/mmcblk1 status=progress conv=fdatasync

When I boot from the eMMC, U-boot itself starts successfully (I can interact with it), but it fails when it comes to mounting the filesystem and gets stuck there. Judging from the boot environment variables, the Mender patch seems to be applied, so I guess I must be missing some minor setting now.

The log output:

U-Boot SPL 2017.03-mx6ul+ga7869c2cde (Aug 14 2020 - 09:11:41)

Part number: VSM-6UL-706B
Assembly: AS1812142595
Date of production: 2019 Feb 18
DART-6UL configuration: eMMC WiFi
Trying to boot from MMC1
MMC Boot Device: mmc1 (eMMC)


U-Boot 2017.03-mx6ul+ga7869c2cde (Aug 14 2020 - 09:11:41 +0000)

CPU:   Freescale i.MX6ULL rev1.1 900 MHz (running at 396 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 48C
Reset cause: POR
Board: Variscite DART-6UL
I2C:   ready
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

Display: VAR-WVGA-LCD (800x480)
Video: 800x480x24
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Error: could not access storage.
In:    serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc1(part 0) is current device
eMMC:  7.3 GiB
Net:   got MAC0 address from fuse: f8:dc:7a:26:f6:9c
FEC0 [PRIME], usb_ether
Error: usb_ether address not set.

Normal Boot
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1(part 0) is current device
switch to partitions #0, OK
mmc1(part 0) is current device
** File not found /uEnv.txt **
## Error: "loadbootscript" not defined
## Error: "loadimage" not defined
## Error: "netboot" not defined

U-boot environment variables:

baudrate=115200
board_name=MX6UL_VAR_DART
boot_dev=emmc
boot_fdt=try
bootcmd=run ramsize_check; mmc dev ${mmcdev};mmc dev ${mmcdev}; if mmc rescan; then if run loadbootenv; then run importbootenv; fi; if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi
bootdelay=1
bootenv=uEnv.txt
console=ttymxc0
ethact=FEC0
ethaddr=f8:dc:7a:26:f6:9c
ethprime=FEC0
fdt_addr=0x83000000
fdt_file=undefined
fdt_high=0xffffffff
findfdt=if test $fdt_file = undefined; then if test $boot_dev = sd; then if test $som_storage = emmc || test $som_storage = none; then if test $soc_type = imx6ull; then setenv fdt_file imx6ull-var-dart-sd_emmc.dtb; else setenv fdt_file imx6ul-var-dart-sd_emmc.dtb; fi; fi; if test $som_storage = nand; then if test $soc_type = imx6ull; then setenv fdt_file imx6ull-var-dart-sd_nand.dtb; else setenv fdt_file imx6ul-var-dart-sd_nand.dtb; fi; fi; fi; if test $boot_dev = emmc; then if test $wifi = yes; then if test $soc_type = imx6ull; then if test $som_rev = 5G; then setenv fdt_file imx6ull-var-dart-5g-emmc_wifi.dtb; else setenv fdt_file imx6ull-var-dart-emmc_wifi.dtb; fi; else if test $som_rev = 5G; then setenv fdt_file imx6ul-var-dart-5g-emmc_wifi.dtb; else setenv fdt_file imx6ul-var-dart-emmc_wifi.dtb; fi; fi; else if test $soc_type = imx6ull; then setenv fdt_file imx6ull-var-dart-sd_emmc.dtb; else setenv fdt_file imx6ul-var-dart-sd_emmc.dtb; fi; fi; fi; if test $boot_dev = nand; then if test $wifi = yes; then if test $soc_type = imx6ull; then if test $som_rev = 5G; then setenv fdt_file imx6ull-var-dart-5g-nand_wifi.dtb; else setenv fdt_file imx6ull-var-dart-nand_wifi.dtb; fi; else if test $som_rev = 5G; then setenv fdt_file imx6ul-var-dart-5g-nand_wifi.dtb; else setenv fdt_file imx6ul-var-dart-nand_wifi.dtb; fi; fi; else if test $soc_type = imx6ull; then setenv fdt_file imx6ull-var-dart-sd_nand.dtb; else setenv fdt_file imx6ul-var-dart-sd_nand.dtb; fi; fi; fi; if test $fdt_file = undefined; then echo WARNING: Could not determine dtb to use; fi; fi;
image=zImage
importbootenv=echo Importing bootenv from mmc ...; env import -t ${loadaddr} ${filesize}
initrd_high=0xffffffff
loadaddr=0x82000000
loadbootenv=load mmc ${mmcdev}:${mender_boot_part} ${loadaddr} ${bootdir}/${bootenv}
mmcautodetect=yes
mmcblk=1
mmcdev=1
optargs=setenv bootargs ${bootargs} ${kernelargs};
panel=VAR-WVGA-LCD
ramsize_check=if test $sdram_size -lt 256; then setenv cma_size cma=32MB; setenv fdt_addr 0x84000000; setenv loadaddr 0x84600000; else if test $sdram_size -lt 512; then setenv cma_size cma=64MB; fi; fi;
script=boot.scr
sdram_size=512
soc_type=imx6ull
som_rev=2.4G
som_storage=emmc
splashdisable=setenv splashfile; setenv splashimage
splashenable=setenv splashfile /boot/splash.bmp; setenv splashimage 0x83100000
splashfile=/boot/splash.bmp
splashimage=0x83100000
splashsource=emmc
splashsourceauto=yes
usbnet_devaddr=f8:dc:7a:00:00:02
usbnet_hostaddr=f8:dc:7a:00:00:01
wifi=yes

My current local.conf:

MACHINE ??= 'imx6ul-var-dart'
DISTRO ?= 'fslc-framebuffer'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1"

DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"

# This really saves a lot of disk space!
INHERIT += "rm_work"

MENDER_ARTIFACT_NAME = "emmc_test_1"

INHERIT += "mender-full"

DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""

MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "<my token>"

# Remove unneded vfat boot partition
IMAGE_BOOT_FILES = ""
MENDER_BOOT_PART_SIZE_MB = "0"

# Set up eMMC storage
MENDER_STORAGE_TOTAL_SIZE_MB = "7456"
MENDER_STORAGE_TOTAL_SIZE_MB_imx6ul-var-dart = "7456"
MENDER_STORAGE_DEVICE = "/dev/mmcblk1"
MENDER_STORAGE_DEVICE_imx6ul_var_dart = "/dev/mmcblk1"
MENDER_IMAGE_BOOTLOADER_FILE = "u-boot-spl.img"
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = "2"

# Standard partition alignment from upstream wks file
#MENDER_PARTITION_ALIGNMENT = "4194304"

# Cleanup image types generated
IMAGE_FSTYPES_remove = "tar.gz wic.gz wic.bmap multiubi mender.bmap"

# Disable uefi, enable U-boot and .sdimg generation
MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"

# Make sure that we use the Variscite-supplied u-boot for patching!
PREFERRED_PROVIDER_u-boot = "u-boot-variscite"

I don’t apply any custom U-boot .bbappends, and the automatic u-boot configuration is enabled. I can also mount and see the contents of eMMC card partitions, so I assume that dd itself ran without problems.

Could you point out what I am still missing?

From the U-Boot prompt, what do the following commands show?

U-Boot> mmc list
U-Boot> mmc dev “number of your eMMC device”
U-Boot> mmc part

They show the following:

=> mmc list
FSL_SDHC: 0 (SD)
FSL_SDHC: 1 (eMMC)

=> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device

=> mmc part

Partition Map for MMC device 1  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     49152           7471104         e796306e-01     83
  2     7520256         7471104         e796306e-02     83
  3     14991360        262144          e796306e-03     83

Hmm. Looks like you might need something like the following:

MENDER_STORAGE_DEVICE_imx6ul-var-dart = “/dev/mmcblk0”
MENDER_UBOOT_STORAGE_DEVICE_imx6ul-var-dart = “1”

The following is what I use for my Variscite DART_MX6:

MENDER_STORAGE_DEVICE = “/dev/mmcblk1”
MENDER_IMAGE_BOOTLOADER_FILE = “u-boot.imx”
MENDER_UBOOT_STORAGE_DEVICE = “1”
MENDER_UBOOT_STORAGE_INTERFACE = “mmc”
MENDER_STORAGE_TOTAL_SIZE_MB = “3608”
MENDER_DATA_PART_SIZE_MB = “768”
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = “2”
MENDER_BOOT_PART_SIZE_MB = “0”