10.1. RPi 40-pin header programming

TI J722S EVM development board contain a 40 pin GPIO header, similar to the 40 pin header in the Raspberry Pi. These GPIOs can be controlled for digital input and output using the Python/CPP libraries provided in the TI GPIO Library packages. The libraries have the same API as the RPi.GPIO library for Raspberry Pi in order to provide an easy way to move applications running on the Raspberry Pi to the TI board.

TI GPIO Libraries are packaged under /opt directory. Run the below script to build and install the gpio libraries

/opt/edgeai-gst-apps# ./scripts/install_ti_gpio_libs.sh

By default, H/W PWMs are not enabled in 40-pin header on J722S-EVM board. This can be enabled by specifying the dtb overlay file k3-j722s-evm-pwm.dtbo in /run/media/BOOT-mmcblk1p1/uEnv.txt as given below.

name_overlays=ti/k3-j722s-evm-pwm.dtbo

Reboot the board after editing and saving the file.

10.1.1. 40-pin header default configuration

The default pin configuration on the SK board is as follows. Any deviation from this needs modifications to the Linux DTBO. The table below lists pin numbers in all three supported modes, namely BOARD, BCM, and SOC.

BOARD: Physical Pin Number BCM : Broadcom SOC Numbering SOC : TI SOC Naming

../../../_images/j722s-evm-exp_hdr.png

BOARD

BCM

SOC

Function

3

2

I2C2 SDA

I2C

5

3

I2C2 SCL

I2C

7

4

GPIO0_38

GPIO

8

14

GPIO1_14

GPIO

10

15

GPIO1_13

GPIO

11

17

GPIO1_08

GPIO

12

18

GPIO1_11

GPIO

13

27

GPIO0_33

GPIO

15

22

GPIO1_07

GPIO

16

23

MCU_GPIO0_07

GPIO

18

24

MCU_GPIO0_08

GPIO

19

10

MCU_GPIO0_03

GPIO

21

9

MCU_GPIO0_04

GPIO

22

25

GPIO0_42

GPIO

23

11

MCU_GPIO0_02

GPIO

24

8

MCU_GPIO0_00

GPIO

26

7

MCU_GPIO0_01

GPIO

29

5

GPIO1_15

HW PWM

31

6

GPIO1_17

HW PWM

32

12

GPIO1_16

GPIO

33

13

GPIO1_18

HW PWM

35

19

GPIO1_12

GPIO

36

16

GPIO0_41

GPIO

37

26

GPIO0_36

GPIO

38

20

GPIO1_10

GPIO

40

21

GPIO1_09

GPIO

NOTE: Please refer to J722S-EVM User’s Guide for details on the expansion header pin names and functionality. Also refer to section 2.1.2 Power Budget Considerations for power/voltage limits on the expansion header pins.

10.1.2. Repositories

The Python and CPP projects are hosted on Texas Instruments GitHub. The links to the projects are given below. The details on installation and testing can be found in the respective project documentation.

Python Library: https://github.com/TexasInstruments/ti-gpio-py.git

CPP Library: https://github.com/TexasInstruments/ti-gpio-cpp.git

The above repositories are cloned and installed during the initialization process upon initial boot. The gpiozero library is also installed as a part fo the initialization.

10.1.3. Additional References

Please refer to the lik below for information on the 40-pin header numbering and naming conventions: