FAQ

This pages collects frequently ask questions regarding IoT Yocto.

Topic: Genio 350

Topic: Genio 1200

Topic: Software

Why does IoT Yocto take several hours to build the first time?

The build system have to fetch various software components from servers specified in recipes. Usually it takes 30 minutes to one hour to fetch sources, depending on your internet connection speed, and the capacity of the remote servers. It might take longer when fetching a large project such as OpenCV.

The downloaded software component sources are stored in a download folder (specified in DL_DIR variable). Since the content can be reused by each build, we recommend you to keep the folder, even if the build directory has changed. You can specify different path of download folder in DL_DIR variable in your local.conf or site.conf.

Why does BitBake fail to fetch NDA repositories even though I have GitLab permissions?

If you have confirmed your account permission, but the bitbake command still shows a fetch error:

do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'git://git@gitlab.com/mediatek/aiot/nda/xxxxxx.git;protocol=ssh;branch=main')

You might want to check the following settings:

  • In ~/.netrc, make sure there are no incorrect machine entries pointing to gitlab.com.

  • Try resetting your git credential cache. If you are using the store credential helper, you can try resetting the storage:

    git config --unset credential.helper
    git config --global --unset credential.helper
    git config --global credential.helper store
    

Where can I find the Yocto recipes and dtbo files used in the prebuilt images?

Let’s have an overview on all the Yocto meta layer used in Genio’s IoT Yocto codebase. To do so, you can visit the manifest file of each release. For example, the v22.2 release’s manifest file can be found in

https://gitlab.com/mediatek/aiot/bsp/manifest/-/blob/rity-kirkstone-v22.2/default.xml

In the XML manifest file, you can find these Yocto meta layer repositories:

  • meta-arm

  • meta-clang

  • meta-mediatek-bsp

  • meta-mediatek-demo

  • meta-mediatek-tsn

  • meta-nn

  • meta-openembedded

  • meta-qt5

  • meta-rity

  • meta-stress-test

  • meta-tensorflow

  • poky

The meta layers hosted in https://gitlab.com/mediatek/aiot/rity are provided and maintained by MediaTek. Other meta layers are maintained by third-party and used by IoT Yocto.

The essesntial meta-layers for the Genio boards are:

  • meta-mediatek-bsp is the “core” layer that provides Genio SoC and Board support, including recipes for Linux kernel (linux-mtk), bootloader, and MediaTek middleware.

  • meta-rity is the “top level wrapper” layer for image recipes. All IoT Yocto image recipes, including rity-demo-image, rity-bsp-image, rity-bringup-image are defined here. The TEMPLATECONF for intial build environment used by poky/oe-init-build-env is also defined here.

Therefore, to locate the DTBO, config fragments(.cfg) and kernel recipe, you could find them in: https://gitlab.com/mediatek/aiot/rity/meta-mediatek-bsp

To locate the exact configurations for each machine, you could dig into: https://gitlab.com/mediatek/aiot/rity/meta-mediatek-bsp/-/tree/kirkstone/conf/machine

And you’ll find some of the machines are aliases to each other. For example, the “Genio 1200 Demo Board” or “i1200-demo” board:

https://gitlab.com/mediatek/aiot/rity/meta-mediatek-bsp/-/blob/kirkstone/conf/machine/mt8395-demo.conf

are actually aliases:

MACHINEOVERRIDES =. "mt8195-demo:mt8395-demo:i1200-demo:genio-1200-demo:"

With this in mind, you can locate the DTBO files in recipes-kernel/dtbo

For example, the DTBO used in the command:

aiot-flash --load display-dsi.dtbo

can be found here. It essentially enables dsi0, mipi_tx0, disp_pwm0, and disables OVL1.

My rootfs is too small, how do I make it larger?

The BSP does not specify any storage size, so the rootfs will be just large enough to contain the content built by the yocto image. If you need to increase the size the size of the rootfs you can add the following to your local.conf:

IMAGE_ROOTFS_EXTRA_SPACE = "500000" # KBytes

IMAGE_ROOTFS_EXTRA_SPACE can be set to increase the amount of free disk space in the rootfs partition.

For more information you can check the Yocto Reference Manual.

My home partition is too small, how do I make it larger?

You can set the home partition size by setting the following variable in your local.conf:

