The official Mender documentation explains how Mender works. This is a board-specific complement to the official documentation.
Board description
WaRP7 speeds and eases development of Internet of things and wearable devices by addressing technology challenges and freeing developers to focus on creating differentiated features. The platform consists of a main board and a daughter card. The main board is based on the NXP i.MX 7 Solo applications processor that features an advanced implementation of the ARM Cortex A7 core, as well as the ARM Cortex M4 core.
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:
Yocto Project | Build | Runtime |
---|---|---|
sumo (2.5) | ||
thud (2.6) | ||
warrior (2.7) | ||
zeus (3.0) | ||
dunfell (3.1) |
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 has been verified.
Getting started
Prerequisites
- A supported Linux distribution and dependencies installed on your workstation/laptop as described in the Yocto Mega Manual
- NOTE. Instructions depend on which Yocto version you intend to use.
- Google repo tool installed and in your
PATH
.
Setup Yocto environment
Set the Yocto Project branch you are building for:
# 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.
mkdir mender-nxp && cd mender-nxp
Initialize repo manifest:
repo init -u https://github.com/mendersoftware/meta-mender-community \
-m meta-mender-nxp/scripts/manifest-nxp.xml \
-b ${BRANCH}
Fetch layers in manifest:
repo sync
Next, initialize the build environment:
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.
Building the image
You can now proceed with building an image:
MACHINE=imx7s-warp bitbake core-image-base
Replace core-image-base
with your desired image target.
Using the build output
tmp/deploy/images/imx7s-warp/core-image-base-imx7s-warp.sdimg
tmp/deploy/images/imx7s-warp/core-image-base-imx7s-warp.mender
tmp/deploy/images/imx7s-warp/u-boot-dtb.imx
The disk image (with .sdimg
suffix) is used to provision the device storage for devices without Mender running already.
The u-boot.imx
file is used to provision the device with a Mender compatible U-Boot.
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 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.
Flash instructions
Based on the output artifacts described above we need to flash the u-boot.imx
and core-image-base-imx7s-warp.sdimg
separately to fully provision an device and for it to work with Mender.
Required software on the host PC:
- imx_usb_loader: GitHub - boundarydevices/imx_usb_loader: USB & UART loader for i.MX5/6/7/8 series
- dfu-util
- libusb
Setup WaRP7 for loading U-Boot
- Remove the CPU board from the base board then put switch 2 in the upper position
- Reconnect the CPU board to the base board
- Connect a USB to serial adapter between the host PC and WaRP7 (USB port on the base board)
- Connect a USB cable between the OTG WaRP7 port and the host PC (USB port on the CPU board)
Clone imx_usb_loader
:
git clone https://github.com/boundarydevices/imx_usb_loader
Change directory to imx_usb_loader
:
cd imx_usb_loader
Copy u-boot-dtb.imx
which was part of the Yocto/OE-core build output to imx_usb_loader
cp mender-nxp/build/tmp/deploy/images/imx7s-warp/u-boot-dtb.imx .
Open a terminal program such as microcom
:
sudo microcom --port=/dev/ttyUSB0 --speed=115200
Transfer u-boot.imx
to RAM and execute it. NOTE! This requires you to halt the boot process in U-Boot otherwise it will continue with the normal boot flow and requires a level of swiftness since the bootdelay
is only 3 seconds:
sudo ./imx_usb u-boot-dtb.imx
Then U-Boot should start and its messages will appear in the console program.
Use the default environment variables:
=> env default -f -a
=> saveenv
Run the DFU command:
=> dfu 0 mmc 0
Transfer u-boot.imx
that will be flashed into the eMMC:
sudo dfu-util -D u-boot-dtb.imx -a boot
The following message should be seen on the U-Boot prompt after a successful upgrade:
#DOWNLOAD … OK
Ctrl+C to exit …
Remove power from the WaRP7 board.
Put WaRP7 board into normal boot mode (put the switch 2 in the lower position)
Power up the board and the new updated U-Boot should boot from eMMC
Setup to update the image (.sdimg)
From U-Boot side:
=> ums 0 mmc 0
From Host side:
sudo dd if=core-image-base-imx7s-warp.sdimg of=/dev/sdX bs=1M && sudo sync
That is it, you can now power-cycle or reset the device and you should have
a Mender compatible image running on your device with the Mender client.
References
- The sources of the Yocto integration can be found in meta-mender-community/meta-mender-nxp
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!