Quantcast
Channel: Boundary Devices
Viewing all 391 articles
Browse latest View live

i.MX 8M Plus SoM Demos – Machine Learning and Multiple Displays

$
0
0

The i.MX 8M Plus processor from NXP contains some notable differences from the i.MX 8M and i.MX8M Mini predecessors:

  1.  Integrated Neural Processing Unit (NPU)
  2. LVDS display support
  3. Integrated CAN 
  4. Built-in Dual Camera ISP 

The Nitrogen8M Plus System on Module was designed to take advantage of these new features.

In the 2 demos below, we demonstrate the NPU capabilities of the i.MX 8M Plus processor as well as show the additional LVDS output while driving multiple displays.

Demo #1 Object Detection

In this demo, we demonstrate the object detection performance of the i.MX 8M Plus compared to a strict CPU method.  We also show how the NPU can quickly detect various options utilizing a USB camera.

Demo #2 Multiple Displays

In this demo, we show 2 different displays – 1 via LVDS and the 2nd via HDMI – being driven at the same time with independent content.

Please visit the Nitrogen8M PLUS SOM page for more information:  Nitrogen 8M Plus SOM

 

 

The post i.MX 8M Plus SoM Demos – Machine Learning and Multiple Displays appeared first on Boundary Devices.


Using the OptConnect ema Modem with Nitrogen8M

$
0
0

We are pleased to announce support for the OptConnect ema Smart Embedded Modem on our Nitrogen8M board! We will discuss how to connect the modem via USB to the Nitrogen8M using a mPCIe adapter card, as well as instructions on how to do some basic testing of the modem. Once ema is connected, you get an enterprise grade, fully-managed connection from OptConnect’s award winning service.

More information on the modem can be found here

Hardware Installation

As mentioned, the modem connects via USB using this mPCIe adapter. The connection to the Nitrogen8M is shown below:

Software Installation 

This testing was done with our latest yocto image found here

Testing whether the system recognizes the modem

The modem will be recognized as a USB device under Linux. You can check the presence of the modem using lsusb:

root@nitrogen8m:~# lsusb
Bus 002 Device 002: ID 045b:0210 Hitachi, Ltd 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 1bc7:0036 Telit Wireless Solutions 
Bus 001 Device 005: ID 10c4:ea70 Silicon Labs CP2105 Dual UART Bridge
Bus 001 Device 004: ID 0424:2412 Microchip Technology, Inc. (formerly SMSC) 
Bus 001 Device 002: ID 045b:0209 Hitachi, Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

As you can see, the Nitrogen8M recognizes the Telit modem (1bc7:0036).

Now that we validated the modem is recognized as a usb device, you can validate that it is detected by modemmanager:

root@nitrogen8m:~# mmcli -L
/org/freedesktop/ModemManager1/Modem/0 [Telit] LE910-NA V2

And you can see more details of the modem with mmcli -m:

root@nitrogen8m:~# mmcli -m 0
--------------------------------
General | dbus path: /org/freedesktop/ModemManager1/Modem/0
| device id: 9eeb9dfa3d73e64418d4257a000cdfe4c207c4d1
--------------------------------
Hardware | manufacturer: Telit
| model: LE910-NA V2
| firmware revision: 20.00.506
| supported: gsm-umts, lte
| current: gsm-umts, lte
| equipment id: 358148062963801
-------------------------------
System | device: /sys/devices/platform/soc@0/38200000.usb/xhci-hcd.0.auto/usb1/1-1/1-1.4/1-1.4.2
| drivers: cdc_acm, cdc_ncm
| plugin: Telit
| primary port: ttyACM0
| ports: ttyACM1 (unknown), ttyACM3 (unknown), ttyACM5 (unknown), 
| wwan0 (net), ttyACM2 (unknown), ttyACM4 (unknown), ttyACM0 (at)
--------------------------------
Status | unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: registered
| power state: on
| access tech: lte
| signal quality: 71% (recent)
--------------------------------
Modes | supported: allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 3g, 4g; preferred: none
| current: allowed: 3g, 4g; preferred: none
--------------------------------
Bands | supported: utran-5, utran-2, eutran-2, eutran-4, eutran-5, eutran-12, 
| eutran-13, eutran-17
| current: utran-2, eutran-2
--------------------------------
IP | supported: ipv4, ipv6, ipv4v6
--------------------------------
3GPP | imei: 358148062963801
| operator id: 310410
| operator name: AT&T
| registration: home
--------------------------------
3GPP EPS | ue mode of operation: csps-1
--------------------------------
SIM | dbus path: /org/freedesktop/ModemManager1/SIM/0

We can also start a screen serial console application to communicate with the modem on ttyACM0 (primary AT port of the modem, as shown above).

root@nitrogen8m:~# screen /dev/ttyACM0 115200

Now you get an empty console screen. If local command echo is not set, then type ATE1 to the modem blindly, which will enable command echo. You can now talk to the modem via AT commands found in this document

For example, we can get the modem serial number:

AT+GSN
0000675966
OK

Viewing the modem status in OptConnect Summit Portal

Once you purchase a modem, you can call OptConnect with an ema serial number and they will set you up with an account.  The account can also be set up at the same time an order is placed. Once you have the modem linked with an account, you can login to the portal and view your device:

We can see the device online and view its status:

More information on OptConnect ema

You can find more information on OptConnect ema via the following links:

The Creation of OptConnect ema™

Is OptConnect ema™ the Right Fit for Me? Get the answers you need

ema:Play – Questions and answers WITH MATT VOIGT ON

If you have any issues, please email support@boundarydevices.com

The post Using the OptConnect ema Modem with Nitrogen8M appeared first on Boundary Devices.

Yocto Dunfell Release for i.MX6/i.MX7 Platforms

$
0
0

We are pleased to announce a new Yocto release Dunfell for our Nitrogen6/7 family of SBCs and SOMs based on i.MX6/7 processors. This release includes our latest 5.4 kernel. Below you will find the download link for the images as well as detailed instructions for the build including a features set.

For the Impatient

You can download the Yocto images from here:

Update 20200829 changelog:

  • Various updates to Uboot

Update 20201102 changelog:

  • Updated kernel to version 5.4.70
  • Added some useful tools to boundary-image-multimedia-full

As usual, you’ll need to register on our site and agree to the EULA because it contains NXP content.

How to Burn

You can program the SW to eMMC using the instructions below:

programming-emmc-on-i-mx6/7

You can also program the SW to SD Card or USB Stick via zcat and dd under Linux:

~$ zcat *boundary-image*.wic.gz | sudo dd of=/dev/sdX bs=1M

In addition, you can use the balenaEtcher utility to flash the eMMC, SD Card or USB stick via Windows or Linux:

balenaEtcher 

Build procedure

This image uses the dunfell branch of our boundary-bsp-platform repository. 

To build the image, we recommend using a Docker Container so that you can build with a reproducible and stable build environment. Otherwise, you’ll need these packages installed as well as this repo tool that can be installed like this:

~$ sudo apt-get install repo

Then create your build directory and initialize everything.

~$ mkdir ~/yocto-dunfell && cd yocto-dunfell
~/yocto-dunfell$ repo init -u https://github.com/boundarydevices/boundary-bsp-platform -b dunfell
~/yocto-dunfell$ repo sync

Next, setup the environment for building. In this image, we will be building our boundary-wayland distro for the target machine

~/yocto-dunfell$ MACHINE=<MACHINE> DISTRO=boundary-wayland . setup-environment build

Now bitbake boundary-image-multimedia-full which is equivalent to fsl-image-multimedia-full with Boundary-specific packages such as BD-SDMAC support.

~/yocto-dunfell/build$ bitbake boundary-image-multimedia-full

After some time this should build the same image as above, with the layers being at commits as per the time when repo sync was executed. If you are interested in each project revision at the time of the build, you can find a frozen manifest for those images here.

The image file will deploy to tmp/deploy/images/{MACHINE}/boundary-image-multimedia-full-{MACHINE}.wic.gz.

Features List

The images built above contains the following components:

  • Weston 8.0.0 for i.MX
  • GStreamer1.0 1.16.2
  • GPU Vivante libraries 6.4.0p2.0
  • VPU libraries 5.4.39.2
  • Firmware-imx 8.5
  • qcacld-lea-2.0 Wi-Fi driver for BD-SDMAC
  • BlueZ 5.54 with support for BD-SDMAC

The next sub-sections will describe how to test most features.

GPU acceleration

In order to test the GPU, you can either use the standard Weston EGL programs or the ones provided by Vivante.

Here are a few examples:

root@<MACHINE>:~# weston-simple-egl &
root@<MACHINE>:~# cd /opt/viv_samples/vdk/
root@<MACHINE>:/opt/viv_samples/vdk# ./tutorial7

Nitrogen8M GPU

Camera input

Camera MIPI-CSI input can be checked using our Nit6X_5MP_MIPI with GStreamer:

root@<MACHINE>:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1 ! autovideosink;

nitrogen8m-camera

VPU decoding

Here is an example using GPlay tool:

root@<MACHINE>:~# wget http://linode.boundarydevices.com/videos/Hobbit-1080p.mov
root@<MACHINE>:~# gst-launch-1.0 playbin uri=file:///home/root/Hobbit-1080p.mov video-sink=imxipuvideosink

VPU encoding

Here is an example using gstreamer:

root@<MACHINE>:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1 ! imxvpuenc_h264 bitrate=10000 ! filesink location=test.mp4

Ethernet

Once the eth0 interface is up, you can use iperf3 to check Ethernet performances:

root@<MACHINE>:~# iperf3 -c 192.168.1.60                                                                                                                         
Connecting to host 192.168.1.60, port 5201
[  5] local 192.168.1.13 port 32880 connected to 192.168.1.60 port 5201
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec    0             sender
[  5]   0.00-10.04  sec  1.09 GBytes   932 Mbits/sec                  receiver

Wi-Fi

Same goes for the Wi-Fi that can be tested just as easily:

root@<MACHINE>:~# nmcli d wifi connect <network_name> password <password>
root@<MACHINE>:~# iw wlan0 link
Connected to a4:3e:51:08:54:f6 (on wlan0)
        SSID: Jabu_5GHz
        freq: 5240
        RX: 3243 bytes (31 packets)
        TX: 9117 bytes (48 packets)
        signal: -79 dBm
        tx bitrate: 15.0 MBit/s MCS 0 40MHz short GI
root@nitrogen8mm:~# ping google.com -Iwlan0                                                                                                                       
PING google.com (216.58.198.206): 56 data bytes
64 bytes from 216.58.198.206: seq=0 ttl=55 time=3.470 ms
...

Bluetooth

For products with a Silex bluetooth module, you’ll be able to connect using our handy silex-uart script with the following commands:

root@<MACHINE>:~# /usr/share/silex-uart/silex-uart.sh start
Starting silex-uart
rfkill on/off cycle.
silex found
root@<MACHINE>:~# hciconfig hci0 up
root@<MACHINE>:~# hcitool scan
Scanning ...
11:22:DE:AD:BE:EF    Some Device

CAN

CAN is supported on Nitrogen6 MAX. You’ll be able to bring up the interface using these commands:

root@<MACHINE>:~# ip link set can0 up type can bitrate 500000
root@<MACHINE>:~# ifconfig can0 up

From this point, you can use commands such as cansend and candump to send or display messages on the bus respectively.

 

If you have any issues, please email support@boundarydevices.com

The post Yocto Dunfell Release for i.MX6/i.MX7 Platforms appeared first on Boundary Devices.

Ubuntu Focal 20.04 LTS for Nitrogen8M and Nitrogen8M Mini boards – August 2020 (kernel 5.4.x)

$
0
0

Ubuntu 20.04 Weston/Wayland Compositor

We’re glad to release our first Ubuntu Focal image for Nitrogen8MQ and Nitrogen8M Mini board. Since this board supports only Wayland graphical backend, the system is simpler than earlier systems with i.MX6.

We use Weston, the reference Wayland compositor in this system.

This image is a console developer image also, it boots to the command prompt. Weston compositor could be started manually or you can set autostart the service, as per your preference.

This system contains NXP/Freescale licensed content, so you will need to register on our web-site and log in before you can accept the license agreement and download the images from here:

Nitrogen8M board:

Nitrogen8M Mini board:

Important !

Before installing this image please check your U-Boot version as it requires U-Boot version 2018.07  to be used.

Make sure to visit our wiki if you need to upgrade:

You can find the bootscript in the /boot subdirectory now, its named boot.scr. The partition labels are set if you use the fastboot method.

If you use your own method please check the boot partition labels, because the fstab boots by label (LABEL=sys-0Ch for example) now. You can use e2label to modify partition label.

Programming the image

Since the Nitrogen8M board has no SD card slot, you need to program this image in the same way as an Android  system: by using fastboot.

Please install the following packages on your desktop PC, Debian or Ubuntu :

$ sudo apt update
$ sudo apt install fastboot android-tools-fastboot

To avoid using sudo for each command, please download the following file and move it to the /lib/udev/rules.d directory, then reboot your PC: 

Now connect your Nitrogen8M board’s J67 USB OTG port to your PC’s USB port.

Use regular USB2.0 OTG cable do not use USB3.0 cable (as it seems to be problematic with U-Boot).

Connect the Nitrogen board’s RS232 console to your PC so you can communicate with the board.

You can then power up the Nitrogen8M board, and stop the u-boot execution by pressing any key. Then type:

Hit any key to stop autoboot: 0
=> fastboot 0

Now test the USB connection on the PC, please type on the PC:

$ sudo fastboot devices -l
 fastboot usb-x:y

If you get the above response, a MAC address , the word fastboot, then the USB device:id numbers, the communication is OK.

Now type on PC:

$ sudo fastboot flash gpt gpt_8G.img
$ sudo fastboot flash rootfs rootfs_8G.simg

, then wait till its completed.

When its done you can disconnect USB cable, and restart your Nitrogen8M board.

Note that you can also use fastboot from a Windows Host PC, see following blog post to learn how:

https://boundarydev2.wpengine.com/android-tools-windows-support-nitrogen-platforms/


Since the Nitrogen8M_Mini board has an SD card slot, not like Nitrogen8M, you can create an SD car similarly to i.MX6 boards.

The image is a slightly-less-than-4GiB image file containing the partition table.  Inspired by ubuntu-mate.org, I changed over from dd to another disk copy program called ddrescue. It is a much more talkative program, although dd does do it’s job honestly. I don’t like mute programs, you never know whats happening in a given moment. For example, if you want to create an SD card for a console image, you need to do the following :

$ sudo apt-get install gddrescue xz-utils util-linux
$ gunzip 20200806-nitrogen8mm-5.4.x_2.1.0_ga-focal-en_US-console-weston_aarch64.img.gz
$ sudo ddrescue -D --force 20200806-nitrogen8mm-5.4.x_2.1.0_ga-focal-en_US-console-weston_aarch64.img /dev/sdX

You have to replace sdX with your actual SDHC reader/writer device. Use the lsblk command to check it.

Type lsblk with unplugged SDHC reader, then insert the device, and type lsblk again. A new node will be added , that is your SDHC reader/writer device.


Usernames and passwords

Two users are defined for use on the system: ubuntu and root. The password for each is Boundary (capital B). The user ubuntu has administrator rights, but doesn’t need to enter password at sudo command.

We wanted to make life easier at the cost of some security. If you want to change this please type:

ubuntu@focal-dev64:~$ sudo visudo

, and comment out or delete the last line with “ubuntu” and “NOPASSWD:”

An ssh server is configured on the system, though it does not allow password-based authentication for user root.

User ubuntu has sudo privileges, so you can place your ssh public key (normally $HOME/.ssh/id_rsa.pub) to the system like so :

ubuntu@focal-dev64:~$ sudo mkdir /root/.ssh
ubuntu@focal-dev64:~$ sudo nano /root/.ssh/authorized_keys
... paste content of $HOME/.ssh/id_rsa.pub here
ubuntu@focal-dev64:~$ sudo chmod 600 /root/.ssh/auth*
ubuntu@focal-dev64:~$ sudo chmod 600 /root/.ssh/

What’s supported

Since the images above include our stable 5.4.x kernel, essentially everything is supported including :

  • Vivante GPU accelerations for Wayland
  • The Hantro Video Processing Unit supports the following decoders:
    • video/x-h265 (8MQ + 8MM)
    • video/x-vp9 (8MQ + 8MM)
    • video/x-h264 (8MQ + 8MM)
    • video/x-vp8 (8MQ + 8MM)
    • video/x-vp6-flash (8MQ)
    • video/mpeg (8MQ)
    • video/x-h263 (8MQ)
    • video/x-flash-video (8MQ)
    • video/x-divx (8MQ)
    • video/x-xvid (8MQ)
    • video/x-cavs (8MQ)
    • video/x-wmv (8MQ)
    • video/x-pn-realvideo (8MQ)
    • video/x-raw (8MQ + 8MM)
  • The Hantro Video Processing Unit supports the following encoders:
    • video/x-h265 (8MM)
    • video/x-vp9 (8MM)
    • video/x-h264 (8MM)
    • video/x-vp8 (8MM)
  • Wi-Fi and Bluetooth modules for the built-in Silex module
  • All kind of storage devices , eMMC, SATA hdd (via USB3-SATA adapter), USB3.0/2.0 pen drives, mini PCIe devices, cell modems
  • All of our supported touch panels

The packaging (inluding kernel) is done in the normal debian way, so apt-get update/dist-upgrade will keep your image up and running the latest as patches come out.

What’s new in this release

The Linux kernel was upgraded to 5.4.50 ( meta-package name: linux-boundary-18f )
GPU driver was upgraded to Vivante 6.4.0p2.4 ( meta-package name: imx-gpu-viv-f17-… ).
The module galcore (CONFIG_MXC_GPU_VIV) was removed from the kernel, and it’s an externally built module. This change makes the graphics system modular, and more upgradeable, at the price of longer kernel upgrading time. Upgrading kernel takes about 3-4 minutes now, instead of 30 seconds, because every kernel upgrade rebuilds the galcore driver from sources, because its a DKMS module.
The NXP/Vivante GPU SDK was added : imx-gpu-sdk 4.0.2 . You can get the source with the usual apt-get source command. The SDK has many new demos, for example OpenCL, OpenVG, and for OpenVX and Vulkan.
The distribution is Focal 20.04 LTS . Here are some main component versions :

  • Xorg server 1.20.8-2ubuntu2.2
  • gstreamer1.0 1.16.2
  • bluez 5.53-0ubuntu3
  • qcacld-lea-2.0 Wi-Fi driver for BD-SDMAC
  • VPU Hantro libraries v1.18.0
  • Qt5 5.12.8
  • apt 2.0.3
  • dpkg 1.19.7ubuntu3.1
  • gcc/g++ 9.3.0-1ubuntu2
  • libwayland 1.18.0
  • weston 6.0.1
  • Silex WiFi / Bluetooth is supported in Focal also, as well as in Bionic and Buster.

 

Weston playing video via gstreamer.


 

Running the glmark2 GPU Benchmark


The system boots to the command prompt, as I mentioned before. You can start Weston compositor on any tty (not ssh, not RS232) terminal by typing:

ubuntu@focal-dev64:~$ wl
or
ubuntu@focal-dev64:~$ weston-launch

If you want to start Weston at boot automatically, you have to enable the service, you have to type the following:

ubuntu@focal-dev64:~$ sudo systemctl unmask weston.service
ubuntu@focal-dev64:~$ sudo systemctl enable weston.service

If you want to disable the autostart again you need to type:

ubuntu@focal-dev64:~$ sudo systemctl disable weston.service
ubuntu@focal-dev64:~$ sudo systemctl mask weston.service

You can find the weston.ini file in the /usr/share/weston/examples directory. Please type:

ubuntu@focal-dev64:~$ man weston.ini

,to check the options, and feel free to modify it to suit your needs.

Weston keyboard bindings

The Weston desktop shell has a number of keyboard shortcuts. They are listed here.

Almost all keyboard shortcuts for Weston include a specified modifier mod key which is determined in the file weston.ini (5):

binding-modifier={none | ctrl | alt | super}
The super key is in between and , usually a key.

mod + Shift + F
Make active window fullscreen

mod + K
Kill active window

mod + Shift + M
Maximize active window

mod + PageUp, mod + PageDown
Zoom desktop in (or out)

mod + Tab
Switch active window

mod + Up, mod + Down
Increment/decrement active workspace number, if there are multiple

mod + Shift + Up, mod + Shift + Down
Move active window to the succeeding/preceding workspace, if possible

mod + F1/F2/F3/F4/F5/F6
Jump to the numbered workspace, if it exists

Ctrl + Alt + Backspace
If supported, terminate Weston. (Note this combination often is used to hard restart Xorg.)

Ctrl + Alt + F
Toggle if Weston is fullscreen; only works when nested under a Wayland compositor

Ctrl + Alt + S
Share output screen, if possible

Ctrl + Alt + F1/F2/F3/F4/F5/F6/F7/F8
Switch virtual terminal, if possible

super + S
Make a screenshot of the desktop

super + R
Start or stop recording video of the desktop

Weston touch / mouse bindings

There are also a number of bindings involving a mouse:

, ,
Activate clicked window

super + Alt +
Change the opacity of a window

mod +
Zoom/magnify the visible desktop

mod +
Click and drag to move a window

mod + Shift + , mod + , mod +
Click and drag to resize a window

mod +
Rotate the window (if supported)


As always, please give us some feedback and let us know how things work for you.

The post Ubuntu Focal 20.04 LTS for Nitrogen8M and Nitrogen8M Mini boards – August 2020 (kernel 5.4.x) appeared first on Boundary Devices.

Customizing Ubuntu/Debian kernels on i.MX8 boards

$
0
0

This post is a modification of Customizing Ubuntu/Debian kernels on i.MX6/7 boards to make it work on i.MX8 boards also.

Also I try to give you a guide how to modify and customize the system image on the host PC before installing it on SD card. You can automatize the process if you want and you’ll get the a customized and ready to work system image as result.

1. Preparing and building kernel

As usual, the first step is cloning and building the kernel as it was described earlier in our Cross Compiling Kernels post:

~/$ git clone https://github.com/boundarydevices/linux-imx6.git linux-imx8 && cd linux-imx8
~/linux-imx8$ export KERNEL_SRC=$PWD
~/linux-imx8$ export INSTALL_MOD_PATH=$KERNEL_SRC/ubuntunize64/linux-staging
~/linux-imx8$ export ARCH=arm64
~/linux-imx8$ export CROSS_COMPILE=aarch64-linux-gnu-
~/linux-imx8$ git checkout boundary-imx_4.14.x_2.0.0_ga
~/linux-imx8$ make -C ubuntunize64 prerequisites 
~/linux-imx8$ make boundary_defconfig
... make your customization, code or configuration changes here.
~/linux-imx8$ make Image modules dtbs -j8
~/linux-imx8$ make -C ubuntunize64 tarball
~/linux-imx8$ cd ..

Let’s see line by line:

  1.  Clone Boundary’s linux-imx6 repository. We clone it into a renamed directory, “imx6” would be confusing
  2.  Set KERNEL_SRC variable, it’s needed for building modules.
  3.  Set INSTALL_MOD_PATH variable, it’s needed for installing modules here and later too.
  4.  Set the target architecture. It’s arm64 now.
  5.  Set the CROSS_COMPILE prefix.
    • We recommend using the official cross-toolchain that comes with Ubuntu/Debian.
  6.  Checkout the kernel branch you need. At the time of this writing, you can choose between the following versions (later this list might be extended): 
    • 4.9.x_2.0.0_ga
    • 4.14.x_2.0.0_ga
    • 4.19.x_1.1.0_ga
    • 5.4.x_2.1.0_ga
  7.  Install the arm64 cross-toolchain.
  8.  Create the config file. If you have one of these boards, you need to use boundary_defconfig. Custom designs have their own specific defconfig.
  9.  Now you can customize the kernel configuration by running make menuconfig enable/disable options/modules as you wish. 
  10.  Build the kernel image (Image), the modules (.ko) and the device tree blob (.dtb) files using 8 CPU cores. The kernel image is usually uncompressed on arm64 platform, not zImage but Image.
  11.  This command copies the new files in a directory named linux-staging, and then creates a tarball of it.
    • Although the folder name is “ubuntunize64”, this process also works with Debian images.
    • The kernel’s tarball is placed into the ubuntunize64/ directory, and is named with the kernel version and localversion. If you modified the kernel source, then a -dirty flag will be appended to the name.
~/linux-imx8$ ls -l ubuntunize64
total 12828
-rwxrwxr-x 1 tele tele      573 Aug 26 00:43 apt-upgrade.sh
-rw-rw-r-- 1 tele tele     2194 Aug 26 01:25 common.mk
-rwxrwxr-x 1 tele tele      171 Aug 26 00:43 create-initrd.sh.in
-rwxrwxr-x 1 tele tele     1989 Aug 26 01:28 customize-kernel.sh
-rw-rw-r-- 1 tele tele 13096839 Aug 26 02:09 linux-4.14.98-g90af3cd4ee6e.tar.gz
drwxrwxr-x 4 tele tele     4096 Aug 26 02:09 linux-staging
-rw-rw-r-- 1 tele tele     2179 Aug 26 02:08 Makefile
-rw-rw-r-- 1 tele tele     2870 Aug 26 00:43 Merge.mk
-rw-rw-r-- 1 tele tele      133 Aug 26 01:27 pbuilderrc
-rwxrwxr-x 1 tele tele      479 Aug 26 00:43 uninstall-kernel.sh

2. Building galcore and other modules

The galcore is a kernel module which is necessary to run Vivante GPU acceleration packages. Since the galcore module version must match exactly the version of the libraries in the rootfs, it is important to be able to build it independently from the kernel. 

Here is the procedure to generate the module using the version of your choosing.

~/$ git clone https://github.com/Freescale/kernel-module-imx-gpu-viv.git && cd kernel-module-imx-gpu-viv
~/kernel-module-imx-gpu-viv$ git checkout upstream/6.2.4.p4.6
~/kernel-module-imx-gpu-viv$ sed 's,-Werror,-Werror -Wno-error=misleading-indentation,g' -i ./kernel-module-imx-gpu-viv-src/Kbuild
~/kernel-module-imx-gpu-viv$ make -j8
~/kernel-module-imx-gpu-viv$ make modules_install
~/kernel-module-imx-gpu-viv$ cd ..

Before you start building this module you have to select the proper galcore version, it could be 6.2.4.p4.0 or 6.2.4.p4.6 or 6.4.0.p2.4 or another version in the future.

It depends on rootfs you are going to use, so you have to check that first. Please boot the original Ubuntu/Debian system (what you are going to modify) on your board. Open a console window and type:

~/$ dp imx-gpu-viv

In the 2nd column you’ll find the version. 

  1. Checkout the kernel branch you need. Possible versions are: 
    • 6.2.4.p4.0
    • 6.2.4.p4.6
    • 6.4.0.p2.4

Here is the line by line details of the procedure:

  1.  Clone the galcore repository from Freescale’s Github.
  2.  Set the matching branch as described above.
  3.  This sed command is only necessary if you use gcc 6 or higher, which will be used in Debian Stretch for instance.
    • This is a new kind of warning, but it would be considered as error, because of strict module building rules, so it must be disabled.
  4.  In this line we build the module. You don’t need to worry about KERNEL_SRC variable, because it was set earlier. We use 8 CPU cores.
  5.  Install the galcore module in place. You don’t need to worry about INSTALL_MOD_PATH variable, it was set earlier.
    • The module will be copied to a directory named extra.

Similarly to galcore, you can build any other kernel modules. For example if you have a Silex WiFi module, you’ll have to build it’s driver as follows:

~/$ git clone https://github.com/boundarydevices/qcacld-2.0.git && cd qcacld-2.0
~/qcacld-2.0$ export CONFIG_CLD_HL_SDIO_CORE=y
~/qcacld-2.0$ git checkout boundary-LNX.LEH.4.2.2.2
~/qcacld-2.0$ make -j8
~/$qcacld-2.0 make modules_install
~/qcacld-2.0$ cd ..

Based on the above examples you can build your own kernel modules as well. Fetch your sources to a working directory, set your environment variables and build flags as necessary, then simply run make and make modules_install. The environment variables KERNEL_SRC and  INSTALL_MOD_PATH has already been set earlier, you don’t need to worry about them.

After you have built all modules you wanted you need to refresh the tarball:

~/$ make -C $KERNEL_SRC/ubuntunize64 targz

3. Merging rootfs with kernel and modules

In this step we will merge the new kernel and modules and the original rootfs to a complete image tarball. I assume that you have already downloaded a Ubuntu or Debian system image from this page, (after selected your board):

You have two options to merge the new kernel parts into the image; either on the target or on the host PC.

3.1 Merging on the target

Please create the SD card as usual, as described in the paragraph “Programming the image” in the system image’s blog post.

Then copy the tarball file what you have just created (linux–.tar.gz) to the SD card’s ${HOME} directory. Don’t forget to type sync to finish copy. Now insert the card in the target board’s socket, and boot the new system up. After booting please do this:

~/$ rmlinux
~/$ sudo apt-get purge qcacld-module
~/$ sudo tar --numeric-owner -xf ${HOME}/linux-4.14.98-g90af3cd4ee6e.tar.gz -C /
~/$ sudo update-initramfs -c -k4.14.98-g90af3cd4ee6e
~/$ sudo apt-get update && sudo apt-get dist-upgrade
~/$ sync && sudo reboot
  1. Uninstall the old kernel first
  2. Extract the new kernel
  3. Create an initrd.img ramdisk
  4. Refresh the system, this is optional, it might take about 15-20 minutes
  5. Reboot

As always, let us know how/if this works for you.

The post Customizing Ubuntu/Debian kernels on i.MX8 boards appeared first on Boundary Devices.

Buildroot 2020.08 release for i.MX platforms

$
0
0

//

Buildroot 2020.08 has just been published and we’re glad to provide new images!Buildroot

It has been a long time since our last release due to missing i.MX 8M features but today marks the first of many releases for all our platforms.

For the impatient

You can download pre-built Buildroot 2020.08 images from here:

In order to flash those images you can either follow our video on this topic:

Or for those fluent in command lines, you can simply use zcat:

~$ zcat 2020*br2020.08-nitrogen*.img.gz | sudo dd of=/dev/sdX bs=1M

What’s new?

Buildroot 2020.08 release

It would be too long of a list to enumerate all the changes Buildroot went through since last release.

For recent changes, we invite you to check the last release announcement:

We’ll focus on the i.MX changes for this release in the next sections.

Boundary Devices layer

We still provide our own Boundary Devices external layer in order to include proprietary bits like WiFi/BT driver/firmware:

This includes the following custom configurations

New features

Buildroot 2020.08 includes the following versions of packages:

  • BlueZ5 5.54
  • GStreamer 1.16.2
  • GStreamer-imx v0.13.0 for i.MX6
  • GStreamer-imx v2.0 for i.MX8M*
  • imx-codec 4.3.5
  • imx-gpu-viv 6.4.0.p2.4
  • imx-vpu-hantro 1.15.0 for i.MX8M*
  • imx-vpu 5.4.39.1 for i.MX6
  • Linux kernel 5.4.x_2.1.0
  • qcacld-2.0 LEA-2.0 Wi-Fi driver
  • Qt5 5.15.0
  • Wayland 1.18.0
  • Weston 8.0.0

Regarding i.MX8M support, 3 patches unfortunately didn’t hit the master branch for this release in order to properly support Weston. Hopefully those will be merged for next Buildroot release so we don’t need a fork on Github.

There are a few differences between Yocto and Buildroot releases at this stage:

  • Buildroot images use standard packages without NXP modifications
    • This applies to GStreamer, Weston, libdrm, wayland etc…
    • The main drawback is that Weston can’t be used with G2D
    • The (big) advantage is that it makes the codebase much easier to maintain, being able to use all the latest packages without having to be stuck at an earlier version chosen by NXP
  • Open-source gstreamer-imx plugin is used instead of NXP forks
    • This allows us to have imx-related changes for GStreamer in 1 package only

Build procedure

Just like our Yocto image, we now use a Docker file to build our images on our Jenkins server so that everyone can use the exact same environment. This ensures reproducible builds without having to think about missing dependencies.

If interested in using this approach, we invite you to read the following blog post using the following docker file:

Otherwise you can follow Buildroot documentation to know the host requirements:

Once your development environment is setup properly, you can 

  1.  Download the source code. To ease the repo cloning process, we decided to create a manifest to match what is done for Yocto/Android:
~$ sudo apt-get install repo
~$ mkdir ~/br2020.08 && cd br2020.08
~/br2020.08$ repo init -u https://github.com/boundarydevices/buildroot-manifest -b 2020.08.x
~/br2020.08$ repo sync
  1. Create an output folder for your configuration:
~/br2020.08$ make BR2_EXTERNAL=$PWD/buildroot-external-boundary/ 
  -C $PWD/buildroot/ O=$PWD/output nitrogen8mm_qt5_gst1_defconfig
~/br2020.08$ cd output
  1. Build the image
~/br2020.08/output$ make
  1. Your image is now ready!
~/br2020.08/output$ ls -l images/sdcard.img
~/br2020.08/output$ sudo dd if=images/sdcard.img of=/dev/sdX bs=1M

Testing the image

As usual, the login for this image is root with no password.

The external repository README details many commands that can be tested on the image.

Since i.MX8M support is new, we will detail some of the commands here.

  • Once booted up, the Weston desktop should appear automatically, from there you can start a 3D test to ensure GPU acceleration
# cd /usr/share/examples/viv_samples/vdk/
# ./tutorial7 -h 720

  • Then you can start the Qt5 Cinematic Demo which is a known GPU stress-test as it includes many effects
# CinematicExperience-demo -platform wayland
    • Here you might need to adapt the demo resolution, here are the commands used for our 1280×800 MIPI display
# sed -i 's/1920/1280/' /usr/share/Qt5/CinematicExperience/Qt5_CinematicExperience.qml
# sed -i 's/1080/720/' /usr/share/Qt5/CinematicExperience/Qt5_CinematicExperience.qml

  • You can also check the GStreamer VPU acceleration by decoding the well known Big Buck Bunny video
# wget http://linode.boundarydev2.wpengine.com/videos/trailer_1080p_h264_mp3.avi -P /root/
# gst-launch-1.0 filesrc location=/root/trailer_1080p_h264_mp3.avi ! 
  decodebin ! waylandsink

  • If you have our OV5640 5MP MIPI camera, you can check the GStreamer video capture
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! 
  waylandsink

  • As for Wi-Fi connectivity, the image embeds the minimum to get you started
# wpa_passphrase MYSSID MYPASSWORD >> /etc/wpa_supplicant.conf
# /etc/init.d/S50wpa-supplicant stop
# sleep 1
# /etc/init.d/S50wpa-supplicant start

# iw wlan0 link
Connected to a4:3e:51:08:54:f6 (on wlan0)
SSID: MYSSID
freq: 5660
RX: 47685 bytes (747 packets)
TX: 2054 bytes (0 packets)
signal: -58 dBm
tx bitrate: 150.0 MBit/s MCS 7 40MHz short GI
# udhcpc -i wlan0
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.1.46
udhcpc: lease of 192.168.1.46 obtained, lease time 86400
deleting routers
adding dns 192.168.1.1
# ping google.com -I wlan0
PING google.com (216.58.198.206): 56 data bytes
64 bytes from 216.58.198.206: seq=0 ttl=116 time=6.971 ms
64 bytes from 216.58.198.206: seq=1 ttl=116 time=13.145 ms
...
  • Finally, if you want to use Bluetooth connectivity, the procedure goes as follows
# echo 0 > /sys/class/rfkill/rfkill0/state
# sleep 1
# echo 1 > /sys/class/rfkill/rfkill0/state
# hciattach /dev/ttymxc0 qca 2000000 -t30 flow
Current Product ID: 0x00000008
Current Patch Version: 0x0111
Current ROM Build Version: 0x0302
Current SOC Version: 0x00000023
qca_soc_init: Rome Version (0x03020023)
====================================================
TLV Type               : 0x1
Length                 : 48668 bytes
Total Length           : 48412 bytes
Patch Data Length      : 48388 bytes
Signing Format Version : 0x1
Signature Algorithm    : 0x2
Event Handling         : 0x3
Reserved               : 0x0
Product ID             : 0x0008
Rom Build Version      : 0x0302
Patch Version          : 0x03e8
Reserved               : 0x8000
Patch Entry Address    : 0x19b08
====================================================
====================================================
TLV Type               : 0x2
Length                 : 1992 bytes
Change Vendor Baud from 0x0e to 0x0d
Failed to open /etc/bluetooth/firmware.conf
Ignoring invalid deep sleep config value
Failed to open /etc/bluetooth/firmware.conf
====================================================
Device setup complete
# echo 1 > /sys/class/rfkill/rfkill2/state
# hciconfig hci0 up
# hcitool scan
Scanning ...
48:C1:AC:00:D7:DCVoyager PRO+

The post Buildroot 2020.08 release for i.MX platforms appeared first on Boundary Devices.

Official Release of the Nitrogen8M Plus System on Module

$
0
0

Boundary Devices is pleased to announce the official release of our Nitrogen8M Plus System on Module based on the i.MX 8M Plus processor from NXP.  The i.MX 8M Plus is the first CPU from NXP that includes an integrated Neural Processing Unit for accelerated Machine Learning and AI applications.  The i.MX 8M PLUS is part of the i.MX 8M series of NXP processors targeting multimedia and IoT markets.

Nitrogen8M Plus SOM

48mm x 38mm

The Nitrogen8M Plus SOM is a small 48mm x 38mm board that utilizes high density, high speed board to board connectors. With integrated 802.11ac+BT5.0 QCA9377 WiFi+BT module as well as Gigabit Ethernet PHY, this SOM is designed to get customers to market quickly.  There will be 2 Carrier boards available for the SOM: an EVK evaluation carrier exposing the key features of the SOM, as well as a low cost, production-ready version, with available enclosure.

Processors, Memory and Storage

The Nitrogen8M Plus SOM will launch with the i.MX 8M Plus Quad processor, featuring 4 Cortex-A53 and 1 Cortex-M7 cores and an NPU, with 1.8GHz CPU clock max.

The boards will launch with 2GB of LPDDR4 RAM and 16GB of eMMC standard, with custom options to expand up to 4GB RAM and up to 128GB of eMMC.

Networking Specifications

The i.MX 8M Plus System on Module includes the latest in network connectivity options to serve IoT applications that employ edge and cloud computing.  The SOM will have an integrated, pre-certified 802.11ac + BT5.0 WiFi + BT module based on the QCA9377 chipset.  In addition, the SOM includes a 10/100/1GB Ethernet PHY to help get customers to market quickly.  The i.MX 8M Plus SOM supports a 2nd Ethernet interface which is exposed to the carrier board and available via the EVK carrier option.

Optimized for Low Power Consumption

The Nitrogen8M Plus is designed to maximize power efficiency making it ideal for low power applications by leveraging the following technologies:

  • Heterogeneous Multicore Processing (HMP)
  • Advanced 14LPC FinFET technology
  • High-speed LPDDR4
  • NXP’s PCA9450 Power Management Integrated Circuit (PMIC)

