Skip to content

Pinout_UP6000

Teteh Camillus Chinaedu edited this page Jul 20, 2022 · 18 revisions

Pinout


Warning: Pin Linux number for I2C devices depend on kernel configuration. To check your bus numbering go to I2C Ports


Accessing the peripherals on the UP Squared 6000

GPIO

On UP Squared 6000 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 216 > export
 $ cd gpio216
 $ 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 216 > 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.

Interrupts

Currently interrupts are only supported using the Linux GPIO numbering scheme (e.g. use 216 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

Example IRQ test using Python Periphery

  1. Download this file and extract it on the board
  2. install python3-pip

sudo apt update && sudo apt install python3-pip

  1. install periphery from pip

sudo -H pip3 install python-periphery

  1. launch the script

sudo python3 irqtest.py

UART

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.7/tty/:
ttyS4
/sys/bus/pci/devices/0000:00:1e.1/dw-apb-uart.9/tty/:
ttyS6

The first UART (associated to dw-apb-uart.7) is the uart on the debug console port, and the one associated with dw-apb-uart.9 is the one on the HAT.

So to access the UART on the HAT you have to open the device file '''/dev/ttyS6'''

sudo screen /dev/ttyS6 115200

I2C ports

Similar to UART ports above, I2C device nodes in Linux can be identified as follows:

  • i2c_designware.0 -> I2C channel 0 on hat (ID_SD ID_SCL)
 ls /sys/bus/pci/devices/*/i2c_designware.0/ | grep i2c
 i2c-2
  • i2c_designware.1 -> I2C channel 0 on hat (pin 3,5 on HAT)
 ls /sys/bus/pci/devices/*/i2c_designware.1/ | grep i2c
 i2c-4

So the Linux device node for the first i2c channel is /dev/i2c-2

To detect all the peripherals on the first i2c bus do the following

 $ sudo apt install i2c-tools
 $ sudo i2cdetect -y -r 0
     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: -- -- -- -- -- -- -- --

Change I2C clock speed (WIP)

SPI Ports

SPI device nodes in Linux can be identified as follows:

ls /sys/bus/pci/devices/0000\:00\:*/pxa2xx-spi.*/spi_master/ | grep spi

/sys/bus/pci/devices/0000:00:1e.2/pxa2xx-spi.10/spi_master/:
spi1
/sys/bus/pci/devices/0000:00:1e.3/pxa2xx-spi.11/spi_master/:
spi2

Installing ACPI overrides to enable SPI in userspace

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

  1. Download this zip file and uncompress it.
  2. 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*
  1. Reboot the system

Now you should see the SPI devices under /dev

 $ ls /dev/spi*
 /dev/spidev2.0  /dev/spidev2.1

LEDs

The UP Squared 6000 includes 4 LEDs (0, 1, 2, and 3) on the underside of the board (underneath Ethernet dual port), which are controlled by the pin control FPGA on the board. As root, you can use the following commands to control the LEDs:

 # Turn on the LED 0
 echo 1 > /sys/class/leds/led\:0\:/brightness
 # Turn off the LED 0
 echo 0 > /sys/class/leds/led\:0\:/brightness

For other LEDs, replace "0" with "1", "2" or "3" in the commands above.

Enable USB Device Mode on Type-C Port

To enable the device mode you will need to update the default BIOS settings by doing the following:

  1. Boot into BIOS >> Advanced >> USB Configuration
  2. xDCI support to [Enabled]
  3. USB Device/HOST Mode Override to [Select-Per-Pin]
  4. USB HS0 Operation Mode to [USB Device Mode]

Enable Secure Boot

  1. Boot into BIOS and login as admin using password: upassw0rd
  2. Enter BIOS setup menu
  3. Move to 4th sheet Security
  4. Select Secure Boot and Press ENTER
  5. Select Key Management and press ENTER
  6. Check your settings / required conditions in key management. For example change Factory Key Provision from [Disabled] to [Enabled]
  7. Go back to Secure Boot page, select [Disabled], ENTER, [Enabled], ENTER

SF100 Programming for UP Squared 6000

  1. Download and installed DediProg SF software here https://www.dediprog.com/download/save/1216.msi, SF7.3.57.27.msi
  2. Connect the SF100 programmer to your PC through USB port
  3. Check whether the DediProg SF Programmer driver is displayed under Universal Serial Bus controllers in Device Manager.

  • If “DediProg SF Programmer driver” does not show up, please check your SF100 connection or driver installation.
  1. If the driver is ready and no yellow exclamation mark on DediProg in device manager. Please use one of our BIOS cable (1701140271) to connect from the SF100 (ISP connect) to EHL board

  1. Double click the “DediProg Engineering” icon on your desktop

  1. If the connecting EHL board is correct, you will see the message below on the DediProg software, so please choose the memory type to W25Q256JW. If you don't see the Memory Type Ambiguity message, please check connection for BIOS cable in both side.

  • The message below will display after setting the memory type.

  1. To load BIOS bin file, click on the "File" icon in the top of the window, and click on “find” then select and upload the bin file.

  • The message below will display after loading the BIOS bin file.

  1. To flash BIOS, just click on the "Batch" icon in the top of the window and wait for its processing to be finished as shown in the message below.

Clone this wiki locally