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

U-Boot environment access from any OS

$
0
0

U-Boot environment variables are an important piece of the boot process as they can customize the bootloader behavior or even set the display configuration.

This blog post will therefore detail how to access them from any OS.

It is an update to a previous article as we now use the eMMC as our bootloader storage.

What is the U-Boot environment?

As the documentation puts it: the U-Boot environment is a block of memory that is kept on persistent storage and copied to RAM when U-Boot starts. It is used to store environment variables which can be used to configure the system. The environment is protected by a CRC32 checksum.

Here are the details of a few important variables:

  • bootargs: This variable contains the Linux kernel boot arguments (cmdline)
  • bootcmd: U-Boot executes automatically that command at bootup after the countdown
  • bootdelay: Number of seconds U-Boot waits to execute the bootcmd variable
  • cmd_custom: BD-specific variable that is executed inside our bootscripts, this variable allows to modify the bootargs or even the device tree
  • fb_hdmi / fb_lvds / fb_mipi: BD-specific variables to configure the display

The persistent storage on all our i.MX8 platforms is an eMMC. The bootloader (U-Boot) and its environment are stored into the boot hardware partition which is different from the main storage area.

This boot partition usually weighs a few MegaBytes (4MB currently, but older parts only had 2MB).

The size reserved for U-Boot environment is 8kB in our default bootloader configuration which resides at the end of the boot partition.

U-Boot offers a few commands in its prompt (over serial connection) to access the environment:

  • printenv: shows all the environment variables
  • saveenv: saves the current environment into the persistent storage
  • setenv: sets a specific variable to some values

However it sometimes is useful to customers to modify the environment from the OS which we will see in the next sections.

OS integration

Accessing those variables is possible for any OS we support in our wiki thanks to the libubootenv project and its fw_printenv & fw_setenv tools.

Yocto

All our Yocto images, starting with the Honister release, now includes the tools in our default image:

You can see all the configuration files for each CPU inside the layer too:

That configuration file is always located under /etc/fw_env.config.

Ubuntu/Debian

On Ubuntu/Debian, you can install those tools like any other package:

$ sudo apt install u-boot-tools

The configuration uses mmcblk0 devices which is correct for most platforms but not all. That is why if the tool says “configuration file wrong or corrupted“, please make sure to check /etc/fw_env.config against the one from the Yocto section.

Android

Boundary Devices actually contributed to the libubootenv project to add Android support.

So we now include those tools in all our Android images starting with Android 11.

How do the tools work?

The way the tools work is identical across all OSes and relies on 2 binaries: fw_printenv & fw_setenv.

fw_printenv

This tool, as its name suggests, prints/shows all the variables from the U-Boot environment:

# fw_printenv 
arch=arm
baudrate=115200
board=nitrogen8m
board_name=nitrogen8m
...

Note that you can specify one or several variables you need to see instead of dumping all of them:

# fw_printenv board uboot_defconfig uboot_release                                                                                                                                                
board=nitrogen8m
uboot_defconfig=nitrogen8m_2gr0
uboot_release=2020.10-53225-ge71deb4

This can be useful to check the U-Boot version you are running and trigger an update if it isn’t up to date.

fw_setenv

This tool is also pretty explicit as it allows to set a variable into the U-Boot environment.

# fw_setenv test 'this is a test for the blog post'

As a result, you can see in U-Boot over the serial prompt that the variable matches the new value:

=> printenv test
test=this is a test for the blog post

Here are a few examples of useful settings from the OS:

  1. Forcing one MIPI display configuration:
# fw_setenv fb_mipi m101nwwb
  1. Adding some debug logs to the kernel:
# fw_setenv cmd_custom 'setenv bootargs ${bootargs} initcall_debug no_console_suspend'
  1. Disabling one peripheral from the device tree:
# fw_setenv cmd_custom 'fdt set uart1 status disabled;'
  1. Disabling U-Boot countdown:
# fw_setenv bootdelay 0

 

That’s it, you should now be able to read/write U-Boot environment variables from your OS.

As usual, let us know if anything is unclear.

The post U-Boot environment access from any OS appeared first on Boundary Devices.


Android 12 release for Nitrogen8 family

$
0
0

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


For the impatient

You can download the Android 12 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 s12*nitrogen8*.zip -d s12-nitrogen8
~/$ cd s12-nitrogen8
~/s12-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:

~/s12-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:\s12-nitrogen8> device\boundary\scripts\flash_fastboot.bat nitrogen8m

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 12 OS updates

Google provides a list of notable changes for developers:

  • Code based upon android-12.0.0_r26 (Jan. 2022)

SELinux

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

If you are using the userdebug build, you can 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 uses a non-A/B partitioning which allows to save some space and keep the most space for your applications.

Also, it uses the exact partitioning as previous releases to simplify the update from Android 10.

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 server settings if you plan on hosting your own updates.

Moreover this release allows 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 /sdcard/update.zip
$ adb shell 'am start -n com.fsl.android.ota/.OtaAppActivity --es OTA file:///sdcard/update.zip'

You will eventually see your platform reboot into recovery partition and apply the update.

NXP changes

NXP updated a few things in this release, some of them are worth noting:

  • Now using the external camera framework
    • Library now located under vendor/nxp-opensource/imx/camera
  • Update manifest & kernel matrix target level to 6
    • Better compatibility with future releases
    • Might require changes to your custom code to match this version
  • New CameraXBasic to showcase ISP features
    • Only available for 8MP platforms

Linux Kernel 5.10.x

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

U-Boot 2020.10

This release uses U-Boot 2020.10 like the previous version:

  • A board can reboot to fastboot from fastboot (useful during flashing process):
$ fastboot reboot bootloader
  • Also you can now flash U-Boot over fastboot as well:
$ fastboot flash bootloader flash.bin

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 HAL version
    • This release offers continuous autofocus support for our cameras
  • Support for our 802.11b/g/n/ac + BT5.0 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
  • SD card support as external storage
  • Camera settings flexibility
    • Our release allows changing the camera configuration by setting a property
    • Example with Basler + OV5640 setup for 8MP:
      adb shell setprop persist.vendor.camera.config imx8mp-basler-ov5640
  • Up to date kernel stable release
    • While NXP kernel is based upon 5.10.72 kernel, we provide latest updates up to 5.10.104
    • This includes many 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:

Otherwise, for those already familiar with our releases, here is a condensed version to get the Android 12 source code:

~/$ mkdir myandroid
~/$ cd myandroid
~/myandroid$ repo init -u https://github.com/boundarydevices/android-manifest.git \
       -b boundary-android-12.0.0_1.0.0
~/myandroid$ repo sync
~/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 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

 

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

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

Boot2Qt Embedded Qt6 Honister Release

$
0
0

We are pleased to announce a new Honister Boot2Qt Qt6 Release!

Below you will find the download links for the images and toolchains as well as detailed instructions for the build.

Prebuilt Images

You can download the Boot2Qt Yocto images from here:

You can download the Boot2Qt Linux toolchains from here:

Instructions on how to use the QBSP toolchain in your Qt application development can be found here.

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

How to Flash

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:

~$ 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 6.3 branch of the meta-boot2qt repo, which uses Qt version 6.3.0.

This image uses the honister 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 the environment.

~$ mkdir ~/b2qt6_hardknott && cd b2qt6_hardknott
~/b2qt6_hardknott$ repo init -u https://github.com/boundarydevices/boundary-bsp-platform -b honister -m b2qt.xml
~/b2qt6_hardknott$ repo sync

Then, setup the environment for building. For this image we will be building the b2qt distro for the target machine

~/hardknott$ MACHINE=<MACHINE> DISTRO=b2qt . setup-environment build

Finally, build the Boundary Boot2Qt Embedded Qt6 Image and Linux Toolchain (boundary-b2qt-embedded-qt6-image and meta-toolchain-b2qt-embedded-qt6-sdk). This can be done building the boundary-meta-b2qt-embedded-qbsp.

~/b2qt$ bitbake boundary-meta-b2qt-embedded-qbsp

Note: You can just build the Qt6 image by running “bitbake boundary-b2qt-embedded-qt6-image”.

To build a toolchain for Windows platforms add the following line to local.conf:

SDKMACHINE = "x86_64-mingw32"

If you are interested in each project revision at the time of the build for the prebuilt images, you can find a frozen manifest for those images here.

The image file will deploy to tmp/deploy/images/{MACHINE}/b2qt-embedded-qt6-image-{MACHINE}.wic.gz.

The Linux toolchain will deploy to tmp/deploy/qbsp/meta-b2qt-embedded-qbsp-x86_64-{MACHINE}-6.3.0.qbsp.

The Windows toolchain will deploy to tmp/deploy/sdk/b2qt-x86_64-mingw32-meta-toolchain-b2qt-embedded-qt6-sdk-{MACHINE}.qbsp.

Demo examples

We can run demos using the toolchain with qt creator. Below are a few examples of Qt6.3 demo applications running on our Nitrogen8M Plus.

Coffee Machine Demo

root@localhost:~# appcontroller /usr/share/examples/demos/coffee/coffee
[ 116.615345] sec_mipi_dsim_get_pms: bit_clk=415800000 415800000 ref_clk=51975000, p=5, m=40, s=0, lanes=4
[ 116.651963] pix_to_delay_byte_clocks:pix_cnt = 5, byte_clock = 51975000, pixelclock = 69300000, n=4
[ 116.661070] pix_to_delay_byte_clocks:pix_cnt = 1408, byte_clock = 51975000, pixelclock = 69300000, n=1056
[ 116.670678] pix_to_delay_byte_clocks:pix_cnt = 1410, byte_clock = 51975000, pixelclock = 69300000, n=1058
[ 116.681572] sec_mipi_dsim_config_dphy:bit_clk=420, prepare=3 zero=18 post=9 trail=4 hs_prepare=4 hs_zero=5 hs_trail=6 lpx=3 hs_exit=5
[ 116.694606] sec_mipi_dsim_config_clkctrl: bit_clk=415800, clkctrl=91f80003
qt.core.qobject.connect: QObject::connect: signal not found in QProcess
"FB_MULTI_BUFFER" "2"
"QTWEBENGINE_DISABLE_SANDBOX" "1"
"QT_IM_MODULE" "qtvirtualkeyboard"
"QT_QPA_EGLFS_FORCE888" "1"
"QT_QPA_EGLFS_FORCEVSYNC" "1"
"QT_QPA_EGLFS_KMS_ATOMIC" "1"
"QT_QPA_EGLFS_KMS_CONFIG" "/etc/kms.conf"
"QT_QPA_PLATFORM" "eglfs"
"WAYLAND_DISPLAY" "/run/wayland-0"
"/usr/share/examples/demos/coffee/coffee" QList()
QML debugging is enabled. Only use this in a safe environment.

 

Qt Quick 3D – Particles 3D Testbed Example

root@localhost:~# appcontroller /usr/share/examples/quick3d/particles3d/particles3d
qt.core.qobject.connect: QObject::connect: signal not found in QProcess
"FB_MULTI_BUFFER" "2"
"QTWEBENGINE_DISABLE_SANDBOX" "1"
"QT_IM_MODULE" "qtvirtualkeyboard"
"QT_QPA_EGLFS_FORCE888" "1"
"QT_QPA_EGLFS_FORCEVSYNC" "1"
"QT_QPA_EGLFS_KMS_ATOMIC" "1"
"QT_QPA_EGLFS_KMS_CONFIG" "/etc/kms.conf"
"QT_QPA_PLATFORM" "eglfs"
"WAYLAND_DISPLAY" "/run/wayland-0"
"/usr/share/examples/quick3d/particles3d/particles3d" QList()
QML debugging is enabled. Only use this in a safe environment.

 

WebEngine Quick Nano Browser

root@localhost:~# appcontroller /usr/share/examples/webenginequick/quicknanobrowser/quicknanobrowser
qt.core.qobject.connect: QObject::connect: signal not found in QProcess
"FB_MULTI_BUFFER" "2"
"QTWEBENGINE_DISABLE_SANDBOX" "1"
"QT_IM_MODULE" "qtvirtualkeyboard"
"QT_QPA_EGLFS_FORCE888" "1"
"QT_QPA_EGLFS_FORCEVSYNC" "1"
"QT_QPA_EGLFS_KMS_ATOMIC" "1"
"QT_QPA_EGLFS_KMS_CONFIG" "/etc/kms.conf"
"QT_QPA_PLATFORM" "eglfs"
"WAYLAND_DISPLAY" "/run/wayland-0"
"/usr/share/examples/webenginequick/quicknanobrowser/quicknanobrowser" QList()
QML debugging is enabled. Only use this in a safe environment.
Sandboxing disabled by user.
qt.webenginecontext:

GL Type: egl
Surface Type: OpenGLES
Surface Profile: NoProfile
Surface Version: 3.1
QSG RHI Backend: OpenGL
Using Supported QSG Backend: yes
Using Software Dynamic GL: no
Using Multithreaded OpenGL: yes

Init Parameters:
* application-name quicknanobrowser
* browser-subprocess-path /usr/libexec/QtWebEngineProcess
* disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture
* disable-speech-api
* enable-features NetworkServiceInProcess,TracingServiceInProcess
* enable-threaded-compositing
* in-process-gpu
* no-sandbox
* use-gl egl

Display support

Please make sure your platform includes the latest U-Boot:

This version of U-Boot supports the display configuration, allowing to use any of the following displays:

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

The post Boot2Qt Embedded Qt6 Honister Release appeared first on Boundary Devices.

Ubuntu Jammy Jellyfish 22.04 unified image for Nitrogen8 boards

$
0
0
Ubuntu 22.04 LTS Weston Compositor
Ubuntu Jammy Jellyfish 22.04 LTS Weston/Wayland Compositor

Boundary Devices is proud to release our new Ubuntu Jammy image for all our Nitrogen8 boards!

This image uses Weston which is the reference Wayland compositor.

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 licensed content, so you will need to register on our website and log in before you can accept the license agreement and download the Ubuntu Jammy images for Nitrogen8 from here:

For Nitrogen8M, Nitrogen8M SOM, Nitrogen8M Mini, Nitrogen8M Mini SOM, Nitrogen8M NanoNitrogen8M Nano SOM, Nitrogen8M Plus SOM

This is a unified image for the aforementioned boards, there is no need for board specific images anymore. At the first start it will detect the board type run a configuration script. Finally, it will set all board specific parameters and apt repositories.

Important!

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

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

You can find the bootscript in the /boot sub-directory now, its named boot.scr. The partition labels are set if you use dd or Balena Etcher to flash the image.

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

Programming the image

As usual, we recommend using the Balena Etcher tool to flash your SD Card / eMMC:

The uncompressed image size is slightly bigger than 5GB, you’ll need at least 8GB eMMC storage to install it.

Please watch this video for the detailed instructions:


Usernames and passwords

We predefined two users for use on the system: ubuntu and root. The password for each is Boundary (capital B). The user ubuntu has administrator rights, but you don’t need to enter password at sudo command.

We wanted to make your life easier at the cost of some security, but if you want to change that please type:

ubuntu@jammy-dev64:~$ sudo visudo

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

An ssh server is running 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@jammy-dev64:~$ sudo mkdir /root/.ssh
ubuntu@jammy-dev64:~$ sudo nano /root/.ssh/authorized_keys
... paste content of $HOME/.ssh/id_rsa.pub here
ubuntu@jammy-dev64:~$ sudo chmod 600 /root/.ssh/auth*
ubuntu@jammy-dev64:~$ sudo chmod 600 /root/.ssh/

What’s supported?

Since the images above include our stable 5.15.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 ubuntu 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.15.x branch ( meta-package name: linux-boundary-20j ).
GPU driver was upgraded to Vivante 6.4.3p4.0 ( meta-package name: imx-gpu-viv-j20-… ).
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 upgraded to imx-gpu-sdk 5.7.1 . 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 Ubuntu Jammy 22.04 LTS . Here are some main component versions of these Ubuntu Jammy images for Nitrogen8:

  • Xorg server 21.1.3-2ubuntu2
  • gstreamer1.0 1.18.5
  • bluez 5.64-0ubuntu1
  • Qt 5.15.3+dfsg-2
  • apt 2.4.5
  • dpkg 1.21.1ubuntu2.1
  • gcc/g++ 11.2.0-19ubuntu1
  • libwayland 1.20.0-1
  • weston 9.0.0-4
  • the image supports the Silex WiFi / Bluetooth module

CPU-specific package selection

This is a unified image for the entire i.MX 8M family of processors. Since each CPU has its own specific features the OS must adapt to each platform.

That is why, during the first boot, a new selecthw service has been created to take care of selecting the proper packages needed for your platform.

For instance, for the Nitrogen8MP platform, the OS makes sure VPU encode/decode is enabled, NPU packages are added as well as the ISP service to manage the Basler daA3840 camera.

After that setup, the platform will need to reboot for those changes to be taken into account.

Thankfully, you can see the progress of that process on the display as shown below:


Network Manager

This Ubuntu Jammy image comes with Network Manager by default in order to ease the Wi-Fi setup.

ubuntu@jammy-dev64mp:~$ nmcli radio wifi on
ubuntu@jammy-dev64mp:~$ nmcli d wifi list
IN-USE  BSSID              SSID             MODE   CHAN  RATE        SIGNAL  BA>
        A4:3E:51:08:54:F5  Jabu             Infra  1     130 Mbit/s  62      ▂▄>
        A4:3E:51:08:54:F6  Jabu_5GHz        Infra  36    405 Mbit/s  57      ▂▄>

ubuntu@jammy-dev64mp:~$ sudo nmcli d wifi connect Jabu_5GHz password XXXXXX
Device 'wlan0' successfully activated with '4ed596ea-9f8c-48ea-8e0e-5e190e2fecc9'.
ubuntu@jammy-dev64mp:~$ ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.61  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::2ae4:f7d2:3cc1:486d  prefixlen 64  scopeid 0x20
        inet6 2a01:cb00:f55:7f00:3122:4891:67c4:faa7  prefixlen 64  scopeid 0x0
        inet6 2a01:cb00:f55:7f00:6c92:60ad:c2ad:68cc  prefixlen 64  scopeid 0x0
        ether 08:3a:88:20:78:cc  txqueuelen 3000  (Ethernet)
        RX packets 67  bytes 7854 (7.8 KB)
        RX errors 0  dropped 9  overruns 0  frame 0
        TX packets 69  bytes 7666 (7.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

This allows you to use Wi-Fi right out of the box without any extra setup required.

i.MX 8M Plus support

This is the first Ubuntu Jammy image to officially support the i.MX 8M Plus CPU and therefore our Nitrogen8MP SOM.

The support includes:

  • VPU decode/encode
  • GPU 3D & 2D support
  • NPU integration (TFLite & ARMNN)
  • ISP + Basler daA3840 support


GPU SDK Bloom demo.

Vulkan Texture Arrays Demo
Vulkan Texture Arrays Demo

Vulkan Instanced Mesh Rendering
Vulkan Instanced Mesh Rendering

Hobbit Video Streaming
Hobbit Video Streaming

As I mentioned before, the system boots to Weston compositor.

If you don’t want to start Weston at boot automatically, you have to disable the service, you have to type the following:

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

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

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

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

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

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):
[shell] binding-modifier={none | ctrl | alt | super}