Operating System Support

As with all of Boundary Devices’ SBCs and SOMs, the Nitrogen8M Plus will come with an extensive set of operating system options.

The board will support Linux (Yocto, Ubuntu/Debian, Buildroot, Mendel), FreeRTOS, and Android 10 OS images. All of these OS options will include our best-in-class support via our WikiBlog, and Support page.

Development Accessories

In order to promote rapid development, Nitrogen8M Plus SOM will come with a number of accessories. These accessories include:

  • Touchscreen Displays (7”, 8”, and 10” options)
  • Camera Modules
  • EVK Carrier board for full evaluation
  • Production-ready Carrier board and enclosure

Please visit the product page for schematics, 3D models, user manuals and more!

Check out our video to learn about the features of our Nitrogen8M Plus SOM!

CLICK HERE TO SIGN UP for our Early Access Program!

The post Official Release of the Nitrogen8M Plus System on Module appeared first on Boundary Devices.

Google Mendel Linux for Nitrogen8M boards – (kernel 4.14.x)

$
0
0

Mendel Weston desktop

Mendel Linux is a lightweight derivative of Debian Buster Linux that originally runs on a number of Coral development boards. Now we ported it to Nitrogen8MQ board.

Why another distribution?

To support Coral‘s hardware, Google wanted to build a version of Debian that produced initial bootable eMMC images and supported their specific peripherals. Ideally, they’d have liked to use the Debian name, but that wasn’t feasable for a host of reasons.

Suffice it to say, Mendel is considered to be a lightweight “derivative” of the upstream Debian Buster distribution, and they even use upstream Debian’s binary packages in the project to maintain compatibility and keep up to date with security fixes.

If you want to know what’s changed in Mendel, see Google’s release notes.

Mendel uses Weston, the reference Wayland compositor as graphical desktop.

This system contains NXP/Freescale licensed content, so you will need to register on our web-site and log in before you can accept the license agreement and download the images from here:

Nitrogen8M board:

Important !

Before installing this image please check your U-Boot version as it requires U-Boot version 2018.07  to be used.

Make sure to visit our wiki if you need to upgrade:

You can find the bootscript in the /boot subdirectory now, its named boot.scr. The partition labels are set if you use the fastboot method.

If you use your own method please check the boot partition labels, because the fstab boots by label (LABEL=sys-0Ch for example) now. You can use e2label to modify partition label.

Programming the image

Since the Nitrogen8M board has no SD card slot, you need to program this image in the same way as an Android  system: by using fastboot.

Please install the following packages on your desktop PC, Debian or Ubuntu :

$ sudo apt update
$ sudo apt install fastboot android-tools-fastboot

To avoid using sudo for each command, please download the following file and move it to the /lib/udev/rules.d directory in your host PC: 

,and then type:

$ sudo udevadm control --reload-rules && sudo udevadm trigger

Now connect your Nitrogen8M board’s J67 USB OTG port to your PC’s USB port.

Use regular USB2.0 OTG cable do not use USB3.0 cable (as it seems to be problematic with U-Boot).

Connect the Nitrogen board’s RS232 console to your PC so you can communicate with the board.

You can then power up the Nitrogen8M board, and stop the u-boot execution by pressing any key. Then type:

Hit any key to stop autoboot: 0
=> fastboot 0

Now test the USB connection on the PC, please type on the PC:

$ fastboot devices -l
 fastboot usb-x:y

If you get the above response, a MAC address , the word fastboot, then the USB device:id numbers, the communication is OK.

Now type on PC:

$ fastboot flash gpt gpt_8G.img
$ fastboot flash rootfs rootfs_8G.simg

, then wait till its completed.

When its done you can disconnect USB cable, and restart your Nitrogen8M board.

Note that you can also use fastboot from a Windows Host PC, see following blog post to learn how:

https://boundarydev2.wpengine.com/android-tools-windows-support-nitrogen-platforms/


What was modified/added 

Because of the HW differences we had to add the following packages to Mendel Linux

  • linux-boundary-17b (this is the 4.14.98 metapackage for kernel)
  • imx-galcore-b16 (for imx-gpu-viv 6.2.4.p.4.6)
  • imx-gpu-viv 6.2.4.p.4.6
  • qca-firmware-lea (our wifi firmware)
  • qca-modules-lea (our wifi module)
  • silex-uart (bluetooth stuff)

And we removed the following HW related packages:

  • imx-board-audio
  • imx-board-wlan
  • uboot-imx

We recommend to read the original Coral documentations:

https://coral.ai/docs

You don’t need to execute those commands and don’t have to intall the packages either, because it’s all preinstalled:

  • mini PCIe Edge TPU card’s drivers
  • tensorflow-lite
  • coral examples

Coral Edge TPU mini-PCIe card

We installed and tested the following accelerator HW:

https://coral.ai/products/pcie-accelerator

The drivers are installed:

mendel@vexing-snail:~$ lsmod
Module Size Used by
...
wlan      5287936 0
apex        24576 0
gasket     172032 1 apex
galcore    487424 8
...

Drivers work properly:

mendel@vexing-snail:~$ sudo lspci -v
...
01:00.0 System peripheral: Global Unichip Corp. Coral Edge TPU (prog-if ff)
Subsystem: Global Unichip Corp. Coral Edge TPU
Flags: bus master, fast devsel, latency 0, IRQ 274
Memory at 18200000 (64-bit, prefetchable) [size=16K]
Memory at 18100000 (64-bit, prefetchable) [size=1M]
Capabilities: [80] Express Endpoint, MSI 00
Capabilities: [d0] MSI-X: Enable+ Count=128 Masked-
Capabilities: [e0] MSI: Enable- Count=1/32 Maskable- 64bit+
Capabilities: [f8] Power Management version 3
Capabilities: [100] Vendor Specific Information: ID=1556 Rev=1 Len=008 
Capabilities: [108] Latency Tolerance Reporting
Capabilities: [110] L1 PM Substates
Capabilities: [200] Advanced Error Reporting
Kernel driver in use: apex
Kernel modules: apex

We’ve installed tensorflow-lite for python:

mendel@vexing-snail:~$ pip3 install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_aarch64.whl
Collecting tflite-runtime==2.1.0.post1 from https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_aarch64.whl
Downloading https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_aarch64.whl (1.9MB)
100% |████████████████████████████████| 1.9MB 198kB/s
Requirement already satisfied: numpy>=1.12.1 in /usr/lib/python3/dist-packages (from tflite-runtime==2.1.0.post1) (1.16.2)
Installing collected packages: tflite-runtime
Successfully installed tflite-runtime-2.1.0.post1

We’ve installed examples and then we ran one as described here:
https://coral.ai/docs/m2/get-started#4-run-a-model-using-the-tensorflow-lite-api

We have run the image classifier with the bird photo (shown in Figure 1)

Figure1. parrot.jpg

mendel@vexing-snail:~/coral/tflite/python/examples/classification$ python3 classify_image.py 
 --model models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite 
 --labels models/inat_bird_labels.txt 
 --input images/parrot.jpg
----INFERENCE TIME----
Note: The first inference on Edge TPU is slow because it includes loading the model into Edge TPU memory.
23.5ms
3.3ms
3.2ms
3.3ms
3.2ms
-------RESULTS--------
Ara macao (Scarlet Macaw): 0.77734

 


Connect to the board’s shell via MDT

You can connect to the board as described here:

https://coral.ai/docs/dev-board/get-started#2-connect-to-the-boards-shell-via-mdt

The OS runs usb-gadget services. You can connect to that from your PC (via USB OTG connector) with the MDT tools. Use it carefully because it occupies the 192.168.100.1 … 192.168.100.50 address range and runs a DHCP server on it also. 

Don’t use it together with your local ethernet network, because most probably they will conflict. The hosname is vexing-snail by default and not orange-horse.


As always, please give us some feedback and let us know how things work for you.

The post Google Mendel Linux for Nitrogen8M boards – (kernel 4.14.x) appeared first on Boundary Devices.


i.MX 8M Plus SoM Demos – Machine Learning and Multiple Displays

$
0
0

The i.MX 8M Plus processor from NXP contains some notable differences from the i.MX 8M and i.MX8M Mini predecessors:

  1.  Integrated Neural Processing Unit (NPU)
  2. LVDS display support
  3. Integrated CAN 
  4. Built-in Dual Camera ISP 

The Nitrogen8M Plus System on Module was designed to take advantage of these new features.

In the 2 demos below, we demonstrate the NPU capabilities of the i.MX 8M Plus processor as well as show the additional LVDS output while driving multiple displays.

Demo #1 Object Detection

In this demo, we demonstrate the object detection performance of the i.MX 8M Plus compared to a strict CPU method.  We also show how the NPU can quickly detect various options utilizing a USB camera.

Demo #2 Multiple Displays

In this demo, we show 2 different displays – 1 via LVDS and the 2nd via HDMI – being driven at the same time with independent content.

Please visit the Nitrogen8M PLUS SOM page for more information:  Nitrogen 8M Plus SOM

 

 

The post i.MX 8M Plus SoM Demos – Machine Learning and Multiple Displays appeared first on Boundary Devices.

Using the OptConnect ema Modem with Nitrogen8M

$
0
0

We are pleased to announce support for the OptConnect ema Smart Embedded Modem on our Nitrogen8M board! We will discuss how to connect the modem via USB to the Nitrogen8M using a mPCIe adapter card, as well as instructions on how to do some basic testing of the modem. Once ema is connected, you get an enterprise grade, fully-managed connection from OptConnect’s award winning service.

More information on the modem can be found here

Hardware Installation

As mentioned, the modem connects via USB using this mPCIe adapter. The connection to the Nitrogen8M is shown below:

Software Installation 

This testing was done with our latest yocto image found here

Testing whether the system recognizes the modem

The modem will be recognized as a USB device under Linux. You can check the presence of the modem using lsusb:

root@nitrogen8m:~# lsusb
Bus 002 Device 002: ID 045b:0210 Hitachi, Ltd 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 1bc7:0036 Telit Wireless Solutions 
Bus 001 Device 005: ID 10c4:ea70 Silicon Labs CP2105 Dual UART Bridge
Bus 001 Device 004: ID 0424:2412 Microchip Technology, Inc. (formerly SMSC) 
Bus 001 Device 002: ID 045b:0209 Hitachi, Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

As you can see, the Nitrogen8M recognizes the Telit modem (1bc7:0036).

Now that we validated the modem is recognized as a usb device, you can validate that it is detected by modemmanager:

root@nitrogen8m:~# mmcli -L
/org/freedesktop/ModemManager1/Modem/0 [Telit] LE910-NA V2

And you can see more details of the modem with mmcli -m:

root@nitrogen8m:~# mmcli -m 0
--------------------------------
General | dbus path: /org/freedesktop/ModemManager1/Modem/0
| device id: 9eeb9dfa3d73e64418d4257a000cdfe4c207c4d1
--------------------------------
Hardware | manufacturer: Telit
| model: LE910-NA V2
| firmware revision: 20.00.506
| supported: gsm-umts, lte
| current: gsm-umts, lte
| equipment id: 358148062963801
-------------------------------
System | device: /sys/devices/platform/soc@0/38200000.usb/xhci-hcd.0.auto/usb1/1-1/1-1.4/1-1.4.2
| drivers: cdc_acm, cdc_ncm
| plugin: Telit
| primary port: ttyACM0
| ports: ttyACM1 (unknown), ttyACM3 (unknown), ttyACM5 (unknown), 
| wwan0 (net), ttyACM2 (unknown), ttyACM4 (unknown), ttyACM0 (at)
--------------------------------
Status | unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: registered
| power state: on
| access tech: lte
| signal quality: 71% (recent)
--------------------------------
Modes | supported: allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 3g, 4g; preferred: none
| current: allowed: 3g, 4g; preferred: none
--------------------------------
Bands | supported: utran-5, utran-2, eutran-2, eutran-4, eutran-5, eutran-12, 
| eutran-13, eutran-17
| current: utran-2, eutran-2
--------------------------------
IP | supported: ipv4, ipv6, ipv4v6
--------------------------------
3GPP | imei: 358148062963801
| operator id: 310410
| operator name: AT&T
| registration: home
--------------------------------
3GPP EPS | ue mode of operation: csps-1
--------------------------------
SIM | dbus path: /org/freedesktop/ModemManager1/SIM/0

We can also start a screen serial console application to communicate with the modem on ttyACM0 (primary AT port of the modem, as shown above).

root@nitrogen8m:~# screen /dev/ttyACM0 115200

Now you get an empty console screen. If local command echo is not set, then type ATE1 to the modem blindly, which will enable command echo. You can now talk to the modem via AT commands found in this document

For example, we can get the modem serial number:

AT+GSN
0000675966
OK

Viewing the modem status in OptConnect Summit Portal

Once you purchase a modem, you can call OptConnect with an ema serial number and they will set you up with an account.  The account can also be set up at the same time an order is placed. Once you have the modem linked with an account, you can login to the portal and view your device:

We can see the device online and view its status:

More information on OptConnect ema

You can find more information on OptConnect ema via the following links:

The Creation of OptConnect ema™

Is OptConnect ema™ the Right Fit for Me? Get the answers you need

ema:Play – Questions and answers WITH MATT VOIGT ON

If you have any issues, please email support@boundarydevices.com

The post Using the OptConnect ema Modem with Nitrogen8M appeared first on Boundary Devices.

Debian Buster images for Nitrogen8 family boards with kernel 5.4.x

$
0
0

We’re proud to release our new Debian Buster images for Nitrogen8 boards!  These boards support only the Wayland graphical backend.

We use Weston, the reference Wayland compositor, in this system.

This image boots up the Weston compositor at start. This can be changed by disabling the service autostart, as described later in this post.

This system contains NXP/Freescale licensed content, so you will need to register on our website and log in before you can accept the license agreement and download the Debian Buster images for Nitrogen8 from here:

For i.MX 8MQ based Nitrogen8M, Nitrogen8M SOM:

For i.MX 8M Mini-based Nitrogen8M Mini, Nitrogen8M Mini SOM and for i.MX 8M Nano-based Nitrogen8M NanoNitrogen8M Nano SOM:

 

Important!

Before installing this image please check your U-Boot version, as it requires U-Boot version 2018.07  to be used.

Make sure to visit our wiki if you need to upgrade:

You can find the bootscript in the /boot subdirectory now, its named boot.scr. The partition labels are set if you use the fastboot method.

If you use your own method please check the boot partition labels because the fstab boots by label (LABEL=sys-14h for example) now.  You can use e2label to modify partition label.

Programming the image

Since the Nitrogen8M board has no SD card slot, you need to program this image in the same way as an Android system, by using fastboot.

Please install the following packages on your desktop PC, Debian or Ubuntu :

$ sudo apt update
$ sudo apt install fastboot android-tools-fastboot

To avoid using sudo for each command, please download the following file and move it to the /lib/udev/rules.d directory, then reboot your PC

Now connect your Nitrogen8M board’s J67 USB OTG port to your PC’s USB port.

Use regular USB2.0 OTG cable do not use USB3.0 cable (as it seems to be problematic with U-Boot).

Connect the Nitrogen board’s RS232 console to your PC so you can communicate with the board.

You can then power up the Nitrogen8M board, and stop the u-boot execution by pressing any key. Then type:

Hit any key to stop autoboot: 0
=> fastboot 0

Now test the USB connection on the PC, please type on the PC:

$ fastboot devices -l
 fastboot usb-x:y

If you get the above response, a MAC address, the word fastboot, then the USB device:id numbers, the communication is OK.

Now type on PC:

$ fastboot flash gpt gpt_8G.img
$ fastboot flash rootfs rootfs_8G.simg

, then wait till its completed, until the PC side prints:

$ finished, total time: 584.109sec 

When its done you can disconnect USB cable, and restart your Nitrogen8 board.

Note that you can also use fastboot from a Windows Host PC.  Please see the following blog post to learn how:

https://boundarydev2.wpengine.com/android-tools-windows-support-nitrogen-platforms/

Usernames and passwords

Two users are defined for use on the system: debian and root. The password for each is Boundary (capital B). The user debian has administrator rights, but doesn’t need to enter password at sudo command.

We wanted to make life easier at the cost of some security. If you want to change this please type:

debian@buster-dev64:~$ sudo visudo

, and comment out or delete the last line with “debian” and “NOPASSWD:”

An ssh server is running on the system, though it does not allow password-based authentication for user root.

User debian has sudo privileges, so you can place your ssh public key (normally $HOME/.ssh/id_rsa.pub) to the system like so :

debian@buster-dev64:~$ sudo mkdir /root/.ssh
debian@buster-dev64:~$ sudo nano /root/.ssh/authorized_keys
... paste content of $HOME/.ssh/id_rsa.pub here
debian@buster-dev64:~$ sudo chmod 600 /root/.ssh/auth*
debian@buster-dev64:~$ sudo chmod 600 /root/.ssh/

What’s supported

Since the images above include our stable 4.9.x kernel, essentially everything is supported, including:

  • Vivante GPU accelerations for Wayland
  • The Hantro Video Processing Unit supports the following decoders:
    • video/x-h265
    • video/x-vp9
    • video/x-h264
    • video/x-vp8
    • video/x-vp6-flash
    • video/mpeg
    • video/x-h263
    • video/x-flash-video
    • video/x-divx
    • video/x-xvid
    • video/x-cavs
    • video/x-wmv
    • video/x-pn-realvideo
    • video/x-raw
  • BD-SDMAC WiFi/BT modules support
  • All kind of storage devices , eMMC, SATA hdd (via USB3-SATA adapter), USB3.0/2.0 pen drives, mini PCIe devices, cell modems
  • All of our supported touch panels

The packaging (including kernel) is done in the normal debian way, so apt-get update/dist-upgrade will keep your image up and running as the latest as patches come out.

What’s new in this release?

The Linux kernel was upgraded to 5.4.72 ( meta-package name: linux-boundary-18b ).
GPU driver was upgraded to Vivante 6.4.3p0.0 ( meta-package name: imx-gpu-viv-b18-… ).
The built-in galcore module has been removed (CONFIG_MXC_GPU_VIV) and we use an external galcore kernel module. This change makes the graphics system modular and more upgradeable, at the price of longer kernel upgrading time. Upgrading kernel takes about 3-4 minutes now, instead of 30 seconds, because every kernel upgrade rebuilds the galcore driver from sources, as it’s a DKMS module.
The NXP/Vivante GPU SDK was added : imx-gpu-sdk 4.0.2 . You can get the source with the usual apt-get source command. The SDK has many new demos, for example OpenCL, OpenVG, and for OpenVX and Vulkan.
The distribution is Buster 10.6 . Here are some main component versions of these Debian Buster images for Nitrogen8:

  • Xorg server 1.20.4-1.1
  • gstreamer1.0 1.16.2
  • bluez 5.50-1.2
  • Qt5.11.3
  • apt 1.8.2.1
  • dpkg 1.19.7-3
  • gcc/g++ 8.3.0-6
  • libwayland 1.18.0-1
  • weston 6.0.1-2debian4
  • the image supports the Silex WiFi / Bluetooth module

The system boots to Weston compositor as mentioned before.

If you don't want to start Weston at boot automatically, you have to disnable the service, you have to type the following:
debian@buster-dev64:~$ sudo systemctl disable weston.service
debian@buster-dev64:~$ sudo systemctl mask weston.service 

If you want to enable the autostart again you need to type:

debian@buster-dev64:~$ sudo systemctl unmask weston.service
debian@buster-dev64:~$ sudo systemctl enable weston.service

You can find the weston.ini file in the /etc/xdg/weston directory. Please type:

debian@buster-dev64:~$ man weston.ini

Check the options and feel free to modify it to suit your needs.


As always, please share your feedback and let us know how things work for you.

The post Debian Buster images for Nitrogen8 family boards with kernel 5.4.x appeared first on Boundary Devices.

Android 10 update release for Nitrogen8 family

$
0
0

We are glad to deliver the latest Android 10 2.5.0 release for all our i.MX 8M-based Nitrogen platforms:

Android 10


For the impatient

You can download the Android 10 images from here:

Flashing using fastboot

The .zip archives include all the files to be flashed using fastboot.

Note that fastboot will only flash to your eMMC device, for SD card, please check next section.

First you need to enter fastboot mode from U-Boot prompt:

=> fastboot 0

Once the platform is in fastboot mode, you simply need to call the flashing script:

~/$ unzip q10*nitrogen8*.zip -d q10-nitrogen8
~/$ cd q10-nitrogen8
~/q10-nitrogen8$ ./device/boundary/scripts/flash_fastboot.sh

Since our i.MX 8 platforms might come with different eMMC sizes, you can select which size you want to use at flashing time.

If you don’t provide that argument, the “default” size of 8GB will be flashed.

But if you have a recent board, it will most likely include 16GB of eMMC, here is the command to use its full size:

~/q10-nitrogen8$ ./device/boundary/scripts/flash_fastboot.sh -s 16

Note that you can also use fastboot from a Windows Host PC, see following blog post to learn how:

C:q10-nitrogen8> deviceboundaryscriptsflash_fastboot.bat nitrogen8m

Flashing using Etcher / dd

If you cannot use the fastboot tool, you can still flash the 16GB prebuilt image file for your platform (.img.gz).

For Linux users you can simply use the following command:

~$ zcat q10*nitrogen8*.img.gz | sudo dd of=/dev/sdX bs=1M

For Windows and Linux users who would rather use a UI, we recommend using Balena Etcher tool:

NB: the first boot from SD card can be quite long as it creates and formats missing userdata partition. Please be patient, all subsequent boots will be faster.

Updating U-Boot

We recommend updating U-Boot once the image is flashed:

=> run upgradeu

What’s new?

This section will only describe the changes / features made since last release.

Android 10 OS updates

Google provides a list of notable changes for developers:

  • Updated code base from android-10.0.0_r14 (Nov. 2019) to android-10.0.0_r41 (Aug. 2020)

SELinux

As usual, this release comes with SELinux enabled and enforced.

If you are using the userdebug build, you can still switch to permissive mode by setting 1 variable in U-Boot:

=> setenv selinux permissive
=> saveenv

Note that this feature only works on userdebug builds, user builds are enforced at all time.

AVB2.0

Same as our previous release, this one supports Android Verified Boot 2.0!

So I can’t make any modification now? No, there’s a way to disable verity for userdebug builds:

$ adb root
$ adb disable-verity
$ adb reboot

At this point you will be able to modify every partition (you can even use adb sync)

However it goes without saying that this disablement isn’t possible on user builds.

non-A/B OTA updates

This release also uses a  non-A/B partitioning which allows to save some space and keep the most space for your applications.

However it has been reported to us that the previous release had issues building / applying OTA packages which is now fixed.

In order to build an OTA package, you can simply enter this make command (once the env is setup properly):

$ make otapackage

Then, you can setup ota.conf to reflect your HTTP server settings if you plan on hosting your own updates.

Or this release also brings a way for you to push an update using ADB and then kick the OTA app to do the necessary checks and reboot the platform as needed:

$ adb push $OUT/nitrogen8m-ota-*.zip /data/data/com.fsl.android.ota/cache/update.zip
$ adb shell 'am start -n com.fsl.android.ota/.OtaAppActivity --es OTA file:///data/data/com.fsl.android.ota/cache/update.zip'

You should then see your platform reboot into recovery partition and apply the update.

NXP changes

NXP updated a few things in this release, two of those are very important to us:

  • 4k performances for i.MX 8M Quad have been greatly improved
    • First releases were lacking tiling support which is now included
  • Display rotation with G2D HWcomposer is now fixed

Linux Kernel 5.4.x

This Android release is based on a 5.4.x kernel. It therefore benefits from all our latest drivers/fixes as well as newest Vivante graphics libraries (v6.4.3.p0).

U-Boot 2020.10

We are glad to use U-Boot 2020.10 for this release as it brings a few enhancements:

  • A board can now reboot to fastboot from fastboot (useful during flashing process):
    $ fastboot reboot bootloader
    
  • You can now flash U-Boot over fastboot as well:
    $ fastboot flash bootloader flash.bin
    
  • This bootloader will soon be able to display a splash screen on MIPI displays!

Boundary Devices additions

Just like our previous releases, this one includes unique features that only Boundary Devices provides:

  • Dynamic display support
    • Our U-Boot version still detects the connected displays automatically (MIPI-DSI + HDMI)
    • You can see our list of supported MIPI-DSI displays from our website here
  • Optimized Camera HALv3 version
    • This releases offers continuous autofocus support for our cameras
  • Support for our 802.11b/g/n/ac + BT4.1 Silex Module
  • Display rotation setting from U-Boot
=> setenv hwrotation 270
=> saveenv
=> reset
  • Variety of accessories
    • All our accessories like OV5640 cameras are all supported
    • 8M Plus platform also supports Basler daA3840 camera
  • Up to date kernel stable release
    • While NXP kernel is based upon 5.4.47 kernel, we provide latest updates up to 5.4.77
    • This includes 3800+ bug/CVE fixes that makes your device much more secure

Source code access

For the newcomers, please make sure to read our “Android Getting Started Guide” since it contains all the information you need to download, build and flash an Android image.

Since AOSP requirement is still to use Ubuntu Xenial (16.04) to build the OS, many might find it useful to use Docker, we provide a dockerfile if needed:

For those already familiar with our releases, here is a condensed version to get the Android 10 source code:

~/$ mkdir myandroid
~/$ cd myandroid
~/myandroid$ repo init -u git://github.com/boundarydevices/android-manifest.git 
       -b boundary-android-10.0.0_2.5.0
~/myandroid$ repo sync
~/myandroid$ export TEMPORARY_DISABLE_PATH_RESTRICTIONS=true
~/myandroid$ source build/envsetup.sh
~/myandroid$ lunch
... choose nitrogen8m / nitrogen8mm / nitrogen8mn / nitrogen8mp from the list of boards 
~/myandroid$ ./imx-make.sh -j12

As you can see, we use a special make script instead of the regular make command.

The reason is that in order to have as few AOSP changes as possible, NXP created a separate script in order to kernel the build dependencies that are the kernel, dtbo, u-boot images.

One could also use the following approach to only build the dependencies with that script and then use standard Android build:

~/myandroid$ ./imx-make.sh kernel bootloader -j12
~/myandroid$ make -j12

There’s also one variable (TEMPORARY_DISABLE_PATH_RESTRICTIONS) that needs to be set as Android build now forbids the use of mke2fs which is required for our preboot partition. We suggest setting this inside your .bashrc or .profile user file.

 

As always, let us know your experiences (both good and bad) when you test out this image.

The post Android 10 update release for Nitrogen8 family appeared first on Boundary Devices.

Nitrogen8M Plus SOM

$
0
0

Nitrogen8M Plus SOM

The Following information is valid for all versions of the Nitrogen8M Plus SOM.

Details & Pricing

See full product page

Contact Support

Contact us with specific questions

Getting Started

Debian / Ubuntu

  • Ubuntu Tutorial:
    Ubuntu Blog Posts
  • Latest Ubuntu Release:
    Focal available soon…
     
  • Mendel Linux:
    available soon…
     
  • Debian:
    Buster available soon…

Yocto / Buildroot

Android

FreeRTOS

  • FreeRTOS BSP
    SDK available soon…

The post Nitrogen8M Plus SOM appeared first on Boundary Devices.

Nitrogen8MP Yocto Zeus release

$
0
0

We are pleased to release a Yocto Zeus image for our Nitrogen8MP SOM!

This release is based upon NXP Beta 2 5.4.47_2.2.0 release.

For the Impatient

You can download the Yocto image for Nitrogen8MP here:

You can program the SW to eMMC using the instructions below:

You can also program the SW to SD Card or USB Stick via zcat and dd under Linux:

~$ zcat *nitrogen8mp.wic.gz | sudo dd of=/dev/sdX bs=1M

In addition, you can use the Balena Etcher utility to flash the eMMC, SD Card or USB stick via Windows or Linux:

Why Zeus?

If you’re familiar with our previous releases, you might have noticed we already released Dunfell for our other platforms, which is newer than Zeus.

The reasoning is that we usually use the community BSP which offers newer branches support, more bugfixes and so on. However the community BSP doesn’t include all the components to fully leverage the i.MX 8M Plus yet (NPU, ISP, DSP etc).

That is why we released this version of Yocto based on NXP’s version.

We will however continue to work closely with the community to integrate the missing packages and offer a Gatesgarth branch soon!

Build procedure

This image uses the Zeus boundary-imx-5.4.47-2.2.0 branch of our boundary-bsp-platform repository.

To build the image, we recommend using a Docker Container so that you can build with a reproducible and stable build environment. Otherwise, you’ll need these packages installed as well as this repo tool that can be installed like this:

~$ sudo apt-get install repo

Then create your build directory and initialize everything.

~$ mkdir ~/yocto-8mp && cd yocto-8mp
~/yocto-8mp$ repo init -u https://github.com/boundarydevices/boundary-bsp-platform \
             -b boundary-imx-5.4.47-2.2.0
~/yocto-8mp$ repo sync

Next, setup the environment for building:

~/yocto-8mp$ DISTRO=fsl-imx-xwayland-boundary MACHINE=nitrogen8mp \
             source imx-setup-release.sh -b build

Now bitbake imx-image-full which includes Boundary-specific packages such as BD-SDMAC drivers and firmware.

~/yocto-8mp/build$ bitbake imx-image-full

The image file will deploy to tmp/deploy/images/nitrogen8mp/imx-image-full-nitrogen8mp.wic.gz.

Features list

The image built above contains the following components:

  • Linux kernel 5.4.x_2.2.0
  • U-Boot 2020.10
  • Weston 8.0.0 for i.MX
  • GStreamer 1.16.2 for i.MX
  • GPU Vivante libraries 6.4.3p0.0
  • VPU Hantro libraries v1.19.0
  • ISP VVCAM v4.2.2.2
  • Qt 5.15
  • qcacld-lea-2.0 Wi-Fi driver for BD-SDMAC
  • BlueZ 5.50 with support for BD-SDMAC

The next sub-sections will describe how to test most features.

Basler camera input

This build fully supports the Basler daA3840 8MP camera from Basler which is part of our Evaluation Kit:

The isp-vvcam driver and imx8-isp service are loaded automatically when the camera is detected.

From there a simple GStreamer pipeline will allow you to see the stream:

root@nitrogen8mp:~# gst-launch-1.0 -v v4l2src device=/dev/video0 ! waylandsink
...
[  352.348796] wdr3 res: 1920 1080 
[  352.352471] enter isp_mi_start
[  357.581179] ###### 62.42 fps ######
[  362.771924] ###### 62.42 fps ######

eIQ / NPU support

NPU support is fully integrated into this build with TensorFlowLite and ARMNN support of the NPU.

We recommend newcomers try the PyEIQ framework which provides many examples to test the Neural Processing Unit:

Installing eIQ is very simple as you can see below:

root@nitrogen8mp:~# pip3 install eiq

You can then run any demo listed below

root@nitrogen8mp:~# pyeiq --run object_detection_tflite
root@nitrogen8mp:~# pyeiq --run switch_video

GPU acceleration

As usual, in order to test the GPU you can use the example apps provided by Vivante:

root@nitrogen8mp:~# /opt/imx-gpu-sdk/GLES2/Blur/GLES2.Blur_Wayland -d

Ethernet

Once the eth0 or eth1 interface is up, you can use iperf3 to check Ethernet performance:

root@nitrogen8mp:~# iperf3 -c 192.168.1.10
Connecting to host 192.168.1.10, port 5201
[ 5] local 192.168.1.66 port 48554 connected to 192.168.1.10 port 5201
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1.10 GBytes 943 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver

Wi-Fi

Same goes for the Wi-Fi that can be tested just as easily with connman:

root@nitrogen8mp:~# connmanctl 
connmanctl> enable wifi
Enabled wifi
connmanctl> agent on
Agent registered
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
*AO Wired ethernet_0019b80891ba_cable
Jabu_5GHz wifi_e24f43c97518_4a6162755f3547487a_managed_psk
Jabu_5GHz wifi_e04f43447518_4a6162755f3547487a_managed_psk
connmanctl> connect wifi_e04f43447518_4a6162755f3547487a_managed_psk
Agent RequestInput wifi_e04f43447518_4a6162755f3547487a_managed_psk
Passphrase = [ Type=psk, Requirement=mandatory, Alternates=[ WPS ] ]
WPS = [ Type=wpspin, Requirement=alternate ]
Passphrase? XXXXXXX
connmanctl> [ 1345.330332] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Connected wifi_e04f43447518_4a6162755f3547487a_managed_psk
connmanctl> exit
root@nitrogen8mp:~# ping google.com -I wlan0
PING google.com(par10s28-in-x0e.1e100.net (2a00:1450:4007:80a::200e)) from 2a01:cb00:f9f:e00:e24f:43ff:fe44:7518 wlan0: 56 data bytes
64 bytes from par10s28-in-x0e.1e100.net (2a00:1450:4007:80a::200e): icmp_seq=1 ttl=115 time=9.12 ms
64 bytes from par10s28-in-x0e.1e100.net (2a00:1450:4007:80a::200e): icmp_seq=2 ttl=115 time=9.32 ms
...

Bluetooth

Here is the procedure to get BT5.0 working with our BD-SDMAC module:

root@nitrogen8mp:~# connmanctl enable bluetooth
Enabled bluetooth
root@nitrogen8mp:~# hciattach -t 30 /dev/ttymxc0 qca 3000000
...
Device setup complete     
root@nitrogen8mp:~# hciconfig hci0 up
root@nitrogen8mp:~# hcitool scan
Scanning ...
	94:E6:F7:F3:17:F3	p1g2

VPU decoding

If your platform supports VPU decoding, here is an example on how to test it using the gplay tool:

root@nitrogen8mp:~# wget http://linode.boundarydevices.com/videos/Hobbit-1080p.mov
root@nitrogen8mp:~# gplay-1.0 Hobbit-1080p.mov

VPU encoding

Here is a simple example that shows how to encode a video stream from the camera into H.264 using the VPU encoder:

root@nitrogen8mp:~# gst-launch-1.0 -v -e v4l2src device=/dev/video0 ! 'video/x-raw,width=1920,height=1080' \
                    ! vpuenc_h264 ! filesink location=test.h264
^C
root@nitrogen8mp:~# gst-launch-1.0 filesrc location=test.h264 typefind=true ! 'video/x-h264' ! \
                    h264parse ! vpudec ! waylandsink

CAN

The Nitrogen8MP platform comes with 2 CAN ports. You’ll be able to bring up the interfaces using this following command:

root@nitrogen8mp:~# ip link set can0 up type can bitrate 500000
root@nitrogen8mp:~# ip link set can1 up type can bitrate 500000

From this point, you can use commands such as cansend and candump to send or display messages on the bus respectively.

 

If you have any issues, please email support@boundarydevices.com

The post Nitrogen8MP Yocto Zeus release appeared first on Boundary Devices.

3 Reasons NOT to use a Raspberry Pi in your commercial product


ML – Performance Analysis on i.MX Platforms

$
0
0

This blog post will show some Machine Learning (ML) performance analysis across our platforms and especially with the i.MX 8M Plus based Nitrogen8MP!

It was done as part of our i.MX 8M Plus Machine Learning webinar which you can see here:

HW Setup

In this article, we will focus on 2 different setups:

1. Nitrogen8M + Google EdgeTPU

  • i.MX 8M Quad based SBC
    • Quad Arm® Cortex®-A53 cores @1.5GHz
    • GC7000Lite GPU (OpenGL® ES 3.1)
    • 4k video decoder + 4k video output
    • 2x MIPI-CSI2 camera inputs
    • 2x PCI Express Gen2 interfaces
    • 2x USB 3.0 controllers
  • Google Edge TPU ML accelerator
    • 4 TOPS total peak performance (int8)
    • Integrated power management
    • Operating temp: -20 to +85 °C

2. Nitrogen8MP

  • i.MX 8M Plus based SoM
    • Quad Arm® Cortex®-A53 cores @1.8GHz
    • Neural Processing Unit (NPU) 2.3 TOPS
    • GC7000UltraLite GPU (OpenGL® ES 3.1) + GC520L 2D
    • 1080p video encode/decode
    • 3 display outputs (MIPI-DSI, LVDS, HDMI)
    • 2x MIPI-CSI2 camera inputs + ISP
    • 1x PCI Express Gen2 interfaces
    • 2x USB 3.0 controllers
    • Small form factor: 48mm x 38mm

SW Setup

As the EdgeTPU doesn’t use the standard libneuralnetworks.so library for its acceleration, we couldn’t use the exact same application. So we decided to use a simple python app in both cases using the same model, label and input image. We packaged everything into one archive for you to download:

1. Mendel Linux + PyCoral API

For the EdgeTPU, we will use our Mendel Linux release. along with freely available PyCoral examples:

  1. classify_image.py
$ python3 coral/tflite/python/examples/classification/classify_image.py \
    --model mobilenet_v1_1.0_224_quant_edgetpu.tflite \
    --labels labels_mobilenet_quant_v1_224.txt --input cat.jpg 
----INFERENCE TIME----
Note: The first inference on Edge TPU is slow because it includes loading the model into Edge TPU memory.
27.0ms
4.3ms
4.2ms
4.5ms
4.1ms
-------RESULTS--------
Egyptian cat: 0.58594
  1. detect_image.py
$ python3 coral/tflite/python/examples/detection/detect_image.py \
    --model detect_edgetpu.tflite --labels coco_labels.txt --input bus.jpg
----INFERENCE TIME----
Note: The first inference is slow because it includes loading the model into Edge TPU memory.
39.81 ms
13.59 ms
12.94 ms
15.37 ms
13.85 ms
-------RESULTS--------
bus
id: 5
score: 0.83203125
bbox: BBox(xmin=222, ymin=197, xmax=630, ymax=592)

Note that the default model used for this example was generated using the edgetpu_compiler:

$ edgetpu_compiler mobilenet_v1_1.0_224_quant.tflite
Edge TPU Compiler version 15.0.340273435
Model compiled successfully in 431 ms.
Input model: mobilenet_v1_1.0_224_quant.tflite
Input size: 4.08MiB
Output model: mobilenet_v1_1.0_224_quant_edgetpu.tflite
Output size: 4.40MiB
On-chip memory used for caching model parameters: 4.33MiB
On-chip memory remaining for caching model parameters: 2.81MiB
Off-chip memory used for streaming uncached model parameters: 0.00B
Number of Edge TPU subgraphs: 1
Total number of operations: 31
Operation log: mobilenet_v1_1.0_224_quant_edgetpu.log
See the operation log file for individual operation details.

2. Yocto Zeus (Beta2) + eIQ

As of this writing, we recommend the following Yocto release to use the eIQ from NXP:

Installation of eIQ is very straightforward once the image is booted up:

root@nitrogen8mp:~# pip3 install eiq

Then you can run the following commands to use the same type of application with the same model/label/input from our benchmark archive:

root@nitrogen8mp:~# pyeiq --run object_classification_tflite -i cat.jpg \
    -m mobilenet_v1_1.0_224_quant.tflite -l labels_mobilenet_quant_v1_224.txt
root@nitrogen8mp:~# pyeiq --run object_detection_tflite -i bus.jpg \
    -m detect.tflite -l coco_labels.txt

In case of the eIQ tests, the result / inference time will show on the display instead of in the command prompt.

Performance analysis results

Here is table that summarizes our findings, comparing both Neural Processing solutions.

First, the Nitrogen8MP offers better CPU performances which makes sense as its cores are running at a higher frequency than the Nitrogen8M.

Then you can see that both solutions provide about the same performance with a slight advantage to the i.MX 8M Plus NPU.

This might come as a surprise since the TPU is rated with more TOPS but note that this figure is for highly optimized model. In this article we use the same “standard” pre-built model, the EdgeTPU could most likely offer better performances with an optimized model.

Anyway we invite you to use those benchmarking techniques to better select the right product for your project.

 

As always, feel free to send your feedback about this article to support@boundarydevices.com.

The post ML – Performance Analysis on i.MX Platforms appeared first on Boundary Devices.

U-Boot 2020.10 for i.MX platforms

$
0
0

Boundary Devices is happy to release the latest U-Boot 2020.10 with support for all our Nitrogen Families of SBCs and SOMs.

For the impatient

Our build server automatically generates and uploads all the latest binaries to this address:

The README file contains the exact commit ID of this build images.

The latest upgrade.scr U-Boot script is included so it can be copied alongside the U-Boot binary above to the root of your media storage (formatted in FAT or ext2/3/4).

Then, once the media is inserted into the board, you can simply run the following command from U-Boot prompt:

=> run upgradeu

If unsure about this shorten procedure, please make sure to read the flashing procedure section.

What’s new?

i.MX 8M Plus support

The big news of this release is that it supports all our boards including the i.MX 8M Plus based Nitrogen8MP.

Fastboot bootloader flashing support

This unfortunately only applies to 8M* platforms as fastboot can only access eMMC at this point.

So for any platform of the Nitrogen8 family, you can now update its bootloader with Fastboot!

On the target, either press the Fastboot button if present or type this in U-Boot:

=> fastboot 0

On the Host PC you can then simply enter:

$ fastboot flash bootloader flash.bin
$ fastboot reboot

Display configuration support

Just like previous U-Boot version, this one supports display configuration for i.MX boards.

As a reminder, you can list all the displays supported by your platform with a simple command:

=> fbpanel

Here is an example on how to set up the board to use our BD080MCC1 MIPI display in case it isn’t recognized automatically:

=> setenv fb_mipi ltk080a60a004t
=> savee
=> reset

Driver improvements

Although we won’t list all the changes between 2018.07 and 2020.10, we know many drivers have been improved.

As mentioned in U-Boot 2020.10 release announcement, people can check the changelog:

$ git log --oneline --no-merges v2018.07..v2020.10

Build instructions

Getting the source code

First, clone our U-Boot git repository. This is the branch you’ll need to compile and install to work with the new kernel.

~$ git clone https://github.com/boundarydevices/u-boot-imx6 \
    -b boundary-v2020.10
~$ cd u-boot-imx6
~$ sudo apt-get install device-tree-compiler

Choosing the proper defconfig

Here you’ll need to find and make the relevant defconfig for your board.

If you have the board running U-Boot already, you can type the following to see which defconfig you should build.

=> printenv uboot_defconfig

Otherwise, to see all the defconfigs, use this command and pick the one that is right for you.

~/u-boot-imx6$ find configs/ -name "nit*defconfig"
configs/nit6xlite_defconfig
configs/nitrogen6_max_defconfig
configs/nitrogen6q_defconfig
configs/nitrogen6q_som2_1g_defconfig
configs/nitrogen6sx_defconfig
configs/nitrogen6_vm_defconfig
configs/nitrogen7_defconfig
configs/nitrogen8m_defconfig
...

Building for i.MX6/7

Now compile that defconfig. For 32-bit platforms, we’ll use nitrogen6q_defconfig as an example:

~/u-boot-imx6$ sudo apt-get install crossbuild-essential-armhf
~/u-boot-imx6$ export ARCH=arm
~/u-boot-imx6$ export CROSS_COMPILE=arm-linux-gnueabihf-
~/u-boot-imx6$ make nitrogen6q_defconfig
~/u-boot-imx6$ make -j2

Building for i.MX8

For 64-bit platforms, we’ll use nitrogen8m_defconfig as an example:

~$ sudo apt-get install crossbuild-essential-arm64
~$ export ARCH=arm64
~$ export CROSS_COMPILE=aarch64-linux-gnu-
~$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.10.bin
~$ chmod +x firmware-imx-8.10.bin
~$ ./firmware-imx-8.10.bin
~$ cp firmware-imx-8.10/firmware/hdmi/cadence/signed_*.bin u-boot-imx6/
~$ cp firmware-imx-8.10/firmware/ddr/synopsys/lpddr4*.bin u-boot-imx6/
~$ cd u-boot-imx6
~/u-boot-imx6$ make nitrogen8m_defconfig
~/u-boot-imx6$ make flash.bin -j4

At this point, you can rename the bootable image from flash.bin to u-boot.${uboot_defconfig}

~/u-boot-imx6$ cp flash.bin u-boot.nitrogen8m

Flashing procedure

For Nitrogen8 devices, you can use the fastboot procedure explained above.

If you have built your own binary, you can use the copy_upgrade.sh script to copy the bootable binary and the upgrade script to the root folder of your media (SD Card / USB / SATA drive).

~/u-boot-imx6/$ ./copy_upgrade.sh <storage_mount_point>/

If you haven’t built your own binary, you can copy upgrade.scr and the U-Boot binary matching your platform manually into your storage.

However, if you are unsure about which file to copy, we’ve created an image for you that you simply need to flash onto either your SD-Card or USB drive:

Plug your media to the platform, power up the board and interrupt u-boot to run the commands below (via the serial terminal).

Hit any key to stop autoboot:  0
=> run upgradeu

This will run the upgrade.scr script and look for a file u-boot.${uboot_defconfig} and burn it.

At this point it might be worth while to clear your environment variables after the first reboot.

This will set you up with the default environment variables and no more.

Hit any key to stop autoboot:  0 
=> env default -a
=> savee

Then, as a final note, if you’ve bricked your board through this process and need help, please go through the recovery blog post.

The post U-Boot 2020.10 for i.MX platforms appeared first on Boundary Devices.

ML – Facemask Detection i.MX 8M Plus NPU Demo

$
0
0

This blog post will detail how Boundary Devices created its Facemask Detection app for the i.MX 8M Plus-based Nitrogen8MP and its NPU!

It was done as part of our i.MX 8M Plus Machine Learning webinar which you can see here:

Facemask Detection app details

History

We decided to create a demo leveraging the i.MX 8M Plus NPU when COVID was spreading worldwide. So it became obvious that an application detecting whether or not a person is wearing a mask was a great example.

Not only does it show how machine learning can be used to track and recognize a face, a model can be created to learn if the detected face has a specific attribute, like a mask.

Hardware setup

For this demo, we used our Nitrogen8M Plus Evaluation Kit Bundle which includes:

Software details

Overall architecture

After some investigation, we decided to use the following:

  • OS: Android 10 (BSP 2.5.0)
    • Pre-built images available here
    • Plenty of examples apps available
    • NNAPI supported by NXP
  • Inference Engine: TensorFlow Lite
    • Using existing example to build demo
    • Customized model for face mask detection

Leveraging existing projects

This application was possible thanks to several other projects:

Credit: Esteban Uri (Medium article)

Demo

Here is a snippet of our webinar showing the Facemask Detection app which can be downloaded here.

https://youtu.be/4sG2U8Vx480

 

As always, let us know if you have any questions or feedback!

The post ML – Facemask Detection i.MX 8M Plus NPU Demo appeared first on Boundary Devices.

FreeRTOS SDK v2.9 release for i.MX 8M platforms

$
0
0

One of the many advantages of developing with NXP’s i.MX 8M Family of application processors is the ability to utilize both the Cortex-A53 as well as the Cortex-M core. This blog post will first present the architecture of the i.MX 8M heterogeneous processors as a starting point for the discussion, and then explain how to build and run the FreeRTOS SDK v2.9 on its MCU.

The i.MX 8MQ and i.MX 8M Mini processors are coupling a Cortex-A53 cluster (4 cores) alongside a Cortex-M4 whereas the i.MX 8M Nano and i.MX 8M Plus are using a Cortex-M7.

For the impatient

You can download any of our currently available OS images for our i.MX 8M platforms:

Note that you can find pre-built binaries of the examples here for each CPU variant:

There are 3 examples for each variant:

  • hello_world.bin
    • simple application printing “hello world” on the M-core serial port
  • rpmsg_lite_pingpong_rtos_linux_remote.bin
    • ping pong examples between both CPU clusters using RPMSG
  • rpmsg_lite_str_echo_rtos.bin
    • TTY example showing serial communication between CPU clusters using RPMSG

You can then start your first Hello World application on the Cortex-M manually (after copying one of the binary above to your storage):

=> load mmc 0 $m4loadaddr hello_world.bin
=> bootaux $m4loadaddr

Note that all the U-Boot variables are named ‘m4x‘ for legacy reasons, but those still apply for platforms with an M7 core.

On the second serial port (UART4 for 8M Mini/Nano/Plus, UART2 for 8M Quad), you should see the following output:

Hello World!

Architecture 

As an introduction, here is the definition of terms that will be used throughout the post:

  • MCU: Microcontroller Unit such as the ARM Cortex-M series, here referring to the Cortex-M4 or M7
  • MPU: Microprocessor Unit such as the ARM Cortex-A series, here referring to the Cortex-A53
  • RTOS: Real-Time Operating System such as FreeRTOS or MQX

The i.MX 8M processors are Heterogeneous Multicore Processors as they offer an MCU and a MPU in the same chip.

How it works?

The first thing to know is that one of the cores is the “master”, meaning that it is in charge to boot the other core which otherwise will stay in reset.

The BootROM will always boot the Cortex-A core first. In this article, it is assumed that U-Boot is the bootloader used by your system. The reason is that U-Boot provides a bootaux command which allows the Cortex-M to start.

Once started, both CPU clusters are on their own, executing different instructions at different speeds.

Where is the code running from?

It actually depends on the application linker script used. When GCC is linking your application into an ELF executable file, it needs to know the code location in memory.

There are several options in both processors, code can be located in one of the following:

  • TCM (Tightly Coupled Memory): 128kB available
  • DDR: up to 1MB available (can be increased, set in the device tree)

External memories, such as the DDR, offer more space but are also much slower to access.

In this article, every application runs from the TCM as it is the option offering the best performance.

When is the MCU useful?

The MCU is perfect for all the real-time tasks whereas the MPU can provide a great UI experience with non real-time OS such as GNU/Linux.

It is understood that the  Linux kernel is not real-time, not deterministic whereas FreeRTOS on Cortex-M is.

Also, since its firmware is pretty small and fast to load, the MCU can be fully operating within a few hundred milliseconds whereas it usually takes Linux OS much longer to be operational.

Examples of applications where the MCU has proven to be useful:

  • Motor control: DC motors only perform well in a real-time environment since feedback response time is crucial
  • Automotive: the MCU can handle CAN messages and be operational at a very early stage

Resource Domain Controller (RDC)

Since both cores can access the same peripherals, a mechanism has been created to avoid concurrent access, allowing to ensure a program’s behavior on one core does not depend on what is executed/accessed on the other core.

This mechanism is the RDC which grants peripheral and memory access permissions to each core.

The examples and demo applications in the FreeRTOS BSP use RDC to allocate peripheral access permission. When running the ARM Cortex-A application with the FreeRTOS BSP example/demo, it is important to respect the reserved peripheral.

The FreeRTOS BSP application has reserved peripherals that are used only by ARM Cortex-M, and any access from ARM Cortex-A core on those peripherals may cause the program to hang.

The default RDC settings are:

  • The ARM Cortex-M core is assigned to RDC domain 1, and ARM Cortex-A core and other bus masters use the default assignment (RDC domain 0).
  • Every example/demo has its specific RDC setting in its board.c (see BOARD_RdcInit() function).

The user of this package can remove or change the RDC settings in the example/demo or in his application. It is recommended to limit the access of a peripheral to the only core using it when possible.

Also, in order for a peripheral not to show up as available in Linux, it is mandatory to disable it in the device, which is why a specific device tree is used when using the MCU:

The memory declaration is also modified in the device tree above in order to reserve some areas for FreeRTOS and/or shared memory.

Remote Processor Messaging (RPMsg)

The Remote Processor Messaging (RPMsg) is a virtio-based messaging bus that allows Inter Processor Communications (IPC) between independent software contexts running on homogeneous or heterogeneous cores present in an Asymmetric Multi Processing (AMP) system.

The RPMsg API is compliant with the RPMsg bus infrastructure present in upstream Linux 3.4.x kernel onward.

This API offers the following advantages:

  • No data processing in the interrupt context
  • Blocking receive API
  • Zero-copy send and receive API
  • Receive with timeout provided by RTOS

