FAQ
This pages collects frequently ask questions regarding IoT Yocto.
Topic: Genio 350
What is the default partition size in MT8365(Genio 350) BSP?
MT8365(Genio 350) uses ‘systemd’ as default init system. Is it possible change to use ‘sysvinit’?
Why does kmscube command return with “failed to set mode: Permission denied”?
Does Genio 350 support the landscape mode to rotate the 90 degree in mipi-dsi?
How to avoid the config overwritten during porting 3rd-party Connectivity Module?
Topic: Genio 1200
Topic: Software
Why does IoT Yocto take several hours to build the first time?
Why does BitBake fail to fetch NDA repositories even though I have GitLab permissions?
Where can I find the Yocto recipes and dtbo files used in the prebuilt images?
Why can I not connect to the board by ssh over USB on Windows
What is the default partition size in MT8365(Genio 350) BSP?
MT8365(Genio 350) uses ‘systemd’ as default init system. Is it possible change to use ‘sysvinit’?
How does MT8395(Genio 1200) BootROM know which storage medium to boot from?
How to update rootfs partition only instead of updating full system image?
Open Source Tools iwpriv (from legacy wireless-tools) for MT7663
Systemd Log (journalctl) disappears after reboot. How to make them persist?
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 togitlab.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 bypoky/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:
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 |
mmc0boot1 |
4MB |
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?
meta-rity/meta/wic/rity.wks.in
.
The configuration file is written in yocto kickstart format.How to update rootfs partition only instead of updating full system image?
wic.img
in IMAGE_FSTYPES only and it will integrate all system images into one wic.img file.ext4
to IMAGE_FSTYPES in mediatek-common.inc and it would make Yocto to build an additional ext4 file for rootfs.-IMAGE_FSTYPES ?= "wic.img"
+IMAGE_FSTYPES ?= "wic.img ext4"
aiot-flash system
Open Source Tools iwpriv (from legacy wireless-tools) for MT7663
Recipe URL
SOP
Add iwpriv tool bb file into connectivity recipe
Executed build command to get code and build bin tool out
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.)
After above steps, iwpriv tool is available.
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)
Rebuild load and all done. User can execute iwpriv wlan0 driver version to confirm whether it is OK.
Does MT8365(Genio 350) BSP provide Contiguous Memory Allocator (CMA) support and reserve CMA area by default?
CONFIG_CMA_SIZE_MBYTES=32
.[ 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?
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?
MT8365(Genio 350) uses ‘systemd’ as default init system. Is it possible change to use ‘sysvinit’?
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:
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.
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:
Use git protocol re-direction:
Can you run following command on your Ubuntu machine? .. prompt:: bash $ auto
git config –global url.’http://gitlab.com’.insteadOf ‘ssh://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:
check the hardware connection - is the “MB” side of the cable facing “up”, as shown in LCM Setup on Genio 350-EVK.
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