The mod key is the same as the super key by default.

The super key is in between <Left Ctrl> and <Left Alt>, usually a <Windows> 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:

<Touch>, <Left button>, <Right button>
Activate clicked window

super + Alt + <Vertical scroll>
Change the opacity of a window

mod + <Vertical scroll>
Zoom/magnify the visible desktop

mod + <Left button>
Click and drag to move a window

mod + Shift + <Left button>,  mod + <Right button>,  mod + <Touch>
Click and drag to resize a window

mod + <Middle button>
Rotate the window (if supported)


 

The post Ubuntu Jammy Jellyfish 22.04 unified image for Nitrogen8 boards appeared first on Boundary Devices.

Yocto Kirkstone Release for i.MX 8 Platforms

$
0
0

We are pleased to announce a new Yocto release Kirkstone for our Nitrogen8 family of SBCs and SOMs based on i.MX 8 processors. This release includes our latest 5.15 kernel. Below you will find download links for the images as well as detailed instructions for building including a features set.

For the Impatient

You can download the Yocto images from here:

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-mx-platforms

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 kirkstone 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 ~/kirkstone && cd kirkstone
~/kirkstone$ repo init -u https://github.com/boundarydevices/boundary-bsp-platform -b kirkstone
~/kirkstone$ repo sync

Next, setup the environment for building. For this image we will be building the boundary-xwayland distro for the target machine

~/kirkstone$ MACHINE=<MACHINE> DISTRO=boundary-xwayland . setup-environment build

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

~/kirkstone/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 image built above contains the following components:

  • Linux kernel 5.15.y
  • U-Boot 2020.10
  • Weston 9.0.0 for i.MX
  • GStreamer 1.18.5 for i.MX
  • GPU Vivante libraries 6.4.3p2.4
  • VPU Hantro libraries v1.24.0
  • ISP VVCAM v4.2.2.16
  • qcacld-lea-3.1 Wi-Fi driver for BD-SDMAC
  • BlueZ 5.64 with support for BD-SDMAC

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

Display support

Please make sure your platform includes the latest U-Boot:

This version of U-Boot supports the display configuration, allowing to use any of the following displays:

Note that we’ve noticed that the NXP HDMI driver is picky when it comes to custom display timings (sometimes refuses to set the clock).

So if you are experiencing any issue with HDMI, please try entering the following commands in U-Boot in order to force the use of standard timings:

=> setenv cmd_custom 'setenv bootargs $bootargs drm_kms_helper.edid_firmware=HDMI-A-1:edid/1280x720.bin'
=> saveenv

GPU acceleration

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

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

Camera input

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

root@<MACHINE>:~# gst-launch-1.0 v4l2src device=/dev/video0 ! \
    video/x-raw,width=1280,height=720 ! waylandsink

Basler camera input

This build fully supports the Basler daA3840 8MP camera from Basler when using our Nitrogen 8M Plus 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/video2 ! waylandsink
...
[  352.348796] wdr3 res: 1920 1080 
[  352.352471] enter isp_mi_start
[  357.581179] ###### 62.42 fps ######
[  362.771924] ###### 62.42 fps ######

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

Wi-Fi can be tested with nmcli as shown below:

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@<MACHINE>:~# 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>:~# hciconfig hci0 up
root@<MACHINE>:~# hcitool scan
Scanning ...

VPU decoding

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

root@<MACHINE>:~# wget http://linode.boundarydevices.com/videos/Hobbit-1080p.mov
root@<MACHINE>:~# gplay-1.0 /home/root/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@<MACHINE>:~# 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@<MACHINE>:~# gst-launch-1.0 filesrc location=test.h264 typefind=true ! 'video/x-h264' ! \
                    h264parse ! vpudec ! waylandsink

CAN

For platforms with CAN, you’ll be able to bring up the interface(s) using this following command:

root@<MACHINE>:~# ip link set can0 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.

 

NPU support

NPU support is fully integrated into this build when using our Nitrogen 8M Plus with TensorFlowLite and ARMNN support of the NPU.

You can find various example demos here:

IMX-MACHINE-LEARNING-UG.pdf

 

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

The post Yocto Kirkstone Release for i.MX 8 Platforms appeared first on Boundary Devices.

Buildroot 2022.08 release for i.MX platforms

$
0
0

Buildroot 2022.08 has been published and we’re excited to share new images!Buildroot

For the impatient

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

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

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

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

What’s new?

Buildroot 2022.08 release

It would be too long of a list to enumerate all the changes Buildroot went through since the 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

As usual, we provide our own Boundary Devices external layer:

This includes the following custom configurations

New features

Buildroot 2022.08 includes the following versions of packages:

  • BlueZ5 5.64
  • GStreamer 1.20.3
  • GStreamer-imx v0.13.1 for i.MX6
  • GStreamer-imx v2.1.0 for i.MX8M
  • imx-codec 4.3.5
  • imx-gpu-viv 6.4.3.p4.2
  • imx-vpu-hantro 1.26.0 for i.MX8M
  • imx-vpu-hantro-vc 1.8.0 for i.MX8MP
  • imx-vpu 5.4.39.3 for i.MX6
  • Linux kernel 5.15.y
  • qcacld-2.0 LEA-3.1 Wi-Fi driver
  • Qt5 5.15.8
  • Wayland 1.20.0
  • Weston 10.0.1

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 ~/br2022.08 && cd br2022.08
~/br2022.08$ repo init -u https://github.com/boundarydevices/buildroot-manifest -b 2022.08.x
~/br2022.08$ repo sync
  1. Create an output folder for your configuration:
~/br2022.08$ make BR2_EXTERNAL=$PWD/buildroot-external-boundary/ 
  -C $PWD/buildroot/ O=$PWD/output nitrogen8mm_qt5_gst1_defconfig
~/br2022.08$ cd output
  1. Build the image
~/br2022.08/output$ make
  1. Your image is now ready!
~/br2022.08/output$ ls -l images/sdcard.img
~/br2022.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.

  • 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.boundarydevices.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

  • This build fully supports the Basler daA3840 8MP camera from Basler when using our Nitrogen 8M Plus
# 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 ######

 

  • 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 2022.08 release for i.MX platforms appeared first on Boundary Devices.

