.. raw:: html
.. role:: red
.. role:: green
.. role:: blue
.. role:: pink
.. role:: black
.. include:: /keyword.rst
============
|G1200-EVK|
============
.. contents:: Sections
:local:
:depth: 1
.. _i2c-g1200-evk:
I2C
---
There are 4 I2C adapters on |G1200-EVK-REF-BOARD|:
- I2C-0 shared with CSI0 and CSI1
- I2C-1 shared with CSI2-1, MT6691, USB5734 and gt9271
- I2C-2 shared with CSI2-2 and T5205FN
- I2C-6 shared with PMIC and DRAM buck
I2C-0 and I2C-2 are exported to `Raspberry Pi HAT`_. You can use it to connect to other I2C devices.
.. _spi-g1200-evk:
SPI
---
There are 2 master SPI devices on |G1200-EVK-REF-BOARD|:
.. _feature-g1200-canbus-mcp2518:
- SPI-1 shared with CAN bus MCP2518
- SPI-2 on J38 Pin #2(CLK) #3(CSB) #4(MOSI) #5(MISO)
These 2 SPI are also exported to `Raspberry Pi HAT`_. You can use it to connect to other SPI devices.
.. _can-g1200-evk:
CAN
---
We utilize Microchip's MCP2518FD to provide the CAN interface. The MCP2518FD is a CAN FD Controller that is compatible with an SPI interface.
It supports both CAN frames in the Classical format (CAN 2.0B) and the CAN Flexible Data Rate (CAN FD) format as specified in ISO11898-1:2015.
For more detailed information about the MCP2518FD, please refer to `MCP2518FD `_.
The MCP2518FD uses the ``SPI-1`` interface, and you can verify whether the CAN node has been successfully loaded using the ``ifconfig`` command.
.. prompt:: bash $ auto
$ ifconfig
can0: flags=193 mtu 72
Additionally, the MCP2518FD is set to the CAN FD mode with ``bitrate`` 500000 and ``dbitrate`` 4000000 by default.
You can modify the default settings by modifying the `udev` rules. The file path is
``meta-rity/meta/recipes-core/base-files/files/genio-1200-evk/91-caninterface.rules``.
.. prompt:: bash $ auto
KERNELS=="spi0.0", SUBSYSTEMS=="spi", DRIVERS=="mcp251xfd", RUN+="/sbin/ip link set can0 up type can bitrate 500000 dbitrate 4000000 fd on"
The `rity-demo-image` itself includes the ``can-utils`` tool, which can be used to test basic CAN communication.
You can use this tool to verify if the two CAN devices can communicate properly.
Choose one device as the receiver and the other as the transmitter.
.. prompt:: bash $ auto
# Receiver console
$ candump can0
# Transmitter console
$ cansend can0 123#11223344
# Receiver console should now show:
can0 123 [4] 11 22 33 44
.. note::
Please take note that the level of CAN bus integration currently stands at the proof-of-concept (POC) stage.
Our testing has been limited to basic CAN communication using the provided command, and we cannot ensure complete functionality in every possible scenario.
.. _usb-g1200-evk:
USB
---
There are 5 USB ports on |G1200-EVK|:
- USB Type-C x 1, connected to ``USB0`` port of Genio 1200 SoC.
- USB Type-A x 2, connected to ``USB1`` port of Genio 1200 SoC.
- USB micro-B x 1, connected to ``USB2`` port of Genio 1200 SoC.
- USB to UART Bridge IC (Debug port) x 1, connected to ``UART0`` port of Genio 1200.
The USB to UART Bridge IC is used for the ``UART0`` debug console.
The USB Type-A ports are connected to an on board USB hub that only supports USB 3.1 gen 1.
The USB Type-C port supports USB 3.1 gen 1.
The USB Type-C, USB micro-B, and both USB Type-A ports can be used as USB host ports for USB flash drives, UVC, UAC, and so on.
To mount a USB flash drive, you can use:
.. prompt:: bash # auto
# mkdir /media/usb
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 29.5G 0 disk
|-sda1 8:1 1 200M 0 part
`-sda2 8:2 1 29.3G 0 part
# mount /dev/sda2 /media/usb/
The USB Type-C and USB micro-B ports also support USB OTG.
The USB Type-C port is also used to flash images to the eMMC or UFS storage.
For flashing the image, please refer to :doc:`/sw/yocto/get-started/flash`.
.. note::
The ``USB3`` port of Genio 1200 SoC is provided as part of the M.2 slot for the MT7921 wireless module. It is not exposed as a USB port on
the |G1200-EVK|.
.. _MSG-g1200-evk:
USB Mass Storage
-------------------
The device mode of |G1200-EVK-REF-BOARD| USB micro-B port (``USB2``) is set to
support USB Mass Storage function, this function is set in the following gadget script:
- ``src/meta-rity/meta/recipes-core/base-files/files/genio-1200-evk/usbmass.sh``
- ``src/meta-rity/meta/recipes-core/base-files/files/genio-1200-evk/usbmass.service``
If you want to know more about how to use the gadget from user space, please refer to the
`Mass Storage Gadget (MSG)`_.
.. _Mass Storage Gadget (MSG): https://www.kernel.org/doc/html/next/usb/mass-storage.html
.. _pwm-g1200-evk:
PWM
---
There are 4 general PWM devices on |G1200-EVK-REF-BOARD|, but only one PWM pin are exported out:
- PWM_3 on `Raspberry Pi HAT`_ Pin #33
.. note::
PWM_3 pin is mux by a jumper J43. Keep J43 open to select PWM function. Please refer to `Hardware Pin Mux`_.
You can use ``sysfs`` to operate PWM devices.
First, you need to export the PWM node.
.. prompt:: bash # auto
# echo 3 > /sys/class/pwm/pwmchip0/export
Second, you need to set the period and the duty cycle.
.. prompt:: bash # auto
# echo 2000000 > /sys/class/pwm/pwmchip0/pwm3/period
# echo 1000000 > /sys/class/pwm/pwmchip0/pwm3/duty_cycle
Finally, you can enable the PWM device.
.. prompt:: bash # auto
# echo 1 > /sys/class/pwm/pwmchip0/pwm3/enable
You can also use the kernel `debugfs` to check the value of PMW devices.
.. prompt:: bash # auto
# cat /sys/kernel/debug/pwm
platform/1100e000.disp-pwm, 1 PWM device
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal
platform/10048000.pwm, 4 PWM devices
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal
pwm-1 ((null) ): period: 0 ns duty: 0 ns polarity: normal
pwm-2 ((null) ): period: 0 ns duty: 0 ns polarity: normal
pwm-3 (sysfs ): requested enabled period: 2000000 ns duty: 1000000 ns polarity: normal
.. _uart-g1200-evk:
UART
----
There are 2 UART devices on |G1200-EVK-REF-BOARD|. The supported baud is from 300 bps to 3000000 bps:
- UART0: Connect to USB bridge(`FT232RL`), MicroUSB UART0 connector
- UART1: Shared with USB bridge(`FT232RL`) and `Raspberry Pi HAT`_
+ J43 short: USB bridge(`FT232RL`), MicroUSB UART1 connector
+ J43 open: `Raspberry Pi HAT`_ Pin #8(Tx) #10(Rx)
.. note::
UART0 is used for AP debug console
.. _gpio-g1200-evk:
GPIO
----
The SOC has 144 GPIO pins in total.
Due to the limitation of the number of physical pins, only few GPIO pins are exported.
The actual positions of available GPIO pins are shown in `Raspberry Pi HAT`_.
.. _pin-header-g1200-evk:
Raspberry Pi HAT
----------------------
There is a 40-pin Raspberry Pi HAT on |G1200-EVK-REF-BOARD|. It contains several peripheral interfaces.
By default, it follows the official Raspberry Pi setting.
For more details about RPi HAT, please refer to `GPIO and the 40-pin Header `_.
You can use the header to connect your external devices.
.. table:: pin definition of Raspberry Pi HAT
===== ================== ===== ===================
Pin # Main Pin # Main
===== ================== ===== ===================
1 :red:`VDD_3V3` 2 :red:`VDD_5V`
3 :green:`I2C0_SDA` 4 :red:`VDD_5V`
5 :green:`I2C0_SCL` 6 :black:`GND`
7 :pink:`GPIO4` 8 :green:`UART1_TXD`
9 :black:`GND` 10 :green:`UART1_RXD`
11 :pink:`GPIO3` 12 :pink:`GPIO5`
13 :pink:`GPIO135` 14 :black:`GND`
15 :pink:`GPIO2` 16 :pink:`GPIO1`
17 :red:`VDD_3V3` 18 :pink:`GPIO0`
19 :green:`SPI2_MOSI` 20 :black:`GND`
21 :green:`SPI2_MISO` 22 :pink:`GPIO57`
23 :green:`SPI2_SCLK` 24 :green:`SPI2_CS`
25 :black:`GND` 26 :blue:`GPIO134`
27 :green:`I2C2_SDA` 28 :green:`I2C2_SCL`
29 :pink:`GPIO66` 30 :black:`GND`
31 :pink:`GPIO68` 32 :pink:`GPIO65`
33 :pink:`PWM3` 34 :black:`GND`
35 :green:`SPI1_MISO` 36 :green:`SPI1_CS`
37 :pink:`GPIO67` 38 :green:`SPI1_MOSI`
39 :black:`GND` 40 :green:`SPI1_SCLK`
===== ================== ===== ===================
.. note::
1. VDD_5V power can provide 5V/2A maximum but share with USB Host VBUS 5V output.
2. VGPIOEXT_3V3 power can deliver 3.3V/300mA
3. :black:`Black` words are ground pins.
4. :red:`Red` words are power pins.
5. :green:`Green` words are special function pins.
6. :blue:`Blue` words are GPIOs.
7. :pink:`Pink` words are pins, which multiplex with other functions. Please refer to `Hardware Pin Mux`_.
.. warning::
The default input/output voltage of the GPIO pins on the header is **3.3V**.
Before using them, please make sure the voltage is suitable for your external device.
Otherwise, the unmatched voltage may destroy both |G1200-EVK-REF-BOARD| and external devices.
Hardware Pin Mux
----------------
There are some pins shared with `Raspberry Pi HAT`_ and other functions.
You should pay attention to them when you use these functions.
.. table:: Pin Mux Controlled by Jumper J43
========== =========== ================== =======================================
GPIO ID # Pin Name Short Open
========== =========== ================== =======================================
GPIO_00 GPIO_00 MSDC2_CMD_CONN `Raspberry Pi HAT`_ Pin #18(GPIO0)
GPIO_01 GPIO_01 MSDC2_CLK_CONN `Raspberry Pi HAT`_ Pin #16(GPIO1)
GPIO_02 GPIO_02 MSDC2_DAT3_CONN `Raspberry Pi HAT`_ Pin #15(GPIO2)
GPIO_03 GPIO_03 MSDC2_DAT0_CONN `Raspberry Pi HAT`_ Pin #11(GPIO3)
GPIO_04 GPIO_04 MSDC2_DAT2_CONN `Raspberry Pi HAT`_ Pin #7(GPIO4)
GPIO_05 GPIO_05 MSDC2_DAT1_CONN `Raspberry Pi HAT`_ Pin #12(GPIO5)
GPIO_57 I2SO2_MCK DSI1_LCM_RST_CONN `Raspberry Pi HAT`_ Pin #22(GPIO57)
GPIO_65 PCM_DO MT7663_I2S_DO `Raspberry Pi HAT`_ Pin #32(GPIO65)
GPIO_66 PCM_CLK MT7663_I2S_BCK `Raspberry Pi HAT`_ Pin #29(GPIO66)
GPIO_67 PCM_DI MT7663_I2S_DI `Raspberry Pi HAT`_ Pin #37(GPIO67)
GPIO_68 PCM_SYNC MT7663_I2S_LRCK `Raspberry Pi HAT`_ Pin #31(GPIO68)
GPIO_107 KPCOL1 DSI1_DSI_TE_CONN `Raspberry Pi HAT`_ Pin #33(PWM3)
GPIO_102 UART1_TXD FT232RL RXD `Raspberry Pi HAT`_ Pin #8(UART1_TXD)
GPIO_103 UART1_RXD FT232RL TXD `Raspberry Pi HAT`_ Pin #10(UART1_RXD)
========== =========== ================== =======================================