Note that RPMsg uses the DDR by default to exchange messages between cores.

Where can I find more documentation?

The BSP comes with some documentation which we recommend reading in order to know more on the subject:

Build instructions

Development environment setup

In order to build the FreeRTOS BSP, you first need to download and install a toolchain for ARM Cortex-M processors.

~$ cd && mkdir toolchains && cd toolchains
~/toolchains$ wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
~/toolchains$ tar xjf gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
~/toolchains$ rm gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2

FreeRTOS relies on cmake to build, so you also need to make sure the following packages are installed on your machine:

~$ sudo apt-get install make cmake

Download the BSP

The FreeRTOS SDK v2.9 is available from our GitHub freertos-boundary repository.

~$ git clone https://github.com/boundarydevices/freertos-boundary.git freertos
~$ cd freertos
~/freertos$ git checkout <branch_name>

You need to use the proper branch_name for your platform:

Finally, you need to export the ARMGCC_DIR variable so FreeRTOS knows your toolchain location.

~/freertos$ export ARMGCC_DIR=~/toolchains/gcc-arm-none-eabi-7-2017-q4-major
~/freertos$ export PATH=$PATH:~/toolchains/gcc-arm-none-eabi-7-2017-q4-major/bin

Build the FreeRTOS apps

All the applications are located under the boards/ folder:

~/freertos$ tree boards/evk*/ -L 1
boards/evk*/
├── cmsis_driver_examples
├── demo_apps
├── driver_examples
├── multicore_examples
├── project_template
└── rtos_examples

As an example, we will build the helloworld application:

~/freertos$ cd boards/evk*/demo_apps/hello_world/armgcc/
~/freertos/boards/evk*/demo_apps/hello_world/armgcc$ ./build_release.sh
~/freertos/boards/evk*/demo_apps/hello_world/armgcc$ ls release/
hello_world.bin  hello_world.elf

You can then copy that hello_world.bin firmware to the root of the eMMC or any other storage you use.

Run the demo apps

Basic setup

By default, U-Boot loads the firmware from eMMC to TCM.

Before going any further, make sure to hook up the second serial port to your machine as the one marked as “console” will be used for U-Boot and the other one will display data coming from the MCU.

This blog post only considers the firmware file is named m4_fw.bin, if you wish to use another name, you need to set the m4image variable:

=> setenv m4image hello_world.bin
=> saveenv

If you want to load the MCU fimware manually from eMMC, here is the procedure:

=> load mmc 0 $m4loadaddr $m4image
=> bootaux $m4loadaddr

If you want to load the MCU fimware from TFTP:

=> dhcp $m4loadaddr 192.168.1.60:$m4image
=> bootaux $m4loadaddr

In order to start the MCU automatically at boot up, we need to set a variable that will tell the boot.scr to load the firmware.

To do so, make sure to save this variable.

=> setenv m4enabled 1
=> saveenv

Hello World app

The Hello World project is a simple demonstration program that uses the BSP software. It prints the “Hello World” message to the ARM Cortex-M terminal using the BSP UART drivers.

The purpose of this demo is to show how to use the UART and to provide a simple project for debugging and further development.

In U-Boot, type the following:

=> setenv m4image hello_world.bin
=> load mmc 0 $m4loadaddr $m4image
=> bootaux $m4loadaddr

On the second serial port, you should see the following output:

Hello World!

You can then type anything in that terminal, it will be echoed back to the serial port as you can see in the source code.

RPMsg TTY demo

This demo application demonstrates the RPMsg remote peer stack. It works with Linux RPMsg master peer to transfer string content back and forth. The Linux driver creates a tty node to which you can write to. The MCU displays the data and echoes back the same message as an acknowledgement. The tty reader on ARM Cortex-A core can get the message, and start another transaction. The demo demonstrates RPMsg’s ability to send arbitrary content back and forth.

In U-Boot, type the following in order to boot the OS automatically while loading the M core:

=> setenv m4image rpmsg_lite_str_echo_rtos.bin
=> setenv m4enabled 1
=> boot

On the second serial port, you should see the following output:

RPMSG String Echo FreeRTOS RTOS API Demo...

Once Linux has booted up, you need to load the RPMsg module so the communication between the two cores can start.

# modprobe imx_rpmsg_tty
# echo "this is a test" > /dev/ttyRPMSG30  

The last command above writes into the tty node, which means that the Cortex-M should have received data as it can be seen on the second serial port.

Nameservice sent, ready for incoming messages...
Get Message From Master Side : "hello world!" [len : 12]
Get Message From Master Side : "this is a test" [len : 14]
Get New Line From Master Side

RPMsg Ping Pong demo

Same as previous demo, this one demonstrates the RPMsg communication. After the communication channels are created, Linux OS transfers the first integer to FreeRTOS OS. The receiving peer adds 1 to the integer and transfers it back, a hundred times and then stops.

In U-Boot, type the following:

=> setenv m4image rpmsg_lite_pingpong_rtos_linux_remote.bin
=> setenv m4enabled 1
=> boot

On the second serial port, you should see the following output:

RPMSG Ping-Pong FreeRTOS RTOS API Demo...

Once Linux has booted up, you need to load the RPMsg module so the communication between the two cores can start.

# modprobe imx_rpmsg_pingpong
[   30.501148] get 1 (src: 0x1e)
[   30.506527] get 3 (src: 0x1e)
...
[   30.730958] get 101 (src: 0x1e)
[   30.734104] imx_rpmsg_pingpong virtio0.rpmsg-openamp-demo-channel.-1.30: goodbye!

While you can send the received data from the MCU on the main serial port, you can also see the data received from the MPU on the secondary serial port.

RPMSG Share Base Addr is 0xb8000000
Link is up!
Nameservice announce sent.
Waiting for ping...
Sending pong...
...
Waiting for ping...
Sending pong...
Ping pong done, deinitializing...
Looping forever...

 

That’s it, you should now be able to build, modify, run and debug 

The post FreeRTOS SDK v2.9 release for i.MX 8M platforms appeared first on Boundary Devices.

Mender support on i.MX8 platforms

$
0
0

We are pleased to announce a partnership with Mender and provide support for Mender on our Nitrogen8M and Nitrogen8M Mini platforms based on i.MX8 processors! We also plan to support Nitrogen8M Nano and Nitrogen8M Plus in the near future.

What is Mender?

Mender.io is a secure, robust and efficient end-to-end over-the-air (OTA) software update manager for embedded devices. It is open source with an active community supporting a large number of different hardware and operating systems.

Visit Mender.io and Mender Hub community to learn more.

How to Use Mender with Nitrogen8M

In this post, we will be using Mender in conjunction with Yocto to demonstrate a simple OTA update on our Nitrogen8M platform.  We will be using Nitrogen8M as an example, but the same applies for Nitrogen8M Mini. 

1- Setup Mender trial server on hosted.mender.io

Sign up for a trial here 

2- Grab Organization token

After signing up and logging in, click your email at the top right and then “My organization”:

Then click “COPY TO CLIPBOARD” next to Organization token. Temporarily copy this somewhere, as we will be using it in next step:

3- Build Procedure

We will be using the dunfell branch of our boundary-bsp-platform repository. 

To build the image, we recommend using a Docker Container so that you can build with a reproducible and stable build environment. Otherwise, you’ll need these packages installed as well as this repo tool that can be installed like this:

~$ sudo apt-get install repo

Then create your build directory and initialize everything.

~$ mkdir ~/yocto-mender && cd yocto-mender
~/yocto-mender$ repo init -u https://github.com/boundarydevices/boundary-bsp-platform.git -m mender.xml -b dunfell
~/yocto-mender$ repo sync

Next, setup the environment for building. 

~/yocto-dunfell$ source setup-environment-mender nxp

Now we need to define a few things in local.conf.

First, we need to specify our MACHINE and DISTRO in local.conf.  For this image we will be building our boundary-wayland distro for the nitrogen8m   

MACHINE ?= "nitrogen8m"

DISTRO ?= "boundary-wayland"

Next, we need to copy the Organization token from the step above to local.conf. Copy the following to local.conf:

MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "<token_from_above_step>"

Then, we need to define what Uboot binary to build. You can find out what Uboot needs to go on your board by seeing what “uboot_defconfig” is defined as in you board’s uboot:

=> print uboot_defconfig 
uboot_defconfig=nitrogen8m

In this case, we are building for nitrogen8m so define the following in local.conf:

UBOOT_DTB_NAME = "imx8mq-nitrogen8m.dtb"
BOUNDARY_DEVICES_UBOOT_DEFCONFIG = "nitrogen8m"

NOTE: In this case, the MACHINE conf (nitrogen8m.conf) will specify to build this binary by default. However, there are several board variants one can build for, so the above variable definitions are required.

Lastly, we need to accept the Freescale EULA located in “sources/meta-freescale/EULA’. Please read it and accept by adding the following to local.conf:

ACCEPT_FSL_EULA = "1"

Now bitbake boundary-image-multimedia-full which is equivalent to fsl-image-multimedia-full with Boundary-specific packages added such as BD-SDMAC support.

~/yocto-mender/build$ bitbake boundary-image-multimedia-full

The image file will deploy to tmp/deploy/images/{MACHINE}/boundary-image-multimedia-full-{MACHINE}.sdimg

4- Flash image

You can program the SW to eMMC using the instructions below:

programming-emmc-on-i-mx-platforms

You can also program the SW to SD Card or USB Stick via zcat and dd under Linux:

~$ sudo dd if=*boundary-image*.sdimg of=/dev/sdX bs=1M && sync

In addition, you can use the balenaEtcher utility to flash the eMMC, SD Card or USB stick via Windows or Linux:

balenaEtcher 

5- Boot device and upgrade uboot

The boot partition of the image will contain both the uboot binary and the upgrade.scr script required for updating the uboot. We will upgrade the uboot with “run upgradeu”:

=> ls mmc 0
28801536 Image
4665 boot.scr
55674 imx8mq-nitrogen8m-edp.dtb
55803 imx8mq-nitrogen8m-m4.dtb
55722 imx8mq-nitrogen8m-tc358743.dtb
55670 imx8mq-nitrogen8m.dtb
51571 imx8mq-nitrogen8m_som-m4.dtb
51438 imx8mq-nitrogen8m_som.dtb
1278752 u-boot.nitrogen8m
5732 upgrade.scr

10 file(s), 0 dir(s)
=> run upgradeu
starting USB...
Bus usb@38100000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@38200000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@38100000 for devices... 1 USB Device(s) found
scanning bus usb@38200000 for devices... 3 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
scanning usb for ethernet devices... 0 Ethernet Device(s) found

Device 0: unknown device
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /upgrade.scr
5732 bytes read in 12 ms (465.8 KiB/s)
## Executing script at 40480000
cpu2=8M
cpu3=8MQ
1278752 bytes read in 20 ms (61 MiB/s)
switch to partitions #0, OK
mmc0(part 0) is current device

MMC read: dev # 0, block # 66, count 2498 ... 2498 blocks read: OK
byte at 0x42000400 (0xd1) != byte at 0x42400400 (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 2498 ... 2498 blocks written: OK
switch to partitions #0, OK
mmc0(part 0) is current device
---- U-Boot upgraded. The board will now reset.
resetting ...

after the board resets, reset the environment variables to default and reboot:

=> env default -a
## Resetting to default environment
=> savee
Saving Environment to MMC... Writing to redundant MMC(0)... OK
=> reset

6- Accept Pending device in Mender Dashboard

After booting, make sure your device is connected to the internet. Now, it will show up as a Pending device in the Dashboard:

Click the “+” icon under “Pending devices”, then select your device and click the “+” icon in the lower right corner and accept:

Now your device will show up in the Dashboard:

7- Prepare a release artifact

We are now ready to test a rootfs update. First, we need to prepare a release artifact in the yocto build. As a test, we can simply just increment the release number, but keep the same rootfs. We do this in local.conf. You will notice that the starting image has a software version name “release-1”. Lets bump up to “release-2” by modifying the following line in local.conf:

MENDER_ARTIFACT_NAME = "release-2"

Now we can rebuild the image

~/yocto-mender/build$ bitbake boundary-image-multimedia-full

The mender release artifact will deploy to tmp/deploy/images/{MACHINE}/boundary-image-multimedia-full-{MACHINE}.mender

8- Upload release artifact

Now let’s take the release artifact from step 7 and upload to the Mender server. Navigate to the “Releases” tab and click “Upload”

Select the artifact from step 7 and upload:

9- Deploy release artifact

Now let’s deploy the release artifact to the Nitrogen8M. After the upload completes, it will show up as “release-2” under “Releases”. We can now click “Create Deployment With This Release”:

Select “All devices” in the drop-down and click “Next”.

Click “Next” again then click “Create”:

The board will now being to update:

Click on “View details” to see the update status:

If the update was successful, you will see the following success output:

Success! Now if we navigate to the “Devices” tab, we can see the Nitrogen8M is running software “release-2”:

There you have it! You can now integrate Mender into your Yocto BSP to perform seamless software updates.

 

If you have any issues, please email support@boundarydevices.com

The post Mender support on i.MX8 platforms appeared first on Boundary Devices.

Viewing all 391 articles
Browse latest View live