# Variscite VAR-SOM-MX8M-MINI : NXP i.MX 8M Mini

**URL:** https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918
**Category:** Yocto Project
**Created:** [May 14, 2020, 1:51pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918 "2020-05-14T13:51:16Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![KTCdjoh](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ktcdjoh/32/1658_2.png) [@KTCdjoh](https://hub.mender.io/u/KTCdjoh)
#### Post date: [August 5, 2020, 6:12am UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/2 "2020-08-05T06:12:16Z")

</div>

Dear drewmoseley,  
thank you very much for this guide. I’m using this module in a project and the mender integration went very well so far, thanks to your effort.  
(Just on thing to add maybe: I needed to ‘bitbake -c populate\_sdk …’ before building the image itself. Without this step there was some mender compilation error regarding ‘pseudo-native’, which could not be found.)

Now I would like to use OP-TEE for some security features. There are examples by NXP for their EVKs, but none really for the Variscite modules (see the NXP community board). I tried a few approaches and the best one resulted in appending ‘optee’ to the MACHINE\_FEATURES and inserting a node into the devicetree - so far, so good.

Then there’s the problem: OP-TEE needs to add a file called ‘tee.bin’ to u-boot, i. e. to the boot partition via IMAGE\_BOOT\_FILES variable, but following your guide it is manually set to empty by the ‘meta-mender-variscite/templates/local.conf.append’ and the boot partition size is set to ‘0’.

Do you have an idea how to solve this? I tried commenting the overrides in ‘local.conf’, but the board won’t boot then, since it seems to be unable to find the bootloader.  
Would it be possible to add the file to ‘/boot’, where kernel and devicetrees are located?

/edit:  
I just looked at the u-boot env and there seems to be a new bootcmd with optee content:  
`bootcmd_mfg=run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else booti ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;`

> **u-boot=\> printenv**
>
> altbootcmd=run mender\_altbootcmd; run bootcmd  
> baudrate=115200  
> board\_name=VAR-SOM-MX8M-MINI  
> boot\_fdt=try  
> bootcmd=run mender\_setup; setenv bootargs root={mender\_kernel\_root} {bootargs}; if test “{fdt\_addr\_r}" != ""; then load {mender\_uboot\_root} {fdt\_addr\_r} /boot/{mender\_dtb\_name}; fi; load {mender\_uboot\_root} {img\_addr} /boot/{mender\_kernel\_name};unzip {img\_addr} {loadaddr}; {mender\_boot\_kernel\_type} {kernel\_addr\_r} - {fdt\_addr\_r}; run mender\_try\_to\_recover  
> bootcmd\_mfg=run mfgtool\_args;if iminfo {initrd\_addr}; then if test {tee} = yes; then bootm {tee\_addr} {initrd\_addr} {fdt\_addr}; else booti {loadaddr} {initrd\_addr} {fdt\_addr}; fi; else echo “Run fastboot …”; fastboot 0; fi;  
> bootcount=1  
> bootdelay=1  
> bootdir=/boot  
> bootlimit=1  
> bootscript=echo Running bootscript from mmc …; source  
> console=ttymxc3,115200 earlycon=ec\_imx6q,0x30a60000,115200  
> emmc\_dev=1  
> ethaddr=xx:xx:xx:xx:xx:xx  
> ethprime=FEC  
> fastboot\_dev=mmc0  
> fdt\_addr\_r=0x43000000  
> fdt\_file=undefined  
> fdt\_high=0xffffffffffffffff  
> fdtcontroladdr=b6d43ad8  
> findfdt=if test $fdt\_file = undefined; then if test $board\_name = VAR-SOM-MX8M-MINI; then if test som\_rev = som\_rev10; then setenv fdt\_file fsl-imx8mm-var-som-rev10.dtb; else setenv fdt\_file fsl-imx8mm-var-som.dtb; fi;else setenv fdt\_file fsl-imx8mm-var-dart.dtb;fi; fi; image=Image.gz img\_addr=0x42000000 initrd\_addr=0x43800000 initrd\_high=0xffffffffffffffff ip\_dyn=yes kboot=booti loadaddr=0x40480000 loadbootscript=load mmc {mmcdev}:{mmcpart} {loadaddr} {bootdir}/{script};  
> loadfdt=run findfdt; echo fdt\_file={fdt\_file}; load mmc {mmcdev}:{mmcpart} {fdt\_addr} {bootdir}/{fdt\_file}  
> loadimage=load mmc {mmcdev}:{mmcpart} {img\_addr} {bootdir}/{image};unzip {img\_addr} {loadaddr} loadm4bin=load mmc {mmcdev}:{mmcpart} {m4\_addr} {bootdir}/{m4\_bin}  
> m4\_addr=0x7e0000  
> m4\_bin=hello\_world.bin  
> mender\_altbootcmd=if test {mender\_boot\_part} = 1; then setenv mender\_boot\_part 2; setenv mender\_boot\_part\_hex 2; else setenv mender\_boot\_part 1; setenv mender\_boot\_part\_hex 1; fi; setenv upgrade\_available 0; saveenv; run mender\_setup mender\_boot\_kernel\_type=booti mender\_boot\_part=1 mender\_boot\_part\_hex=1 mender\_check\_saveenv\_canary=1 mender\_dtb\_name=fsl-imx8mm-var-som-rev10-m4.dtb mender\_kernel\_name=Image.gz mender\_pre\_setup\_commands= setenv bootargs console={console},{baudrate}; if test "{mmcargs}” != “”; then run mmcargs; fi; if test “{videoargs}" != ""; then run videoargs; fi; if test "{optargs}” != “”; then run optargs; fi; if test “{ramsize\_check}" != ""; then run ramsize\_check; fi; run findfdt; setenv mender\_dtb\_name {fdt\_file}; setenv kernel\_addr\_r {loadaddr}; mender\_saveenv\_canary=1 mender\_setup=if test "{mender\_saveenv\_canary}” != “1”; then setenv mender\_saveenv\_canary 1; saveenv; fi; if test “{mender\_pre\_setup\_commands}" != ""; then run mender\_pre\_setup\_commands; fi; if test "{mender\_systemd\_machine\_id}” != “”; then setenv bootargs systemd.machine\_id={mender\_systemd\_machine\_id} {bootargs}; fi; setenv mender\_kernel\_root /dev/mmcblk1p${mender\_boot\_part}; if test {mender\_boot\_part} = 1; then setenv mender\_boot\_part\_name /dev/mmcblk1p1; else setenv mender\_boot\_part\_name /dev/mmcblk1p2; fi; setenv mender\_kernel\_root\_name {mender\_boot\_part\_name}; setenv mender\_uboot\_root mmc 0:{mender\_boot\_part\_hex}; setenv mender\_uboot\_root\_name {mender\_boot\_part\_name}; setenv expand\_bootargs “setenv bootargs \”{bootargs}\\""; run expand\_bootargs; setenv expand\_bootargs; if test "{mender\_post\_setup\_commands}" != “”; then run mender\_post\_setup\_commands; fi  
> mender\_try\_to\_recover=if test {upgrade\_available} = 1; then reset; fi mender\_uboot\_boot=mmc 0:1 mender\_uboot\_dev=0 mender\_uboot\_if=mmc mfgtool\_args=setenv bootargs console={console},{baudrate} rdinit=/linuxrc clk\_ignore\_unused mmcargs=setenv bootargs console={console} rootwait rw {cma\_size} mmcautodetect=yes mmcblk=1 mmcboot=echo Booting from mmc ...; run mmcargs; run optargs; if test {boot\_fdt} = yes || test {boot\_fdt} = try; then if run loadfdt; then booti {loadaddr} - {fdt\_addr}; else echo WARN: Cannot load the DT; fi; else echo wait for boot; fi; mmcdev=0 mmcpart=1 netargs=setenv bootargs console={console} {cma\_size} ip=dhcp nfsroot={serverip}:{nfsroot},v3,tcp netboot=echo Booting from net ...; if test {ip\_dyn} = yes; then setenv get\_cmd dhcp; else setenv get\_cmd tftp; fi; {get\_cmd} {img\_addr} {image}; unzip {img\_addr} {loadaddr};run ramsize\_check; run netargs; run optargs; if test {boot\_fdt} = yes || test {boot\_fdt} = try; then run findfdt; echo fdt\_file={fdt\_file}; if {get\_cmd} {fdt\_addr} {fdt\_file}; then booti {loadaddr} - {fdt\_addr}; else echo WARN: Cannot load the DT; fi; else booti; fi; optargs=setenv bootargs {bootargs} ${kernelargs};  
> ramsize\_check=if test sdram\_size -le 512; then setenv cma\_size cma=320M; else setenv cma\_size cma=640M@1376M; fi; runm4bin=if test {m4\_addr} = 0x7e0000; then echo Booting M4 from TCM; else echo Booting M4 from DRAM; dcache flush; fi; bootaux ${m4\_addr};  
> script=boot.scr  
> sd\_dev=0  
> sdram\_size=2048  
> serial#=0d111209dab4b749  
> soc\_type=imx8mm  
> som\_rev=som\_rev11  
> splashdisable=setenv splashfile; setenv splashimage  
> splashenable=setenv splashfile /boot/splash.bmp; setenv splashimage 0x43100000  
> splashfile=/boot/splash.bmp  
> splashimage=0x43100000  
> splashsourceauto=yes  
> stderr=serial  
> stdin=serial  
> stdout=serial  
> upgrade\_available=0  
> use\_m4=no

However, it is not called by the default bootcmd and if I try ‘run bootcmd\_mfg’ it says `## Checking Image at 43800000 ... Unknown image format!` because the ‘iminfo’ command cannot find a valid image at ‘initrd\_addr’.

I would appreciate your help very much.  
djoh

---

_[View the full topic](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918)._
