Introduction
...
Table of Contents |
---|
- USB to serial UART interface
- 4KB EEPROM
- Two user-controllable buttons
- Two user-controllable LEDs
- Raspberry Pi-compatible 40-pin header
- ARM JTAG 20-pin debug interface header
- Unpopulated expansion signal pin headers
The following sections will detail how to use the above features in the environments in which they are supported. These instructions assume that you have properly connected the expansion board to the carrier board and have booted into a supported environment (U-Boot and/or Linux) using BSP version PD18.2.0 or newer.
Anchor | ||||
---|---|---|---|---|
|
...
Use the following as a reference for the connector interfaces on the PEB-D-RPI expansion board that will be used in this document.
USB to Serial UART Interface
...
You should see 'Testing UART1!' output on the UART1 USB serial console. If not, check the USB serial port settings on the host PC and ensure that it is configured for 115200 baud rate.
...
Enable UART1 as
...
Console
...
in Linux
To enable UART1 as an additional console in Linux, run the following commands. Note that this setting will persist between boots but will not affect the default console in U-Boot and Linux.If you would like to use UART1 as the default console in Linux, boot into U-Boot and test the configuration by running the following commands:
Code Block | ||
---|---|---|
| ||
envsystemctl set console=ttymxc0 bootenable serial-getty@ttymxc0.service systemctl start serial-getty@ttymxc0.service |
Configuring UART1 as Default Console in U-Boot and Linux
You should see the normal Linux boot output on the USB serial console. You should also be able to login, send commands, and receive expected output. If you would like to use UART1 as the default console , modify the U-Boot file 'include/configs/mx7d_phyboard_zeta.h' to match the following lines and recompile and re-deploy U-Boot onto your boot media:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
|
...
in U-Boot and Linux, boot into U-Boot and test the Linux configuration by running the following commands:
Code Block | ||
---|---|---|
| ||
env set console=ttymxc0
boot |
You should see the normal Linux boot output on the USB serial console. You should also be able to login, send commands, and receive expected output. If you would like to use UART1 as the default console, modify the U-Boot file 'include/
...
configs/mx7d_phyboard_zeta.h' to match the following lines and recompile and re-deploy U-Boot onto your boot media:
Code Block | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
#define CONFIG_CONSMXC_UART_INDEXBASE 1UART1_IPS_BASE_ADDR |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#define CONFIG_CONS_INDEX 1 |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
/* under the define for /* under the define for CONFIG_EXTRA_ENV_SETTINGS */ "console=ttymxc0\0" |
...
This header (X11) serves as Raspberry Pi HAT hardware support and as a convenient location to connect to GPIO or other interface signals that are routed to the expansion board.
Toggling GPIOs Connected to 40-pin Header
When a If you are looking for information regarding Raspberry Pi HAT isn't connected, you can use PHYTEC's RPi.GPIO Python library (included with BSP version PD18.2.0 or later) to control GPIOs connected to support, please see i.MX7: Raspberry Pi HAT Support with PEB-D-RPI Expansion Board.
GPIO and Interface Signals Map
The following tables show the GPIO bank and pin and Raspberry Pi-compatible interface signals mapping to the 40-pin header . By default, only the following pins are configured for GPIO use in the on the PEB-D-RPI device tree file: 7, 11, 12, 13, 15, 16, 18, 22, 29, 32, 35, 40. For information on how to enable more GPIOs, please reference i.MX7: Raspberry Pi HAT Support with PEB-D-RPI Expansion Board.
To set pin 7 on the 40-pin header to be a GPIO output and toggle its value, open your Python interpreter on the target and input the following code:
Code Block | ||||
---|---|---|---|---|
| ||||
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
GPIO.output(7, GPIO.HIGH)
GPIO.output(7, GPIO.LOW)
GPIO.cleanup()
exit() |
Using a digital multimeter or other suitable device, you can see the value on pin 7 of the 40-pin header go from 0 to 3.3 V and back to 0 V using the above code. You can also toggle GPIOs using the libgpiod utilities installed to the BSP file system. To toggle the same pin using libgpiod utilities, run the following commands on the target:
Code Block | ||
---|---|---|
| ||
gpioset 3 21=1
gpioset 3 21=0 |
The above commands toggle GPIO chip 4, pin 21, which is routed to pin 7 of the 40-pin header on the PEB-D-RPI expansion board.
GPIO and Interface Signals Map
The following tables show the GPIO bank and pin and Raspberry Pi-compatible interface signals mapping to the 40-pin header on the PEB-D-RPI expansion board.
...
width | 50% |
---|
...
expansion board:
Column | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Column | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The pin functions highlighted in blue are fixed and can not or should not be changed.
Jumpers
The 40-pin header also features a method to toggle the selection of specific Raspberry Pi-compatible interface signals to certain pins to support different Raspberry Pi HATs using soldered jumpers. The following table details the pins and signals that the jumpers control:
Jumper | Pin | Default Signal (position 1+2) | Alternative Signal (position 2+3) |
---|---|---|---|
J5 | 31 | PWM2_OUT | SAI2_TX_BCLK |
J6 | 33 | SPI1_MISO | SAI2_TX_SYNC |
J7 | 35 | SD2_DATA2 | SPI1_MISO |
J8 | 37 | SPI1_SCLK | SAI2_TX_DATA0 |
J9 | 40 | SD2_DATA3 | SPI1_SCLK |
J10 | 12 | SD2_DATA1 | PWM2_OUT |
J11 | 29 | GPIO5_IO14 | SPI1_MOSI |
J12 | 38 | SPI1_MOSI | GPIO5_IO14 |
Toggling GPIOs Connected to 40-pin Header
When a Raspberry Pi HAT isn't connected, you can use PHYTEC's RPi.GPIO Python library (included with BSP version PD18.2.0 or later) to control GPIOs connected to the 40-pin header. By default, only the following pins are configured for GPIO use in the PEB-D-RPI device tree file: 7, 11, 12, 13, 15, 16, 18, 22, 29, 32, 35, 40. For information on how to enable more GPIOs, please reference i.MX7: Raspberry Pi HAT Support with PEB-D-RPI Expansion Board.
To set pin 7 on the 40-pin header to be a GPIO output and toggle its value, open your Python interpreter on the target and input the following code:
Code Block | ||||
---|---|---|---|---|
| ||||
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
GPIO.output(7, GPIO.HIGH)
GPIO.output(7, GPIO.LOW)
GPIO.cleanup()
exit() |
Using a digital multimeter or other suitable device, you can see the value on pin 7 of the 40-pin header go from 0 to 3.3 V and back to 0 V using the above code. You can also toggle GPIOs using the libgpiod utilities installed to the BSP file system. To toggle the same pin using libgpiod utilities, run the following commands on the target:
Code Block | ||
---|---|---|
| ||
gpioset 3 21=1
gpioset 3 21=0 |
The above commands toggle GPIO chip 4, pin 21, which is routed to pin 7 of the 40-pin header on the PEB-D-RPI expansion board.
...
width | 50% |
---|
...
The pin functions highlighted in blue are fixed and can not or should not be changed.
Jumpers
The 40-pin header also features a method to toggle the selection of specific Raspberry Pi-compatible interface signals to certain pins to support different Raspberry Pi HATs using soldered jumpers. The following table details the pins and signals that the jumpers control:
...
ARM JTAG 20-pin Debug Interface Header
...