IMAGE_HOME_SIZE = "500M"

How do I add additional applications to my image?

If you want to add new applications to your image you can set the following variable in your local.conf:

IMAGE_INSTALL:append = " \
        gdb              \
        htop             \
"

The example above will add gdb and htop to the image that gets built by bitbake.

Why can I not connect to the board by ssh over USB on Windows

By default the BSP uses the USB gadget ecm to provide a network interface over USB. Windows does not support well ecm. So if you plan to connect to the board by ssh over USB on Windows, please refer to RNDIS Setup (Windows).

Why does HDMI not work on Genio 350 EVK?

Please refer to HDMI Does Not Work on Genio 350-EVK.

Why does the error message “ERROR:aiot:No image found” shows when I flash a single partition with “aiot-flash <partition>” command?

The reason “ERROR:aiot:No image found” appears may be because aiot-flash cannot find rity.json. rity.json will indicate the correspondence between partition and image filename. aiot-flash process refers to this file to find the corresponding image. This file would only be generated after a full build (rity-demo-image) is done. After the file is generated, you can flash the single partition (e.g, kernel or bootloaders) individually with using aiot-flash <partition> command.

"partitions": {
        "mmc0": null,
        "mmc0boot0": "bl2.img",
        "mmc0boot1": "u-boot-env.bin",
        "bootloaders": "fip.bin",
        "kernel": "fitImage",
        "rootfs": null
},

What is the default partition size in MT8365(Genio 350) BSP?

The default partition size is listd in the table below.

Partition name

Size

mmc0boot0

4MB (fixed size)

mmc0boot1

4MB (fixed size)

bootloaders

4MB

kernel

15MB

rootfs

depend on the user space stuffs. (~1467 MB in rity-demo-image)

home

273 MB in rity-demo-image

How do I adjust each partition size in detail?

You can modify the system partition configuration file in meta-rity/meta/wic/rity.wks.in. The configuration file is written in yocto kickstart format.
Here is an online guideline for yocto kickstart(.wks): https://docs.yoctoproject.org/ref-manual/kickstart.html
Note that the partition size of mmc0boot0 and mmc0boot1 are not able to be modified.

How to update rootfs partition only instead of updating full system image?

In IoT Yocto build configuration, we configure wic.img in IMAGE_FSTYPES only and it will integrate all system images into one wic.img file.
If you would like to update rootfs partition only, you could add ext4 to IMAGE_FSTYPES in mediatek-common.inc and it would make Yocto to build an additional ext4 file for rootfs.
src/meta-mediatek-bsp/conf/machine/include/mediatek-common.inc
-IMAGE_FSTYPES ?= "wic.img"
+IMAGE_FSTYPES ?= "wic.img ext4"
Besides, Rootfs is split over two partitions in IoT Yocto: rootfs and home. The ext4 file contains all of them at once. You have to increase GPT rootfs partition size with the guideline on: How do I adjust each partition size in detail?.
Then, you can use the aiot-tool command below to partial update rootfs and kernel image.
aiot-flash system

Open Source Tools iwpriv (from legacy wireless-tools) for MT7663

Recipe URL

SOP

  1. Add iwpriv tool bb file into connectivity recipe

    ../_images/iwpriv_1.jpg
    ../_images/iwpriv_2.jpg
  2. Executed build command to get code and build bin tool out

    ../_images/iwpriv_3.jpg
    ../_images/iwpriv_4.jpg
    ../_images/iwpriv_5.jpg
  3. Modify tool source code to enlarge the MAX size that allowed for driver ioctl and rebuild tool (without this step, the tool will print “no private iotcl” error message.)

    ../_images/iwpriv_6.jpg
    ../_images/iwpriv_7.jpg
  4. After above steps, iwpriv tool is available.

  5. Then we need to modify kernel configuration to let iwpriv tool available for all commands used in mt76-tk-driver. (Without this step, iwpriv driver command cannot be used)

  • Set config WIRELESS_EXT to def_bool y

  • Set config WEXT_PRIV to def_bool y

../_images/iwpriv_8.jpg
../_images/iwpriv_9.jpg
  1. Rebuild load and all done. User can execute iwpriv wlan0 driver version to confirm whether it is OK.

../_images/iwpriv_10.jpg

Does MT8365(Genio 350) BSP provide Contiguous Memory Allocator (CMA) support and reserve CMA area by default?

Yes, MT8365(Genio 350) BSP has CMA area allocated for common use.
The CMA area size is 32 MB by default and configured by kernel config CONFIG_CMA_SIZE_MBYTES=32.
Users could create further CMA areas for their own use.
[    0.000000] cma: Reserved 32 MiB at 0x00000000fa000000
[    0.000000] Memory: 2939124K/3145728K available (15552K kernel code, 2894K rwdata, 8552K rodata, 6272K init, 510K bss, 173836K reserved, 32768K cma-reserved)

Does MT8365(Genio 350) BSP support recovery boot mechanism, such as dual partition backup for bootloaders/kernel images?

No, MT8365(Genio 350) BSP does not support recovery boot mechanism.

How does MT8365(Genio 350) BootROM know which storage medium to boot from, for instance how does it know to boot from eMMC and not from NAND?

MT8365(Genio 350) BootROM polling boot devices by order, eMMC first and then NAND. If there is no eMMC device, the system will boot from NAND. MT8365(Genio 350) does not support using SD Card as a boot device.

Can MT8365(Genio 350) BootROM use any other boot region for booting besides mmc0boot0, for instance mmc0boot1 if mmc0boot0 got corrupted?

Yes, mmc0boot1 be used as the boot region, and BootROM will find an available boot region to boot.
In other words, if mmc0boot0 got corrupted and mmc0boot1 is available, the system will boot from mmc0boot1.

MT8365(Genio 350) uses ‘systemd’ as default init system. Is it possible change to use ‘sysvinit’?

There is a page about init system configuration on Yocto user guideline:
User could set the configuration INIT_MANAGER = “sysvinit” in local.conf to use ‘sysvinit’ as init system.

How does MT8395(Genio 1200) BootROM know which storage medium to boot from?

MT8395(Genio 1200) BootROM supports polling mode for device booting, the polling sequence is eMMC –> UFS –> SPI NOR. If there is no eMMC device, the system will boot from the next storage medium. MT8395(Genio 1200) does not support using SD Card as a boot device.

I tried to download source code from Gitlab. Why do I get the following error: Host key verification failed. Fatal: Could not read from remote repository?

There are multiple factors affecting your connection to Gitlab. Please follow steps below to diagnose the issue:

  1. Check git HTTP/HTTPS protocol:

    Can you run the following command in your Ubuntu machine to fetch the repository directly? .. prompt:: bash $ auto

    The output should look like:

    
    

    Cloning into ‘meta-mediatek-bsp’… remote: Enumerating objects: 7604, done. remote: Counting objects: 100% (243/243), done. remote: Compressing objects: 100% (141/141), done. remote: Total 7604 (delta 137), reused 170 (delta 94), pack-reused 7361 Receiving objects: 100% (7604/7604), 1.15 MiB | 2.41 MiB/s, done. Resolving deltas: 100% (4953/4953), done.

  2. Confirm git SSH protocol:

    Can you run the following command in your Ubuntu machine to fetch the repository directly via SSH? Precondition: Make sure you have a Gitlab account and have added your SSH key to Gitlab first.

    git clone git@gitlab.com:mediatek/aiot/rity/meta-mediatek-bsp.git
    

    If you succeeded in step 1, but failed in step 2, it might indicate that your firewall settings are blocking SSH connections. In this case, please try step 3:

  3. Use git protocol re-direction:

    Can you run following command on your Ubuntu machine? .. prompt:: bash $ auto

    git config –global url.’http://gitlab.com’.insteadOfssh://git@gitlab.com

    This would enforce all the SSH connection from git program to gitlab.com into HTTP protocols. After running the command, please check step 2 again. It should work if your step 1 works. If this works, repo sync should also work, because it basically calls git clone for you.

Why does kmscube command return with “failed to set mode: Permission denied”?

kmscube creates its own window on which it renders content. So, before we launch kmscube, we must make sure that no other window system occupies the display. This means stopping the weston process that drives the desktop.

killall weston

Does MT8365 support MT6390 PMIC?

MT8365 supports MT6357 PMIC. The MT6390 PMIC is pin-to-pin compatible with MT6357 PMIC, but system software must adjust to different boot timing sequences. AIoT Open SDK currently does not support MT6390 PMIC.