U-Boot v2022.04 for i.MX platforms

$
0
0

Boundary Devices is pleased to release U-Boot v2022.04 with support for all our i.MX-based 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 for these build images.

For those not sure about what to download, you can check the current configuration from the U-Boot prompt:

=> printenv uboot_defconfig

You can then follow the flashing procedure section to flash the latest binary.

What’s new?

Binman support

One big change in U-Boot v2022.04 is the use of binman, a new mechanism for building images, from simple SPL + U-Boot combinations, to more complex arrangements with many parts.

Its usage will be transparent to most of you but know that it exists, it is the tool that now puts together the flash.bin binary needed by the i.MX 8 processors.

You might wonder why it has changed? Basically the U-Boot community wants to avoid multiple image-building code for each processor that exists. NXP provides the imx-mkimage tool to create the final image but using binman gets rid of that extraneous tool and complies with mainline requirements.

If you’re interested in the subject, we recommend reading the tool README documentation.

Here is an example of the binman layout declaration for i.MX 8M Plus processors:

As binman changes the way the binaries are generated, our HAB scripts have been updated to work like before (and therefore be transparent for the user as well).

Display configuration support

Like previous U-Boot version, it supports all the different display interfaces: LVDS, MIPI, LCD, HDMI.

If you use one of our displays, it should always be auto-detected. You can list all the supported displays from the prompt:

=> fbpanel

Here is an example of how to manually set up the board for use with our BD070LIC3 MIPI display.

=> setenv fb_mipi tm070jdhg30
=> savee
=> reset

Miscellaneous improvements

Although no exhaustive list of changes is available between v2020.10 and v2022.04, we know many drivers have been improved.

For instance USB3.0 for i.MX 8M Plus processors is now working properly, allowing much faster transfers for fastboot flashing for instance.

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 -b boundary-v2022.04
~$ cd u-boot
~/u-boot$ 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$ find configs/ -name "nit*defconfig"

Building for i.MX6/7

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

~/u-boot$ sudo apt-get install crossbuild-essential-armhf
~/u-boot$ export ARCH=arm
~/u-boot$ export CROSS_COMPILE=arm-linux-gnueabihf-
~/u-boot$ make nitrogen6q_defconfig
~/u-boot$ make u-boot-dtb.imx -j8
~/u-boot$ cp u-boot.dtb.imx u-boot.nitrogen6q

Building for i.MX8

For 64-bit platforms, we’ll use nitrogen8mp_2gr0_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.17.bin
~$ chmod +x firmware-imx-8.17.bin
~$ ./firmware-imx-8.17.bin
~$ cp firmware-imx-8.17/firmware/hdmi/cadence/signed_hdmi_imx8m.bin u-boot/
~$ cp firmware-imx-8.17/firmware/ddr/synopsys/lpddr4*.bin u-boot/
~$ cd u-boot
~/u-boot$ make nitrogen8mp_2gr0_defconfig
~/u-boot$ make -j8

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

~/u-boot$ cp flash.bin u-boot.nitrogen8mp_2gr0

Flashing procedure

For i.MX 8 platforms, the easiest might be to use fastboot to flash the bootloader:

  1. Enter fastboot mode
    => fastboot 0
  2. Connect your PC to the platform
    • Either microUSB or TypeC cable depending on the platform
    • You can check fastboot support for Windows here
  3. Flash the bootloader
    ~$ fastboot flash bootloader u-boot.<uboot_defconfig>

For all platforms, 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/$ ./copy_upgrade.sh <mount_path>/

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 worthwhile 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

As a final note, if you’ve somehow managed to brick your board and need help, we already wrote a blog post here to assist.

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

Boot2Qt Embedded Qt6 Kirkstone Release

$
0
0

We are pleased to announce a new Kirkstone Boot2Qt Qt6 Release for our Nitrogen8 family of SBCs and SOMs based on i.MX 8 processors! This release uses the latest Qt-6.4.1 and includes our latest 5.15 kernel.

Below you will find the download links for the images and toolchains as well as detailed instructions for the build.

Prebuilt Images

You can download the Boot2Qt Yocto images from here:

You can download the Boot2Qt Linux toolchains from here:

You can download the Boot2Qt Windows toolchains from here:

Instructions on how to use the QBSP toolchain in your Qt application development can be found here.

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

How to Flash

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:

~$ 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 6.4.1 branch of the meta-boot2qt repo, which uses Qt version 6.3.0.

This image uses the kirkstone 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 the environment.

~$ mkdir ~/b2qt6_kirkstone && cd b2qt6_kirkstone
~/b2qt6_kirkstone$ repo init -u https://github.com/boundarydevices/boundary-bsp-platform -b kirkstone -m b2qt.xml
~/b2qt6_kirkstone$ repo sync

Then, setup the environment for building. For this image we will be building the boundary-b2qt distro for the target machine

~/kirkstone$ MACHINE=<MACHINE> DISTRO=boundary-b2qt . setup-environment-b2qt build

Finally, build the Boundary Boot2Qt Embedded Qt6 Image and Linux Toolchain (boundary-b2qt-embedded-qt6-image and meta-toolchain-b2qt-embedded-qt6-sdk). This can be done building the boundary-meta-b2qt-embedded-qbsp.

~/b2qt$ bitbake boundary-meta-b2qt-embedded-qbsp

Note: You can just build the Qt6 image by running “bitbake boundary-b2qt-embedded-qt6-image”.

To build a toolchain for Windows platforms add the following line to local.conf:

SDKMACHINE = "x86_64-mingw32"

If you are interested in each project revision at the time of the build for the prebuilt images, you can find a frozen manifest for those images here.

The image file will deploy to tmp/deploy/images/{MACHINE}/boundary-b2qt-embedded-qt6-image-{MACHINE}.wic.gz.

The Linux toolchain will deploy to tmp/deploy/qbsp/boundary-meta-b2qt-embedded-qbsp-x86_64-{MACHINE}-6.4.1.qbsp.

The Windows toolchain will deploy to tmp/deploy/qbsp/boundary-meta-b2qt-embedded-qbsp-x86_64-mingw32-{MACHINE}-6.4.1.qbsp.

Demo examples

We can run demos using the toolchain with qt creator. Below are a few examples of Qt6.4.1. demo applications running on our Nitrogen8M Plus. Note that we are downloading the prebuilt demos from our linode server so that you can test without the toolchain.

Coffee Machine Demo

