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

**URL:** <https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini-kirkstone/5757>\
**Category:** Yocto Project\
**Tags:** nxp, variscite, kirkstone\
**Created:** [April 12, 2023, 6:31pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini-kirkstone/5757 "2023-04-12T18:31:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![estape.nt](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/estape.nt/32/2049_2.png) [@estape.nt](https://hub.mender.io/u/estape.nt)\
**Post date:** [April 12, 2023, 6:31pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini-kirkstone/5757/1 "2023-04-12T18:31:56Z")

</div>

# Board description

The VAR-SOM-MX8M-MINI is a highly scalable, low power System on Module (SoM), offering a mainstream solution to fit a wide range of applications and cost requirements.  
Based on NXP’s i.MX 8M Mini with up to 1.8GHz Quadcore ARM Cortex-A53 plus 400MHz Cortex-M4 real-time processor and up to 4 GB DDR4, the VAR-SOM-MX8M offers a low-power and cost-optimized solution with ultimate scalability options to suit a wide range of applications and cost requirements.  
The SoM is pin-compatible with the VAR-SOM Pin2Pin product family, including the i.MX 6UL/6ULL modules, through i.MX 6, i.MX 8M Nano, TI AM625x, i.MX 93, i.MX 8M Mini, i.MX 8M Plus up to i.MX 8X and i.MX 8 QuadMax-based modules providing Variscite’s customers with flexibility, extended lifetime, as well as reduced development time, cost, and risk.

 ![VAR-SOM-MX8M-MINI-starter-kit](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/2/211114ffa6e120eafbc9e6c3d5fedcb45bfc5bf0.png)

- References [VAR-SOM-MX8M-MINI](https://www.variscite.com/product/system-on-module-som/cortex-a53-krait/var-som-mx8m-mini-nxp-i-mx8m-mini/) & [VAR-SOM-MX8M-MINI Evaluation Kits](https://www.variscite.com/product/evaluation-kits/var-som-mx8m-mini-evaluation-kits/)
- [Support Wiki](https://variwiki.com/index.php?title=VAR-SOM-MX8M-MINI&target=_blank)

# Test results

The Yocto Project releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other [Yocto Project releases](https://wiki.yoctoproject.org/wiki/Releases?target=_blank):

## SD Card Root Filesystem

| Yocto Project | Build | Runtime |
| --- | --- | --- |
| Kirkstone (4.0) | :test_works: | :test_works: |

**Build** Means that the Yocto Project build using this Mender integration completes without errors and outputs images.  
**Runtime** Means that Mender has been verified to work on the board. For U-Boot-based boards, the [integration checklist](https://docs.mender.io/system-updates-yocto-project/board-integration/bootloader-support/u-boot/integration-checklist?target=_blank) has been verified.

# Getting started

## Prerequisites

- A supported Linux distribution and dependencies installed on your workstation/laptop as described in the [Yocto Mega Manual - Kirkstone](https://docs.yoctoproject.org/4.0.8/ref-manual/system-requirements.html#supported-linux-distributions)
- Google repo tool [installed](https://hub.mender.io/t/google-repo/58/2) and in your `PATH`.

## Configuring the build

### Setup Yocto environment

Set the Yocto Project branch you are building for:

```auto
# set to your branch, make sure it is supported (see table above)
export BRANCH="kirkstone"

```

Create a directory for your `mender-imx8mm` setup to live in and clone the  
meta information.

```auto
mkdir mender-imx8mm && cd mender-imx8mm

```

Initialize repo manifest:

```auto
repo init -u https://github.com/varigit/variscite-bsp-platform \
          -m imx-5.15.71-2.2.0.xml \
          -b ${BRANCH}

```

Fetch layers in manifest:

```auto
repo sync -j$(nproc)

```

Gather Mender resources:

```auto
cd sources
git clone https://github.com/mendersoftware/meta-mender.git \
         -b ${BRANCH}
git clone https://github.com/mendersoftware/meta-mender-community.git \
         -b ${BRANCH}
cd ../

```

## Setup build environment

Initialize the build environment:

```auto
MACHINE=imx8mm-var-dart DISTRO=fslc-x11 source ./var-setup-release.sh build

```

### Remove unused resources

By default, Variscite includes meta-qt5 in the `bblayers.conf` file, if not used please remove it.

### Add the layers

```auto
bitbake-layers add-layer ../sources/meta-mender/meta-mender-core
bitbake-layers add-layer ../sources/meta-mender/meta-mender-demo
bitbake-layers add-layer ../sources/meta-mender-community/meta-mender-variscite

```

### Setup the local.conf file

```auto
cat ../sources/meta-mender-community/meta-mender-variscite/templates/local.conf.append >> conf/local.conf
cat ../sources/meta-mender-community/meta-mender-variscite/templates/local-sdcard.conf.append >> conf/local.conf

```

Please note this will add the `MENDER_TENANT_TOKEN` & `MENDER_SERVER_URL` variables, please modify them accordingly (more info further in this document).

### Configure Mender server URL (optional)

This section is not required for a successful build but images that are generated by default are only suitable for usage with the Mender client in [Standalone deployments](https://docs.mender.io/artifact-creation/standalone-deployment?target=_blank), due to lack of server configuration.

You can edit the `conf/local.conf` file to provide your Mender server configuration, ensuring the generated images and Mender Artifacts are connecting to the Mender server that you are using. There should already be a commented section in the generated `conf/local.conf` file and you can simply uncomment the relevant configuration options and assign appropriate values to them.

Build for Hosted Mender:

```auto
# 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 = "<copy token here>"

```

### Building the image

You can now proceed with building an image:

```auto
bitbake core-image-base

```

You can replace `core-image-base` with your desired image target. Please keep in mind this is the tested image.

### Using the build output

After a successful build, the images and build artifacts are placed in `tmp/deploy/images/imx8mm-var-dart/core-image-base-imx8mm-var-dart.sdimg`

The disk image (with `.sdimg` suffix) is used to provision the device storage for devices without Mender running already. Please proceed to [the official documentation on provisioning a new device](https://docs.mender.io/system-updates-yocto-project/provisioning-a-new-device?target=_blank) for steps to do this.

On the other hand, if you already have Mender running on your device and want to deploy a rootfs update using this build, you should use the [Mender Artifact](https://docs.mender.io/overview/artifact) files, which have `.mender` suffix. You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client [standalone mode](https://docs.mender.io/artifact-creation/standalone-deployment).

### Flashing the SD card

To flash and make a bootable SD, run:

```auto
dd if=build/tmp/deploy/images/imx8mm-var-dart/core-image-base-imx8mm-var-dart.sdimg | pv | dd of=/dev/SD_CARD

```

> **WARNING** : make sure you use the correct device node as the _of=_ parameter to avoid overwriting the wrong device.

The command `pv` is optional but is highly recommended to track the RT transfer.

### Booting the board

By default, the board will boot to its eMMc storage, by changing the `BOOT_SELECT` switch, this will allow it to boot from the SD card.  
After the board boots into u-boot from the SD card, please reset the environment values:

```auto
env default -a -f
saveenv
saveenv
reset

```

# References

- The Variscite imx8m-var-dart template files can be found in [meta-mender-community](https://github.com/estape11/meta-mender-community/tree/kirkstone/meta-mender-variscite)
- The official [Mender documentation](https://docs.mender.io/) explains how Mender works. This is simply a board-specific complement to the official documentation.

* * *

_If this post was useful to you, please leave a like, or leave a thank you note to the contributor who put valuable time into this and made it available to you. It will be much appreciated!_

---

<div class="post-metadata">

**Author:** ![h\_fotoohi](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@h\_fotoohi](https://hub.mender.io/u/h_fotoohi)\
**Post date:** [May 2, 2023, 6:40am UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini-kirkstone/5757/2 "2023-05-02T06:40:41Z")

</div>

Hi @estape.nt

Thanks for sharing it. Would you please let me know how can I use that for emmc (without sd card).