Windows PC can’t recognize USB Driver

There are multiple protocols available on AIOT reference EVK’s USB ports.

Fastboot is both a protocol and a tool. It does originate from Android platform, but in IoT Yocto, we use fastboot to flash image from USB to on-board EMMC (or UFS). This is the reason why we ask you to install fastboot driver (named Android Bootloader Interface under Windows 10) before flashing your board.

ADB (Android Debugging Bridge) is also both a protocol and a tool. The goal of ADB is to provide a debugging link between the target board and host PC. As of v21.3.1, we do not provide ADB support on rity-demo-image. However, that is something we plan to add in v22.0.

Please note that not all ADB / Fastboot functions are supported on Yocto. For example, it is impossible for Yocto to support adb setprop, because Yocto does not have Android property system. Basic commands such as adb push, adb pull, adb shell could be supported.

For CDC-ECM, it is an USB Ethernet device to allow you to establish IP network link between target board and host PC. Unfortunately, Windows does not provide good support for CDC-ECM devices. You can use RNDIS device instead, please refer to RNDIS Setup (Windows).

Display function on Genio 350 doen’t work well via MIPI

Please do the following:

  1. check the hardware connection - is the “MB” side of the cable facing “up”, as shown in LCM Setup on Genio 350-EVK.

  2. please provide dmesg log and let’s see if there are kernel warnings or errors.

Does Genio 350 support the landscape mode to rotate the 90 degree in mipi-dsi?

On Genio 350(MT8365), the MIPI-DSI interface hardware itself does not support 90-degree frame buffer rotation. The OVL/RDMA hardware in the display data path also does not support hardware frame buffer rotation.

How to avoid the config overwritten during porting 3rd-party Connectivity Module?

Please do not revise the mt8365.cfg directly since the kernel module/driver is using the recipe method layer by layer in Yocto. Both the upstream version of the mt7663 or the NDA version of the mt7663 driver are packaged by the recipe/include method.

The formal way should be to build its own kernel/service recipe for a 3rd Party’s connectivity module. Please refer to below modifications.

  • kernel driver recipes:

    • meta-mediatek-bsp/recipes-kernel/mt76xx-tk/mt76xx-tk-wifi-drv.bb

    • meta-mediatek-bsp/recipes-kernel/mtk-wireless-firmware/mtk-wireless-firmware_git.bb

    • ./meta-mediatek-bsp/recipes-kernel/linux/linux-mtk/mt76xx-tk-wifi.cfg

    • ./meta-mediatek-bsp/recipes-kernel/linux/linux-mtk/btmtksdio.cfg

    • ./meta-mediatek-bsp/recipes-kernel/linux/linux-mtk/mt7663.cfg

  • user space service recipe:

    • meta-mediatek-bsp/recipes-connectivity/mt7663/

    • meta-mediatek-bsp/recipes-connectivity/mt7663/mt7663-service.bb

  • board support files:

    • meta-mediatek-bsp/conf/machine/mt8365-evk.conf:2:require include/mt7663.inc

    • meta-mediatek-bsp/conf/machine/include/mt7663.inc

And please note that kernel common include need to be updated to include your config fragments. Please refer to the followin example of mt7663.cfg in src/meta-mediatek-bsp/recipes-kernel/linux/linux-mtk-common.inc:

# Connectivity config fragments
SRC_URI:append:mt7663 = " \
        ${@bb.utils.contains('MT7663_WIFI_USE_UPSTREAM_DRV', '1', 'file://mt7663.cfg', 'file://mt76xx-tk-wifi.cfg', d)} \
        file://btmtksdio.cfg \
"

Systemd Log (journalctl) disappears after reboot. How to make them persist?

By default, Yocto maps /var/log to /volatile/log, and therefore all journal logs are dropped after system reboot.

To keep them after rebooting, add this line:

VOLATILE_LOG_DIR="no"

to your <build-dir>/conf/local.conf file and rebuild the image. After flashing and rebooting the target board, make sure that you have a /var/log/journal directory generated.

The log displayed by journalctl should persist after rebooting the board.

reference: https://docs.yoctoproject.org/4.0.7/ref-manual/variables.html#term-VOLATILE_LOG_DIR