root@localhost:~# wget http://linode.boundarydevices.com/coffee
root@localhost:~# appcontroller coffee
[ 116.615345] sec_mipi_dsim_get_pms: bit_clk=415800000 415800000 ref_clk=51975000, p=5, m=40, s=0, lanes=4
[ 116.651963] pix_to_delay_byte_clocks:pix_cnt = 5, byte_clock = 51975000, pixelclock = 69300000, n=4
[ 116.661070] pix_to_delay_byte_clocks:pix_cnt = 1408, byte_clock = 51975000, pixelclock = 69300000, n=1056
[ 116.670678] pix_to_delay_byte_clocks:pix_cnt = 1410, byte_clock = 51975000, pixelclock = 69300000, n=1058
[ 116.681572] sec_mipi_dsim_config_dphy:bit_clk=420, prepare=3 zero=18 post=9 trail=4 hs_prepare=4 hs_zero=5 hs_trail=6 lpx=3 hs_exit=5
[ 116.694606] sec_mipi_dsim_config_clkctrl: bit_clk=415800, clkctrl=91f80003
qt.core.qobject.connect: QObject::connect: signal not found in QProcess
"FB_MULTI_BUFFER" "2"
"QTWEBENGINE_DISABLE_SANDBOX" "1"
"QT_IM_MODULE" "qtvirtualkeyboard"
"QT_QPA_EGLFS_FORCE888" "1"
"QT_QPA_EGLFS_FORCEVSYNC" "1"
"QT_QPA_EGLFS_KMS_ATOMIC" "1"
"QT_QPA_EGLFS_KMS_CONFIG" "/etc/kms.conf"
"QT_QPA_PLATFORM" "eglfs"
"WAYLAND_DISPLAY" "/run/wayland-0"
"/usr/share/examples/demos/coffee/coffee" QList()
QML debugging is enabled. Only use this in a safe environment.

 

Qt Quick 3D – Particles 3D Testbed Example

root@localhost:~# wget http://linode.boundarydevices.com/particles3d
root@localhost:~# appcontroller particles3d
qt.core.qobject.connect: QObject::connect: signal not found in QProcess
"FB_MULTI_BUFFER" "2"
"QTWEBENGINE_DISABLE_SANDBOX" "1"
"QT_IM_MODULE" "qtvirtualkeyboard"
"QT_QPA_EGLFS_FORCE888" "1"
"QT_QPA_EGLFS_FORCEVSYNC" "1"
"QT_QPA_EGLFS_KMS_ATOMIC" "1"
"QT_QPA_EGLFS_KMS_CONFIG" "/etc/kms.conf"
"QT_QPA_PLATFORM" "eglfs"
"WAYLAND_DISPLAY" "/run/wayland-0"
"/usr/share/examples/quick3d/particles3d/particles3d" QList()
QML debugging is enabled. Only use this in a safe environment.

 

WebEngine Quick Nano Browser

root@localhost:~# wget http://linode.boundarydevices.com/quicknanobrowser
root@localhost:~# appcontroller quicknanobrowser
qt.core.qobject.connect: QObject::connect: signal not found in QProcess
"FB_MULTI_BUFFER" "2"
"QTWEBENGINE_DISABLE_SANDBOX" "1"
"QT_IM_MODULE" "qtvirtualkeyboard"
"QT_QPA_EGLFS_FORCE888" "1"
"QT_QPA_EGLFS_FORCEVSYNC" "1"
"QT_QPA_EGLFS_KMS_ATOMIC" "1"
"QT_QPA_EGLFS_KMS_CONFIG" "/etc/kms.conf"
"QT_QPA_PLATFORM" "eglfs"
"WAYLAND_DISPLAY" "/run/wayland-0"
"/usr/share/examples/webenginequick/quicknanobrowser/quicknanobrowser" QList()
QML debugging is enabled. Only use this in a safe environment.
Sandboxing disabled by user.
qt.webenginecontext:

GL Type: egl
Surface Type: OpenGLES
Surface Profile: NoProfile
Surface Version: 3.1
QSG RHI Backend: OpenGL
Using Supported QSG Backend: yes
Using Software Dynamic GL: no
Using Multithreaded OpenGL: yes

Init Parameters:
* application-name quicknanobrowser
* browser-subprocess-path /usr/libexec/QtWebEngineProcess
* disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture
* disable-speech-api
* enable-features NetworkServiceInProcess,TracingServiceInProcess
* enable-threaded-compositing
* in-process-gpu
* no-sandbox
* use-gl egl

Display support

Please make sure your platform includes the latest U-Boot:

This version of U-Boot supports the display configuration, allowing to use any of the following displays:

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

The post Boot2Qt Embedded Qt6 Kirkstone Release appeared first on Boundary Devices.


Mender Kirkstone Release for i.MX8 platforms

$
0
0

We are pleased to announce a new Mender release Kirkstone for our Nitrogen8 family of SBCs and SOMs based on i.MX 8 processors.

Previously, we only had support on our Nitrogen8M and Nitrogen8M Mini platforms, but this release now includes support for our Nitrogen8M Nano and Nitrogen8M Plus platforms as well!

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 all of the Nitrogen8 family.

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 kirkstone 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 kirkstone
~/yocto-mender$ repo sync

Next, setup the environment for building.

~/yocto-mender$ 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-xwayland distro for the nitrogen8m

MACHINE = "nitrogen8m"

DISTRO = "boundary-xwayland"

NOTE: There will be an existing MACHINE and DISTRO defined by default in local.conf. Please replace these definitions.

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>"

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 Kirkstone Release for i.MX8 platforms appeared first on Boundary Devices.

Android 12.1 release for Nitrogen8 family

$
0
0

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


For the impatient

You can download the Android 12 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 s12*nitrogen8*.zip -d s12-nitrogen8
~/$ cd s12-nitrogen8
~/s12-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 16GB will be flashed.

But, if you have an “old” board, it will most likely include 8GB of eMMC; here is the command to use its full size:

~/s12-nitrogen8$ ./device/boundary/scripts/flash_fastboot.sh -s 8

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

C:\s12-nitrogen8> device\boundary\scripts\flash_fastboot.bat nitrogen8m

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 12 OS updates

Google provides a list of notable changes for developers:

  • Support of split screens allowing several apps to run in parallel.
  • Code based upon android-12.1.0_r11 (July 2022)

SELinux

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

If you are using the userdebug build, you can 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 uses a non-A/B partitioning which allows to save some space and keep the most space for your applications.

