Pinout_Xtreme - up-board/up-community GitHub Wiki
Warning: Pin Linux number for I2C devices depend on kernel configuration. To check your bus numbering go to I2C Ports Warning: Please note that the HAT40 definition of UP Xtreme is different from UP Xtreme Lite. For HAT40 pinout of UP Xtreme Lite, please visit AAEON website below and download UP Xtreme Lite Manual. UP Xtreme Lite website
NOTE: For accessing USB 3.0 on pin CN26 please check out this page.
On UP Xtreme at the system start, all the pins in the hat connector are configured in function mode.
So for example the hat pin 3 associated with I2C_SDA function at the start is configured as an I2C channel
You can switch the function after booting accessing the gpio pin using linux sysfs gpio interface. For example the following commands will blink an led connected to pin 13 :
$ sudo -i
$ cd /sys/class/gpio
$ echo 432 > export
$ cd gpio432
$ echo "out" > direction
$ watch -n 0.5 'echo 1 > value; sleep 0.5 ; echo 0 > value'
after finishing to use the GPIO we need to unexport it.
$ echo "in" > direction
$ cd ..
$ echo 432 > unexport
Warning: The current pinctrl driver implementation does not allow to restore a pin in function mode (e.g. UART) once it has been already switched to GPIO mode until the operating system is rebooted.
Warning: When a pin is unexported it retains the last value/direction. So if you don't intend to use the GPIO again better set it to input to protect it from short/electrical problems.
The GPIO could also be accessed with RPi numbering so for example we can have done the same example with
$ sudo -i
$ cd /sys/class/gpio
$ echo 27 > export
$ cd gpio27
$ echo "out" > direction
$ watch -n 0.5 'echo 1 > value; sleep 0.5 ; echo 0 > value'
$ echo "in" > direction
$ cd ..
$ echo 27 > unexport
Of course, you cannot use a different numbering scheme on the same pin at the same time.
Currently interrupts are only supported using the Linux GPIO numbering scheme (e.g. use 432 GPIO number instead of Rpi GPIO number 27).
The most simple way to use interrupts from userspace is to use a userspace software library like mraa
-
Download this file and extract it on the board
-
install python3-pip
sudo apt update && sudo apt install python3-pip
- install periphery from pip
sudo -H pip3 install python-periphery
- launch the script
sudo python3 irqtest.py
To identify the TTY device node number in Linux corresponding to a particular hardware UART open a terminal and execute the following command
$ ls /sys/bus/pci/devices/0000\:00\:*/dw-apb-uart*/tty/ | grep tty
/sys/bus/pci/devices/0000:00:19.2/dw-apb-uart.4/tty/:
ttyS5
/sys/bus/pci/devices/0000:00:1e.0/dw-apb-uart.5/tty/:
ttyS6
/sys/bus/pci/devices/0000:00:1e.1/dw-apb-uart.6/tty/:
ttyS7
The ttyS7 UART (associated to dw-apb-uart.6<) is the UART on the HAT connector. The UART ttyS5 associated with dw-apb-uart.4 is a UART on CN16
So to access the UART on the HAT on ubilinux I have to open the device file '''/devttyS7'''
sudo screen /dev/ttyS7 115200
To identify the tty device node for COM1 and COM2 execute the following command:
$ ls /sys/bus/pnp/devices/00\:0*/tty/ | grep tty
/sys/bus/pci/devices/00:02/tty/:
ttyS0
/sys/bus/pci/devices/00:03/tty/:
ttyS1
Similar to UART ports above, I2C device nodes in Linux can be identified as follows:
- i2c_designware.2 -> I2C channel on hat (pin 27,28 ID_SD ID_SCL)
ls /sys/bus/pci/devices/0000\:00\:15.3/i2c_designware*/ | grep i2c
i2c-1
- i2c_designware.3 -> I2C channel on hat (pin 3,5 on HAT)
ls /sys/bus/pci/devices/0000\:00\:19.0/i2c_designware*/ | grep i2c
i2c-2
So the Linux device node for the first i2c channel is /dev/i2c-1
To detect all the peripherals on the first i2c bus do the following
$ sudo apt install i2c-tools
$ sudo i2cdetect -y -r <b>1</b>
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- 61 -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
By default, no SPI device is created for user access by default. To enable access to SPI from userspace you should add an ACPI override on the kernel
- Download this zip file and uncompress it:
- Enter in the extracted directory and type in a terminal:
$ chmod +x acpi-add acpi-upgrades install_hooks
$ sudo ./install_hooks && sudo acpi-add spidev*
- Reboot the system
now you should see the spi devices under /dev $ ls /dev/spi* /dev/spidev0.0 /dev/spidev0.1
The UP Xtreme includes 3 LEDs (yellow, green and red) on the underside of the board, which are controlled by the pin control CPLD on the board. As root, you can use the following commands to control the LEDs:
# Turn on the Green LED
echo 1 > /sys/class/leds/upboard\:green\:/brightness
# Turn off the Green LED
echo 0 > /sys/class/leds/upboard\:green\:/brightness
For other LEDs, replace "green" with "red" or "yellow" in the commands above.
The watchdog was is implemented using f71808e_wdt and is identified as /dev/watchdog
To check the device, follow the instructions in Ubuntu guides section.
Under HAT configuration the user can select Advanced Audio Mode which will disable the standard 40pin functionalities and enable additional Audio features.
Please be aware that the Header voltage Level in Advanced Audio Mode is also switched to 1.8V except for the 3.3 and 5V power pins.
Advanced Audio Mode comes with 3 preconfigured settings for the pins which are the following:
Only the Soundwire protocol pins (4 Soundwire interfaces) are enabled and configured with the following functionalities
Pin Mode | Pin Direction/Option available | HAT Pin Number |
---|---|---|
SNDW4_DATA | bidirectional | 8 |
SNDW2_CLK | output | 10 |
N/A | disabled | 16 |
SNDW1_DATA | bidirectional | 18 |
SNDW3_DATA | bidirectional | 22 |
SNDW2_DATA | bidirectional | 24 |
SNDW4_CLK | output | 26 |
SNDW3_CLK | output | 28 |
SNDW1_CLK | output | 32 |
Soundwire and DMIC pins are enabled: 2 Soundwire and 2 DMIC
Pin Mode | Pin Direction/Option available | HAT Pin Number |
---|---|---|
DMIC_DATA0 | input | 8 |
SNDW2_CLK | output | 10 |
N/A | disabled | 16 |
SNDW1_DATA | bidirectional | 18 |
DMIC_DATA1 | input | 22 |
SNDW2_DATA | bidirectional | 24 |
DMIC_CLK0 | output | 26 |
DMIC_CLK1 | output | 28 |
SNDW1_CLK | output | 32 |
Soundwire, DMIC and I2S are enabled: 1 Soundwire, 1 DMIC and 1 I2S
Pin Mode | Pin Direction/Option available | HAT Pin Number |
---|---|---|
DMIC_DATA0 | input | 8 |
I2S1_SFRM | input(defaul)/output | 10 |
I2S_MCLK | output | 16 |
I2S1_RXD | input | 18 |
SNDW3_DATA | bidirectional | 22 |
I2S1_TXD | output | 24 |
DMIC_CLK0 | output | 26 |
SNDW3_CLK | output | 28 |
I2S1_SCLK | input(defaul)/output | 32 |