Nezha Allwinner D1

Board description

Nezha is a AIoT development board customized by AWOL based on Allwinner’s D1-H chip. It is the world’s first mass-produced development board that supports 64bit RISC-V instruction set and Linux system.

URL: https://d1.docs.aw-ol.com/en/d1_dev/

Wiki: https://linux-sunxi.org/Allwinner_Nezha

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
scarthgap (5.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 has been verified.

Getting started

Prerequisites

  • A supported Linux distribution and dependencies installed on your workstation/laptop as described in the Yocto Development Manual
  • NOTE. Instructions depend on which Yocto version you intend to use.
  • kas installed and in your PATH.

Configuring the build

Setup Yocto environment

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

meta information.

mkdir mender-nezha && cd mender-nezha

Clone the meta-mender-community layer:

git clone https://github.com/mendersoftware/meta-mender-community \
  -b scarthgap

Setup build environment

Change into the cloned repository and create a directory to hold the build:

cd meta-mender-community
mkdir my-nezha
cd my-nezha

Use kas to set up the build structure:

kas shell ../kas/nezha-allwinner-d1.yml

This opens a sub-shell which is initialized for the build process. You can close it using the exit command.

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 mode, 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. To use Hosted Mender, add your tenant token and set the server URL like this:

MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "<copy token here>"

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

Building the image

You can now proceed with building an image:

bitbake core-image-base

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

Using the build output

After a successful build, the relevant images and build artifacts are:

  • tmp/deploy/images/nezha-allwinner-d1/core-image-base-nezha-allwinner-d1.sdimg
  • tmp/deploy/images/nezha-allwinner-d1/core-image-base-nezha-allwinner-d1.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 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 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.

References

  • The template files that are used by this setup can be found in mender-mender-community
  • The Mender integration layer for Raspberry Pi boards can be found in meta-mender-riscv.
  • The official Mender documentation 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!