Also, it does not use the same partitioning as previous releases as some partitions got bigger, breaking partitioning compatibility unfortunately.

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 server settings if you plan on hosting your own updates.

Moreover this release allows 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 /sdcard/update.zip
$ adb shell 'am start -n com.fsl.android.ota/.OtaAppActivity --es OTA file:///sdcard/update.zip'

You will eventually see your platform reboot into recovery partition and apply the update.

A/B OTA updates

This release is our first one to support A/B partitioning scheme! Non-A/B remains the default option when building the BSP, however switching to A/B is as easy as setting an environment variable:

$ export AB_OTA_UPDATER=true
$ make -j12

Moreover, instead of duplicating all partitions twice, this release enables new AOSP features:

Regarding any sample app/process to update the system, one can use the SystemUpdaterSample app included in the image:

Otherwise, if you have an ADB access to the platform, you can push the update as follows from the top of your build:

$ system/update_engine/scripts/update_device.py $OUT/nitrogen*-ota*.zip

If you have any questions/interest in this approach, feel free to contact us.

Linux Kernel 5.15.x

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

U-Boot 2022.04

This release uses U-Boot 2022.04:

  • A board can reboot to fastboot from fastboot (useful during flashing process):
$ fastboot reboot bootloader
  • Also you can now flash U-Boot over fastboot as well:
$ fastboot flash bootloader flash.bin

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 HAL version
    • This release offers continuous autofocus support for our cameras
  • Support for our 802.11b/g/n/ac + BT5.0 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
  • SD card support as external storage
  • Camera settings flexibility
    • Our release allows changing the camera configuration by setting a property
    • Example with Basler + OV5640 setup for 8MP:
      adb shell setprop persist.vendor.camera.config imx8mp-basler-ov5640

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:

Otherwise, for those already familiar with our releases, here is a condensed version to get the Android 12 source code:

~/$ mkdir myandroid
~/$ cd myandroid
~/myandroid$ repo init -u https://github.com/boundarydevices/android-manifest.git \
       -b boundary-android-12.1.0_1.0.0
~/myandroid$ repo sync
~/myandroid$ source build/envsetup.sh
~/myandroid$ lunch
... choose nitrogen8m / nitrogen8mm / 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 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

 

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

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

Chromium Support on i.MX 8 Platforms running Yocto

$
0
0

We are pleased to announce Chromium Support on our i.MX 8 Platforms that are running Yocto! This has been a long time coming for i.MX 8, but Chromium is now fully supported and most notably supports hardware accelerated video decoding.

Build Info

Chromium is included in our latest Yocto Kirkstone image with the following specs:

GPU Specs

As we mentioned, hardware accelerated video decoding is supported. Here are the full GPU specs below shown directly from the browser running on the platform:

Video Demo

Below you will find a demo of Chromium running on our Nitrogen8M PLUS SOM running Yocto Kirkstone.

The post Chromium Support on i.MX 8 Platforms running Yocto appeared first on Boundary Devices.

FreeRTOS SDK v2.13 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.13 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!

What’s new?

As usual, it’s best to look into the source code to see the differences. However we note the following changes:

  • Update to NXP latest BSP v2.13
  • FreeRTOS kernel updated to its version 10.5.0

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, the assumption is that U-Boot is your system bootloader. 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, ensuring 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. We recommend limiting 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 it is required to use a specific device tree when using the MCU.

The device tree also declares different memory sections and reserves them for FreeRTOS communication/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:

Remoteproc

Like the previous release, this one allows to start, stop and reload  the firmware from user-space thanks to the remoteproc API!

Here is how to use that new API (using our i.MX 8M Mini platform for this example):

    1. Place your Cortex-M firmware (in elf format) under /lib/firmware/
# wget http://linode.boundarydevices.com/mcore/sdk_2.13/imx8mm/hello_world.elf \
  -o /lib/firmware/
    1. Tell the remoteproc device what is the name of your firmware
# echo hello_world.elf > /sys/class/remoteproc/remoteproc0/firmware
    1. Start the Cortex-M processor
# echo start > /sys/class/remoteproc/remoteproc0/state

At this stage, if you use the RPMSG sub-system, you can probe the module.

If you want to load another application (or another version), you only need to stop the current execution as shown below. Then you can re-iterate the above step to (re)load your app.

# echo stop > /sys/class/remoteproc/remoteproc0/state

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.13 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 it 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 rpmsg_lite_str_echo_rtos.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

Note that this section keeps on using the previous way of loading apps (from U-Boot) but you can now use the remoteproc approach if you want.

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 received data:

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 creation, 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.13 release for i.MX 8M platforms appeared first on Boundary Devices.

Summit SOM 8M Plus System-on-Module – WiFi 5 + Bluetooth 5.3

The 4 Biggest Misconceptions about Regulatory Testing and Compliance

What’s New in Bluetooth 5.4?


The Women of Laird Connectivity: Celebrating Our Women in Tech for International Women’s Day

Android 13 release for Nitrogen8 family

$
0
0

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


For the impatient

You can download the Android 13 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.

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 t13*nitrogen8*.zip -d t13-nitrogen8
~/$ cd t13-nitrogen8
~/t13-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 16GB will be flashed.

But, if you have an “old” board, it will most likely include 8GB of eMMC; here is the command to use its full size:

~/t13-nitrogen8$ ./device/boundary/scripts/flash_fastboot.sh -s 8

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

C:\t13-nitrogen8> device\boundary\scripts\flash_fastboot.bat nitrogen8m

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 13 OS updates

Google provides a list of notable changes for developers:

  • Support of split screens allowing several apps to run in parallel.
  • Code based upon android-13.0.0_r7 (October 2022)

SELinux

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

If you are using the userdebug build, you can 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 uses a non-A/B partitioning which allows to save some space and keep the most space for your applications.

Also, it does not use the same partitioning as previous releases as some partitions got bigger, breaking partitioning compatibility unfortunately.

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 server settings if you plan on hosting your own updates.

Moreover this release allows 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 /sdcard/update.zip
$ adb shell 'am start -n com.fsl.android.ota/.OtaAppActivity --es OTA file:///sdcard/update.zip'

You will eventually see your platform reboot into recovery partition and apply the update.

A/B OTA updates

This release is supporting A/B partitioning scheme! Non-A/B remains the default option when building the BSP, however switching to A/B is as easy as setting an environment variable:

$ export AB_OTA_UPDATER=true
$ make -j12

Moreover, instead of duplicating all partitions twice, this release enables new AOSP features:

