> For the complete documentation index, see [llms.txt](https://amobile-solutions.gitbook.io/yocto-developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://amobile-solutions.gitbook.io/yocto-developer-guide/getting-started/quickstart-1/genio-tools-setup.md).

# Genio-tools Setup

## Linux

### System Requirements

To install Genio tools on a Linux host, ensure you have the following:

* Ubuntu 18.04 LTS or later
* Administrator privileges
* Internet connection
* Git 1.8 or later
* Python 3.8 or later
* pip 20.3 or later
* Fastboot 28.0.2 or later

### Install Packages

Install Git and other necessary packages:

```bash
$ sudo apt update
$ sudo apt-get install git python3 python3-pip android-tools-adb android-tools-fastboot
```

Verify the versions:

```bash
$ git --version
git version 2.34.1

$ python3 --version
Python 3.9.2

$ pip3 --version
pip 21.2.4 from /usr/bin/pip3 (python 3.9)
```

> **Note:** If `pip3` is older than 20.3, upgrade it by running:
>
> ```bash
> $ pip3 install --upgrade pip
> ```

Refer to [Android SDK Platform-Tools](https://developer.android.com/studio/releases/platform-tools) if using Linux distributions other than Ubuntu.

### USB Device Rules

Create a **udev** rule for USB access without root privileges:

```bash
$ echo -n 'SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="201c", MODE="0660", TAG+="uaccess"
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="0003", MODE="0660", TAG+="uaccess"
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", MODE="0660", TAG+="uaccess"
SUBSYSTEM=="gpio", MODE="0660", TAG+="uaccess"
' | sudo tee /etc/udev/rules.d/72-aiot.rules
$ sudo udevadm control --reload-rules
$ sudo udevadm trigger
```

For **adb** access, add a rule and include your user in the `plugdev` group:

```bash
$ echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="201c", MODE="0660", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/96-rity.rules
$ sudo udevadm control --reload-rules
$ sudo udevadm trigger
$ sudo usermod -a -G plugdev $USER
```

Log out and log back in to apply changes.

### UART Setup

Ensure your user is in the `dialout` group to connect to the device:

```bash
$ groups
user dialout cdrom floppy sudo audio dip video plugdev netdev bluetooth
```

If not, add your user to the group:

```bash
$ sudo usermod -a -G dialout $USER
```

Log out and log back in to apply changes.

### Install a Serial Terminal Emulator

You can use `picocom` as a serial terminal emulator. Install it with:

```bash
$ sudo apt update
$ sudo apt-get install picocom
```

### Install Genio Tools

Genio Tools includes utilities like `genio-config` and `genio-flash`. To install:

```bash
$ pip3 install -U genio-tools
```

After installation, log out and log back in to update the `PATH`. Verify the installation with:

```bash
$ genio-config
fastboot: OK
udev rules: OK
```

## Windows

### System Requirements

To install Genio tools on a Windows host, ensure you have:

* Administrator privileges
* An internet connection
* Git 1.8 or later
* Python 3.8 or later
* pip3 20.3 or later
* Fastboot 34.0.4 or later

### Git

Download and install [Git for Windows](https://gitforwindows.org/).

After installation, open **Git Bash** and execute:

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

This configures Git to use Windows default credentials and secure connections.

### Python 3

> **Note:** There are issues with Python 3.10 on Windows when installing **genio-tools**. It's recommended to use **Python 3.9**.

Steps to install Python 3 and pip:

1. Download and install [Python 3.9](https://www.python.org/downloads/release/python-3912/).
2. Ensure `pip3` is version 20.3 or later.

### Fastboot and ADB

To install the drivers:

1. Download the [Google USB Driver](https://developer.android.com/studio/run/win-usb).
2. Extract the downloaded zip file, e.g., `usb_driver_r13-windows.zip`.
3. In the extracted folder, find `android_winusb.inf`.
4. Right-click `android_winusb.inf` and select **Install**.
5. Confirm the pop-up dialog.

### Install Fastboot Tool on Windows

Fastboot requires separate installation.

* Download the [SDK Platform-Tools for Windows](https://developer.android.com/studio/releases/platform-tools) and unzip it.
* Add the unzipped directory to your `PATH` environment variable.

Verify installation with:

```bash
fastboot --version
```

The version should be greater than 34.0.4.

### UART Setup

To set up a USB-to-UART chip, install the FTDI VCP driver.

### Install a Serial Terminal Emulator

A serial terminal emulator is necessary to interface with the IoT Yocto UART serial console on Windows. Consider the following options:

* [PuTTY](https://www.putty.org/)
* [Tera Term](https://teratermproject.github.io/index-en.html)
* [MobaXterm](https://mobaxterm.mobatek.net/)

### Install Genio Tools

Genio Tools offers these utilities:

* `genio-config`: Verifies if the host setup is correct on Linux or Windows.
* `genio-flash`: Handles flash writing.
* `genio-board`: Facilitates board reset programmatically.

Note: Only `genio-flash` and `genio-config` are used in this guide. Detailed usage can be found in [Genio Tools](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/tools/genio-tools.html#genio-tools).

#### Installation Instructions

To install Genio Tools, execute this command **as an administrator**:

```
pip3 install -U --pre genio-tools
```

Verify the installation with:

```
genio-flash --version
```

Ensure the version is above <mark style="color:red;">**1.7.0a1**</mark> Additionally, check the configuration using:

```
genio-config
fastboot: OK
```
