Setup Tool Environment (Windows)

The flash programming process is performed over a USB connection between the target board and the host computer containing the image.

To do so, you need to install AIoT tools. It is a set of tools to configure or interact with MediaTek Genio boards.

Warning

You must use a Linux host computer to build the IoT Yoctoimage. The Windows tool environment can only be used for flashing the board and connecting to the board.

Windows System Requirement

To install AIoT Tools on a Windows host, you need:

  • Administrator privilege

  • Internet connection

  • Git 1.8 or later

  • Python 3.8 or later

  • pip3 20.3 or later

  • fastboot 31.0 or later

Setup Git for Windows

Visit https://gitforwindows.org/ to download and install git for Windows.

After installation, open the git bash program and execute the following configuration commands:

git config --global http.sslBackend schannel
git config --global credential.helper manager-core

This configures git to use Windows default credentials and secure connection channels.

Install Fastboot and ADB Device USB Driver

The Google USB Driver contains both device drivers for adb and fastboot on Windows. AIoT Tools require the fastboot device driver to be properly installed. adb can be used to connect to the board once it has been flashed with rity-demo-image.

To install these two drivers:

  1. Download Google USB Driver from https://developer.android.com/studio/run/win-usb

  2. Extract the downloaded zip file. The filename should be similar to usb_driver_r13-windows.zip.

  3. In the extracted directory, locate the file android_winusb.inf

  4. Right-click on the file android_winusb.inf and select Install from the context menu:

    ../../../../_images/sw_yocto_get-started_env-setup_install-android-usb-driver.png
  5. Confirm the pop-up dialog.

For details, please refer to https://developer.android.com/studio/run/oem-usb#InstallingDriver

The fastboot device driver is categorized as Android Device > Android Bootloader Interface in Windows.

Note

The fastboot device driver may not be properly detected until you actually connect the board and enter download mode. You might have to manually assign the “Unknown Device” as an Android Bootloader Device. Please refer to the troubleshooting page to do so.

Install Fastboot Tool on Windows

The fastboot program also requires separate installation.

Check if it is properly installed by following commands:

fastboot --version

The version should be greater than 31.0.

Setup Python 3 on Windows

Follow these steps:

Note

There are known issues reported for Python 3.10 on Windows platform when installing aiot-tools. If you use Windows, we recommend you to install Python 3.9.

  • Launch a Command Prompt as administrator. To do so:
    • Press Windows+R to open the Run dialog

    • Type cmd into the box and then press Ctrl+Shift+Enter to run the command prompt as an administrator.

Make sure the version of pip3 is greater than 20.3:

pip3 --version
pip 21.2.4 from c:\python39\lib\site-packages\pip (python 3.9)

Note

If your windows console cannot locate pip3, add the Python installation path and script path to your PATH environment variable, in some cases these paths are located in:

  • C:\Users\<your_username>\AppData\Local\Programs\Python\<python_version>

  • C:\Users\<your_username>\AppData\Local\Programs\Python\<python_version>\Scripts

If you are behind a corporate firewall, you might want to install additional packages to make sure Python can correctly process additional certificates:

pip3 install python-certifi-win32 --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host gitlab.com

After installation, add the following environment variable to your Windows system:

setx REQUESTS_CA_BUNDLE %LOCALAPPDATA%\.certifi\cacert.pem
set REQUESTS_CA_BUNDLE=%LOCALAPPDATA%\.certifi\cacert.pem

Note

Please use DOS Prompt or Power Shell for this operation, since git bash or cygwin would intepret \ as escape characters instead of path separators.

There are both set and setx here becuase setx only take effective on a new session, while set doesn’t change the global environment variables.

Install AIoT Tools

Run following command as administrator to install AIoT Tools:

cd %USERPROFILE%
c:
pip3 install -U -e "git+https://gitlab.com/mediatek/aiot/bsp/aiot-tools.git#egg=aiot-tools"

Please note that aiot-tools will be downloaded to your current working directory first, before being installed into your system.

Attention

Access Token as Password

Please use the generated access token instead of gitlab.com login password, if you’ve been prompt to input gitlab username and password when installing aiot-tools.

Note

Missing Dependencies

If you encountered installation errors such as missing setuptools_scm, you can install the packages first with following commands:

pip3 install wheel setuptools_scm gpiod libusb1 packaging pyserial pyftdi pyusb pyyaml pyparsing enum34 oyaml windows-curses --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host gitlab.com

And then install AIoT Tools from gitlab.com again.

Check if it is properly installed with following commands:

aiot-flash --version

The version should be greater than 1.2.

You can check your installation with aiot-config:

aiot-config
fastboot: OK

In case your environment is not setup correctly, the tool provides you some instructions on how to correctly configure it.

USB-to-Serial Driver Installation

For Windows users, you need to install the driver for the USB-to-UART chip on the development boards.

Here is a list of development boards and corresponding USB-to-UART chip driver you need to install:

USB-to-UART Driver List

Board Name

USB-to-UART Driver

Genio 350-EVK

FTDI VCP

Genio 1200-Demo Board

FTDI VCP

Oologic Pumpkin-i500

FTDI VCP

Innocom SB52EVK

CP210x VCP Driver

For other boards, please refer to the board user guide or datasheet.