# Boundary Devices - Nitrogen8m

**URL:** <https://hub.mender.io/t/boundary-devices-nitrogen8m/409>\
**Category:** Yocto Project\
**Tags:** yocto, nxp, thud, imx8, warrior, dunfe\
**Created:** [March 23, 2019, 2:38pm UTC](https://hub.mender.io/t/boundary-devices-nitrogen8m/409 "2019-03-23T14:38:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![texierp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/texierp/32/45_2.png) [@texierp](https://hub.mender.io/u/texierp)\
**Post date:** [March 23, 2019, 2:38pm UTC](https://hub.mender.io/t/boundary-devices-nitrogen8m/409/1 "2019-03-23T14:38:32Z")

</div>

# Board description

The **Nitrogen8M** is an ARM based single board computer (SBC) designed to leverage the full capabilities of NXP’s i.MX 8M Quad processor. The **Nitrogen8M** is designed for mass production use with a guaranteed 10 year life span, FCC Pre-scan results, and a stable supply chain. Industrial temperature and conformal coating options are available. It can be modified by de-populating unused components or fully customized for cost reduction.

 ![Nitrogen8M-Large-1](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/2f5235c57a44437a6794c2baa90e692f60473d36.jpeg)

URL: [Nitrogen8M SBC | Ezurio](https://boundarydevices.com/product/nitrogen8m/)  
Wiki: [Ezurio | Formerly Laird Connectivity](https://boundarydevices.com/wiki/)

# 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):

| Yocto Project | Build | Runtime |
| --- | --- | --- |
| thud (2.6) | :test_works: | :test_works: |
| warrior (2.7) | :test_works: | :test_works: |
| dunfell (3.1) | :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/devices/integrating-with-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](https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#detailed-supported-distros)

- 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="dunfell"

```

Create a directory for your `mender-nxp` setup to live in and clone the

meta information.

```auto
mkdir mender-nxp && cd mender-nxp

```

Initialize repo manifest:

```auto
repo init -u https://github.com/mendersoftware/meta-mender-community \
           -m meta-mender-nxp/scripts/manifest-nxp.xml \
           -b ${BRANCH}

```

Fetch layers in manifest:

```auto
repo sync

```

## Setup build environment

Initialize the build environment:

```auto
source setup-environment nxp

```

**NOTE!** You need to accept the Freescale EULA at ‘../sources/meta-freescale/EULA’. Please read it and in case you accept it, add:

```
ACCEPT_FSL_EULA = "1" 

```

in your local.conf.

### 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/architecture/standalone-deployments?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>" 

```

Build for Mender demo server:

```auto
# https://docs.mender.io/getting-started/create-a-test-environment 
# 
# Update IP address to match the machine running the Mender demo server 
MENDER_DEMO_HOST_IP_ADDRESS = "192.168.0.100"

```

### Building the image

You can now proceed with building an image:

```auto
MACHINE=nitrogen8m bitbake core-image-base

```

Replace `core-image-base` with your desired image target.

### Using the build output

After a successful build, the images and build artifacts are placed in `tmp/deploy/images/nitrogen8m/`.

- `tmp/deploy/images/nitrogen8m/core-image-base-nitrogen8m.sdimg`

- `tmp/deploy/images/nitrogen8m/core-image-base-nitrogen8m.mender`

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/artifacts/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/architecture/mender-artifacts?target=_blank) 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 only in [Standalone deployments](https://docs.mender.io/architecture/standalone-deployments?target=_blank).

#### Flash instructions

- NOTE. You have to connect a USB cable between the OTG Nitrogen8M port (_J67 - USB 3.0 OTG (micro-B SS)_) and the host PC.

From U-Boot side (Using U-Boot USB Mass Storage Gadget):

```auto
=> ums 0 mmc 0

```

From Host side:

```bash
sudo dd if=core-image-base-nitrogen8m.sdimg of=/dev/sdX bs=1M && sudo sync

```

That is it, you can now power-cycle or reset the device and halt it in U-Boot on the first boot. You should see:

```auto
Hit any key to stop autoboot: 0                                                                                                            
=>

```

run the commands below (via the serial terminal).

```auto
=> run upgradeu
timeout irqstat=18000
timeout irqstat=18000
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /upgrade.scr
5286 bytes read in 6 ms (860.4 KiB/s)
## Executing script at 40480000
1101432 bytes read in 16 ms (65.6 MiB/s)
timeout irqstat=18000
timeout irqstat=18000
switch to partitions #0, OK
mmc0(part 0) is current device

MMC read: dev # 0, block # 66, count 2152 ... 2152 blocks read: OK
byte at 0x0000000042000400 (0xd1) != byte at 0x0000000042400400 (0x0)
Total of 0 byte(s) were the same
Need U-Boot upgrade
Program in 5 seconds
5
4
3
2
1

MMC write: dev # 0, block # 66, count 2152 ... 2152 blocks written: OK
timeout irqstat=18000
timeout irqstat=18000
switch to partitions #0, OK
mmc0(part 0) is current device
---- U-Boot upgraded. Please reset the board

```

Takes around 5 seconds to complete, and you will be prompted to reset the board once it is complete.

Also remember to run the following **once** after you have performed the U-Boot upgrade:

```auto
=> env default -a
=> saveenv

```

This will make sure that the correct U-Boot environment is used.

# References

- 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 press 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:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [November 22, 2019, 10:37pm UTC](https://hub.mender.io/t/boundary-devices-nitrogen8m/409/2 "2019-11-22T22:37:33Z")

</div>

@texierp have you done any work with warrior on this platform yet?

---

<div class="post-metadata">

**Author:** ![texierp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/texierp/32/45_2.png) [@texierp](https://hub.mender.io/u/texierp)\
**Post date:** [November 22, 2019, 11:32pm UTC](https://hub.mender.io/t/boundary-devices-nitrogen8m/409/3 "2019-11-22T23:32:12Z")

</div>

Yes @drewmoseley , and it works fine, this is my setup:

```auto
root@nitrogen8m:~# cat /etc/os-release 
ID="poky"
NAME="Poky (Yocto Project Reference Distro)"
VERSION="2.7.1 (warrior)"
VERSION_ID="2.7.1"
PRETTY_NAME="Poky (Yocto Project Reference Distro) 2.7.1 (warrior)"

```

I will update this page 😉

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [November 23, 2019, 2:37am UTC](https://hub.mender.io/t/boundary-devices-nitrogen8m/409/4 "2019-11-23T02:37:13Z")

</div>

Awesome. Thanks.

---

<div class="post-metadata">

**Author:** ![dmwang](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dmwang](https://hub.mender.io/u/dmwang)\
**Post date:** [January 22, 2020, 4:46pm UTC](https://hub.mender.io/t/boundary-devices-nitrogen8m/409/5 "2020-01-22T16:46:30Z")

</div>

@texierp With the latest meta-boundary warrior branch (HEAD: commit 43cd18cd0d6eedb081dbf513f7329da3f5444d91), u-boot-boundary build failed with the following error:

Applying patch 0001-ARM-nitrogen8m-Add-support-to-mender.patch  
patching file configs/nitrogen8m\_defconfig  
Hunk #1 FAILED at 40.  
1 out of 1 hunk FAILED – rejects in file configs/nitrogen8m\_defconfig  
patching file include/configs/nitrogen8m.h  
Hunk #1 succeeded at 93 (offset -7 lines).  
Patch 0001-ARM-nitrogen8m-Add-support-to-mender.patch does not apply (enforce with -f)

In [https://github.com/mendersoftware/meta-mender-community/meta-mender-nxp](https://github.com/mendersoftware/meta-mender-community/meta-mender-nxp), the revision used for meta-boundary is 14d7a54464450e50bdd28b6cba505d1263bc1b41. Has meta-mender-nxp been updated to work with the latest meta-boundary branch?

---

<div class="post-metadata">

**Author:** ![texierp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/texierp/32/45_2.png) [@texierp](https://hub.mender.io/u/texierp)\
**Post date:** [January 22, 2020, 8:48pm UTC](https://hub.mender.io/t/boundary-devices-nitrogen8m/409/6 "2020-01-22T20:48:43Z")

</div>

@dmwang, fixed by this [commit](https://github.com/bdx-iot/meta-mender-community/commit/20635b73dc2bb5d0a993834b8bdbe2d27f64a222), but in fact, before creating a PR, I’m waiting for this [issue](https://github.com/boundarydevices/meta-boundary/pull/9) in meta-boundary, I don’t want to include dependencies to meta-networking and meta-qt5 😉
