AIoT Tools
Sections
Overview
AIoT tools is a set of tools to configure or interact with MediaTek Genio boards. The AIoT tools are written in Python. You need to have Python 3 installed on your system. The AIoT tools have been tested with Python 3.6 and 3.9, they may work with older versions of Python, but are untested against these older Python releases.
Note
There are known issues for Python 3.10 on Windows platform. If you use Windows, we recommend you to install Python 3.9 instead.
AIoT tools is composed of 3 tools:
aiot-config
: a tool to setup your host system in order to be able to communicate with MediaTek Genio boards
aiot-flash
: a tool to flash a board with a RITY image
aiot-board
: a tool to control the board (reset / power / download signals)
Setup Tool Environment (Linux)
Please refer to Setup Tool Environment (Linux).
Setup Tool Environment (Windows)
Please refer to Setup Tool Environment (Windows).
AIoT Tools Usage
This section will describe the usage of every AIoT tool.
aiot-config
Note
The aiot-config tool is supported on both of Linux and Windows. The udev rules information is only supported on Linux environment.
This tool is used to check the configuration of the host environment.
You run the following command to check that your environment is correctly configured:
aiot-config
fastboot: OK
udev rules: OK
In case your environment is not setup correctly, the tool will give you some instructions on how to correctly configure it.
aiot-flash
Note
The aiot-flash tool is supported on both of Linux and Windows.
This tool allows you to flash your board. aiot-flash supports flashing Yocto images (RITY).
You can flash an image by running the following command:
aiot-flash
The tool will try to find an image to flash in your current working directory. If you want to flash an image in a different path your can use the –path parameter:
aiot-flash --path /path/to/image
It is possible to flash invidual partitions by using:
aiot-flash <partition1> <partition2> <partitionX>
or
aiot-flash <partition1>:/path/to/file1 <partition2>:/path/to/file2
Select an image
A few options are specific to flashing Yocto images. If your build folder contains more than one image you can specify which image to flash by using the –image parameter.
aiot-flash --image rity-demo-image
or
aiot-flash -i rity-demo-image
Load a DTBO
When flashing you can also choose the Device-Tree Blob Overlays you wish to be automatically loaded at boot:
aiot-flash --load-dtbo <dtbo_name> --load-dtbo <another_dtbo_name>
List available DTBO
To know which DTBO is available with your image you can run the following command:
aiot-flash --list-dtbo
Interactively choose DTBO
Instead of specifying the DTBO to load you can also run aiot-flash in interactive mode:
aiot-flash --interactive
or
aiot-flash -I
Bootstrap configuration
In case your bootstrap has a configuration different from the default values, you can use the following parameter:
aiot-flash --bootstrap lk.bin --bootstrap-addr 0x201000 \
--bootstrap-mode aarch64
Board control
Warning
Board control is currently only supported on Linux.
If your board supports aiot-board
, aiot-flash
will also be able to
control the reset and download GPIOs. You can flash and control your
board using the following command:
aiot-flash --gpio-power <power_gpio> \
--gpio-reset <reset_gpio> \
--gpio-download <download_gpio>
aiot-board
Warning
The aiot-board tool is currently only supported on Linux.
This tool is used to control MediaTek boards. It uses the FTDI chip that provides the serial console to also control the reset / power / download GPIO lines.
Note
Not all the boards can be controlled with this tool. Please check your board documentation to know whether this tools can control your board.
Configuration of the FTDI chip
In order to be able to control the GPIO lines, the FTDI chip must be properly configured. Run the following command to configure the FTDI chip:
aiot-board program-ftdi --ftdi-product-name <board_name> \
--gpio-power <power_gpio> \
--gpio-reset <reset_gpio> \
--gpio-download <download_gpio>
Please replace <board_name>, <power_gpio>, <reset_gpio>, and <download_gpio> with the values corresponding to your board. You can check your Development Boards to know the values to use.
Note
Only one board should be connected to the host when trying to program a FTDI chip. If more than one FTDI chip is detected, the tool will quit.
For example for the Genio 350-EVK board, the command would be:
aiot-board program-ftdi --ftdi-product-name i350-evk \
--gpio-power 0 \
--gpio-reset 1 \
--gpio-download 2
Warning
Be careful, configuring bad values into your FTDI chip could potentially brick your board.
Configuring the FTDI chip should only be done once per board.
Reset the board
In order to reset the board you can run the following command:
aiot-board reset --gpio-power <power_gpio> \
--gpio-reset <reset_gpio> \
--gpio-download <download_gpio>
Reset in download mode
In order to reset the board and boot it in download mode you can run the following command:
aiot-board download --gpio-power <power_gpio> \
--gpio-reset <reset_gpio> \
--gpio-download <download_gpio>
Power the board
To simulate pressing the power button (for 1 second), you can run the following command:
aiot-board power --gpio-power <power_gpio> \
--gpio-reset <reset_gpio> \
--gpio-download <download_gpio>
Default values for the GPIOs
It is not necessary to set the –gpio-power, –gpio-reset, and –gpio-download parameters if they match the default values. Please check the default values used by the tool below:
Parameter |
Parameter alias |
Default value |
---|---|---|
|
-p |
0 |
|
-r |
1 |
|
-d |
2 |