.. include:: /keyword.rst =========== Genio Tools =========== .. contents:: Sections :local: :depth: 2 Overview ******** Genio tools is a set of tools to configure or interact with MediaTek Genio boards. The Genio tools are written in `Python`_. You need to have Python 3 installed on your system. The Genio 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. .. _Python: https://www.python.org/ Genio tools is composed of 3 tools: * ``genio-config``: a tool to setup your host system in order to be able to communicate with MediaTek Genio boards * ``genio-flash``: a tool to flash a board with a RITY image * ``genio-board``: a tool to control the board (reset / power / download signals) Genio Tools v1.3.3 still supports legacy commands such as ``aiot-flash``, but we plan to deprecate these ``aiot-`` commands in the future. We strongly encourage all users to migrate to the new ``genio-flash`` command. Setup Tool Environment (Linux) ============================== Please refer to :ref:`sw/yocto/get-started/env-setup/flash-env-linux:Setup Tool Environment (Linux)`. Setup Tool Environment (Windows) ================================ Please refer to :ref:`sw/yocto/get-started/env-setup/flash-env-windows:Setup Tool Environment (Windows)`. Genio tools Usage ***************** This section will describe the usage of every Genio tool. genio-config ============ .. note:: The genio-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: .. prompt:: bash $ auto $ genio-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. .. note:: Reboot the Linux system for the **udev rules** to take effect. genio-flash =========== .. note:: The genio-flash tool is supported on both of Linux and Windows. This tool allows you to flash your board. `genio-flash` supports flashing Yocto images (RITY). You can flash an image by running the following command: .. prompt:: bash $ genio-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: .. prompt:: bash $ genio-flash --path /path/to/image It is possible to flash individual partitions by using: .. prompt:: bash $ genio-flash or .. prompt:: bash $ genio-flash :/path/to/file1 :/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. .. prompt:: bash $ genio-flash --image rity-demo-image or .. prompt:: bash $ genio-flash -i rity-demo-image .. _how-to-load-a-dtbo: Load a DTBO ----------- When flashing you can also choose the Device-Tree Blob Overlays you wish to be automatically loaded at boot: .. prompt:: bash $ genio-flash --load-dtbo --load-dtbo List available DTBO ''''''''''''''''''' To know which DTBO is available with your image you can run the following command: .. prompt:: bash $ genio-flash --list-dtbo Interactively choose DTBO ''''''''''''''''''''''''' Instead of specifying the DTBO to load you can also run `genio-flash` in interactive mode: .. prompt:: bash $ genio-flash --interactive or .. prompt:: bash $ genio-flash -I Bootstrap configuration ----------------------- In case your bootstrap has a configuration different from the default values, you can use the following parameter: .. prompt:: bash $ genio-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 ``genio-board``, ``genio-flash`` will also be able to control the reset and download GPIOs. You can flash and control your board using the following command: .. prompt:: bash $ genio-flash --gpio-power \ --gpio-reset \ --gpio-download genio-board =========== .. warning:: The genio-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. .. _FTDI: https://www.ftdichip.com/ 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: .. prompt:: bash $ genio-board program-ftdi --ftdi-product-name \ --gpio-power \ --gpio-reset \ --gpio-download Please replace ``, ``, ``, and `` with the values corresponding to your board. You can check your :ref:`hw/boards: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: .. prompt:: bash $ genio-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: .. prompt:: bash $ genio-board reset --gpio-power \ --gpio-reset \ --gpio-download Reset in download mode ---------------------- In order to reset the board and boot it in download mode you can run the following command: .. prompt:: bash $ genio-board download --gpio-power \ --gpio-reset \ --gpio-download Power the board --------------- To simulate pressing the power button (for 1 second), you can run the following command: .. prompt:: bash $ genio-board power --gpio-power \ --gpio-reset \ --gpio-download 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: .. csv-table:: :header: "Parameter", "Parameter alias", "Default value" :widths: 20, 10, 10 "``--gpio-power``", "-p", "0" "``--gpio-reset``", "-r", "1" "``--gpio-download``", "-d", "2"