Regarding any sample app/process to update the system, one can use the SystemUpdaterSample app included in the image:

Otherwise, if you have an ADB access to the platform, you can push the update as follows from the top of your build:

$ system/update_engine/scripts/update_device.py $OUT/nitrogen*-ota*.zip

If you have any questions/interest in this approach, feel free to contact us.

Linux Kernel 5.15.x

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

U-Boot 2022.04

This release uses U-Boot 2022.04:

  • A board can reboot to fastboot from fastboot (useful during flashing process):
$ fastboot reboot bootloader
  • Also you can now flash U-Boot over fastboot as well:
$ fastboot flash bootloader flash.bin

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 HAL version
    • This release offers continuous autofocus support for our cameras
  • Support for our 802.11b/g/n/ac + BT5.0 Silex Module
    • Now using non-vendor specific HAL for both BT/Wi-Fi
    • Therefore providing a generic image for all modules
  • 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
  • SD card support as external storage
  • Camera settings flexibility
    • Our release allows changing the camera configuration by setting a property
    • Example with Basler + OV5640 setup for 8MP:
      adb shell setprop persist.vendor.camera.config imx8mp-basler-ov5640

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:

Otherwise, for those already familiar with our releases, here is a condensed version to get the Android 13 source code:

~/$ mkdir myandroid
~/$ cd myandroid
~/myandroid$ repo init -u https://github.com/boundarydevices/android-manifest.git \
       -b boundary-android-13.0.0_1.0.0
~/myandroid$ repo sync
~/myandroid$ source build/envsetup.sh
~/myandroid$ lunch
... choose nitrogen8m / nitrogen8mm / 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 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

 

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

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

Green Technology Made Smarter: Yaskawa Solectria Solar’s Inverters Get an IoT Upgrade

A DIYer’s Dream: MNT’s Pocket Reform Packs Modular Computing into a Tiny Footprint

Yocto Mickledore Release for i.MX 8 Platforms

$
0
0

We are pleased to announce a new Yocto release Mickledore for our Nitrogen8’s family of SBCs and SOMs based on i.MX 8 processors. This release is based upon NXP 6.1.22_2.0.0​ release and includes our latest 6.1 kernel, as well as support for our new Nitrogen8M Plus SMARC platform. Below you will find download links for the images as well as detailed instructions for building including a features set.

For the Impatient

You can download the Yocto images from here:

Note that we now have support for sparse Fastboot Images!

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-mx-platforms

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

Lastly, if using the fastboot image, you can program the eMMC via the following:

~$ fastboot flash emmc *boundary-image*.wic.sparse

Build procedure

This image uses the boundary-imx-6.1.22-2.0.0 (mickledore) 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 ~/mickledore && cd mickledore
~/mickledore$ repo init -u https://github.com/boundarydevices/boundary-bsp-platform -b boundary-imx-6.1.22-2.0.0
~/mickledore$ repo sync

Next, setup the environment for building. For this image we will be building the fsl-imx-xwayland-boundary distro for the target machine

~/mickledore$ MACHINE=<MACHINE> DISTRO=fsl-imx-xwayland-boundary . imx-setup-release.sh -b build

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

~/mickledore/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 image built above contains the following components:

  • Linux kernel 6.1
  • U-Boot 2022.04
  • Weston 11.0.1 for i.MX
  • GStreamer 1.22.0 for i.MX
  • GPU Vivante libraries 6.4.11.p1.2
  • VPU Hantro libraries v1.29.0
  • ISP VVCAM v4.2.2.22.0
  • qcacld-lea-3.1 Wi-Fi driver for BD-SDMAC
  • BlueZ 5.66 with support for BD-SDMAC

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

Display support

Please make sure your platform includes the latest U-Boot:

This version of U-Boot supports the display configuration, allowing to use any of the following displays:

Note that we’ve noticed that the NXP HDMI driver is picky when it comes to custom display timings (sometimes refuses to set the clock).

So if you are experiencing any issue with HDMI, please try entering the following commands in U-Boot in order to force the use of standard timings:

=> setenv cmd_custom 'setenv bootargs $bootargs drm_kms_helper.edid_firmware=HDMI-A-1:edid/1280x720.bin'
=> saveenv

GPU acceleration

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

root@<MACHINE>:~# /opt/imx-gpu-sdk/GLES2/Blur/GLES2.Blur_Wayland_XDG -d

Camera input

You can test Camera MIPI-CSI input using our OV5640 MIPI with GStreamer:

root@<MACHINE>:~# gst-launch-1.0 v4l2src device=/dev/video0 ! \
    video/x-raw,width=1280,height=720 ! waylandsink

Basler camera input

This build fully supports the Basler daA3840 8MP camera from Basler when using our Nitrogen 8M Plus 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/video3 ! waylandsink
...
[  352.348796] wdr3 res: 1920 1080 
[  352.352471] enter isp_mi_start
[  357.581179] ###### 62.42 fps ######
[  362.771924] ###### 62.42 fps ######

IMX219 camera input

We now have support for the IMX219 camera using our Nitrogen8M Plus SMARC. We tested using the Arducam imx219:

It can be tested with gstreamer:

root@nitrogen8mp:~# gst-launch-1.0 -v v4l2src device=/dev/video3 ! waylandsink

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

We now have support for the LWB5+ Wifi+Bluetooth module! You can test Wi-Fi with nmcli as shown below:

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@<MACHINE>:~# 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>:~# hciconfig hci0 up
root@<MACHINE>:~# hcitool scan
Scanning ...

VPU decoding

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

root@<MACHINE>:~# wget http://linode.boundarydevices.com/videos/Hobbit-1080p.mov
root@<MACHINE>:~# gplay-1.0 /home/root/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@<MACHINE>:~# 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@<MACHINE>:~# gst-launch-1.0 filesrc location=test.h264 typefind=true ! 'video/x-h264' ! \
                    h264parse ! vpudec ! waylandsink

CAN

For platforms with CAN, you’ll be able to bring up the interface(s) using this following command:

root@<MACHINE>:~# ip link set can0 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.

NPU support

NPU support is fully integrated into this build when using our Nitrogen 8M Plus with TensorFlowLite and ARMNN support of the NPU.

You can find various example demos here:

IMX-MACHINE-LEARNING-UG.pdf

 

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

The post Yocto Mickledore Release for i.MX 8 Platforms appeared first on Boundary Devices.

Viewing all 391 articles
Browse latest View live