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

Published on October 5, 2020

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://boundarydevices.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.