iMX93 Industrial Mender

From Voipac Wiki
Jump to navigation Jump to search

This Wiki page describes Mender OTA updater integration into the Yocto Project for the iMX93 Industrial Development Kit. Mender is a secure, robust and industry leading software update system capable to handle a large number of devices.

Mender supports several extensions enabling features like Remote Terminal, Port Forward, File Transfer, and Device Configuration, together with the ability to monitor and alert.

The steps described on this Wiki page are primarily focused on complying Mender updater into the Yocto Project. The well written official Mender documentation covers all the other important aspects of this utility.

Prerequisites

In-depth information about the machine requirements can be found in the Yocto mega manual

Because the Mender utility will be integrated into the Yocto Project Release 5.0 (scarthgap), the Mender layer share the same steps for host machine setup as the Yocto Project.

To prepare the machine, follow the Yocto Project Prerequisites Wiki page.

Configuring the build

Setup Yocto environment

Clone repo:

git clone https://github.com/voipac/yocto-imx-voipac.git

Checkout mender branch:

cd yocto-imx-voipac
git checkout origin/imx93-mender

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, due to lack of server configuration.

Edit the conf/local.conf file to provide the Mender server configuration, ensuring that the generated images and Mender Artifacts are connecting to the Mender server. There should already be a commented section in the generated conf/local.conf file. A simple uncommenting the relevant configuration and assigning appropriate values sets up the server sufficiently.

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

Building the image

You can now proceed with building an image:

build_image.sh

or if you want to use docker container for building run:

build_image_container.sh

Using the build output

After a successful build, the images and build artifacts are placed in tmp/deploy/images/imx93-voipac/ directory.

The disk image (with .sdimg.zst suffix) is used to provision the storage for devices without Mender already running. Please proceed to the official documentation on provisioning a new device for steps to do so.

On the other hand, if Mender has already been running on the device and want to deploy a rootfs update using this build, the Mender Artifact files, with .mender suffix, can be used instead. This Artifact can either be deployed in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client standalone mode.

Flashing instructions

For flashing to eMMC we need to use uuu utility which must be installed on your host computer (mfgtools. Also due issue with emmc boot we split flashing to 2 parts. First we use imx-boot without mender integration and the we replace imx-boot in eMMC with one with mender integration. All is prepared in convenient script imx93 mender flashing

Copy image + imx-boot to custom directory

cp yocto-imx-voipac/build/tmp/deploy/images/imx93-voipac/voipac-image-imx93-voipac.sdimg.zst yocto-imx-voipac/flashing
cp yocto-imx-voipac/build/tmp/deploy/images/imx93-voipac/imx-boot yocto-imx-voipac/flashing
  1. make copy of mender imx-boot
cd yocto-imx-voipac/flashing
cp -f imx-boot imx-boot-flash-mender

Prepare board to serial download mode Setup S1 pin to Serial download mode and connect imx93 board to you PC using USB-C cable.

Run flashing script:

./flash-mender.sh

After all is done you can unplugged USB-C and power on your board with mender integrated.