Genio 1200-EVK

I2C

There are 4 I2C adapters on Genio 1200-EVK:

  • 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

There are 2 master SPI devices on Genio 1200-EVK:

  • 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

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.

ifconfig
can0: flags=193<UP,RUNNING,NOARP>  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.

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.

# 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

There are 5 USB ports on Genio 1200-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:

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 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 Genio 1200-EVK.

USB Mass Storage

The device mode of Genio 1200-EVK 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).

PWM

There are 4 general PWM devices on Genio 1200-EVK, but only one PWM pin are exported out:

Note

PWM_3 pin is mux by a jumper J43. Kepp J43 opened 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.

echo 3 > /sys/class/pwm/pwmchip0/export

Second, you need to set the period and the duty cycle.

echo 2000000 > /sys/class/pwm/pwmchip0/pwm3/period
echo 1000000 > /sys/class/pwm/pwmchip0/pwm3/duty_cycle

Finally, you can enable the PWM device.

echo 1 > /sys/class/pwm/pwmchip0/pwm3/enable

You can also use the kernel debugfs to check the value of PMW devices.

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

There are 2 UART devices on Genio 1200-EVK. 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

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.

Raspberry Pi HAT

There is a 40-pin Raspberry Pi HAT on Genio 1200-EVK. 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.

pin definition of Raspberry Pi HAT

Pin #

Main

Pin #

Main

1

VDD_3V3

2

VDD_5V

3

I2C0_SDA

4

VDD_5V

5

I2C0_SCL

6

GND

7

GPIO4

8

UART1_TXD

9

GND

10

UART1_RXD

11

GPIO3

12

GPIO5

13

GPIO135

14

GND

15

GPIO2

16

GPIO1

17

VDD_3V3

18

GPIO0

19

SPI2_MOSI

20

GND

21

SPI2_MISO

22

GPIO57

23

SPI2_SCLK

24

SPI2_CS

25

GND

26

GPIO134

27

I2C2_SDA

28

I2C2_SCL

29

GPIO66

30

GND

31

GPIO68

32

GPIO65

33

PWM3

34

GND

35

SPI1_MISO

36

SPI1_CS

37

GPIO67

38

SPI1_MOSI

39

GND

40

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 words are ground pins.

  4. Red words are power pins.

  5. Green words are special function pins.

  6. Blue words are GPIOs.

  7. 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 Genio 1200-EVK 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.

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)