Initial Setup

Your Coral dev board comes blank, and will need to be fastboot'd in order to load the firmware on.

The Coral Getting Started guide will show you the process. It's not pleasant unless you happen to have all the right cables and software already, it should take you under an hour.

You'll need USB C cables and adapters!

USB 3-in-1 Sync and Charge Cable - Micro B / Type-C / Lightning

PRODUCT ID: 3679
As USB technology evolves you'll want the One Cable To Sync/Charge All Things (or, at least, portable devices with Micro-B, Type C, or Lightning ports) and this...
$8.50
IN STOCK

USB A to USB C Adapter

PRODUCT ID: 4175
As technology changes and adapts, so does Adafruit, and speaking of adapting, this adapter has a USB A plug and a USB C socket so your older...
$2.95
IN STOCK

When connecting HATs or Bonnets, the tall heatsink of the Coral can interfere with attaching it - be sure to pick up some 2x20 GPIO Lifters or Stacking headers!

2x20 Socket Riser Header for Raspberry Pi HATs and Bonnets

PRODUCT ID: 4079
Give yourself a lift with this 2x20 female socket header that has slightly longer than usual pins. You can plug this into your Raspberry Pi GPIO port and then plug a HAT or...
$1.95
IN STOCK

Stacking Header for Pi A+/B+/Pi 2/Pi 3 - 2x20 Extra Tall Header

PRODUCT ID: 1979
Stack multiple plates, breakouts etc onto your Raspberry Pi Model B+ with this custom-made extra-tall and extra-long 2x20 female header. The female header part has extra spaces to...
$2.95
IN STOCK

Once you've got the Coral fastboot'd you will be able to set up and test WiFi:

Verify you have a WiFi connection with sudo ping 8.8.8.8

The good news about the mendel distribution is it already has Python3 installed by default

Install libgpiod

libgpiod is what we use for gpio toggling, it doesn't come in installations yet but its easy to add by running our script. You'll probably need to run this as root, so sudo bash before you...

  • cd ~
  • wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/libgpiod.sh
  • chmod +x libgpiod.sh
  • ./libgpiod.sh

A few minutes and a lot of text later...

After installation you should be able to import gpiod from within Python3

Update Your Board and Python

Run the standard updates:

sudo apt-get update

sudo apt-get upgrade

and

sudo pip3 install --upgrade setuptools

Check UART, I2C and SPI

A vast number of our CircuitPython drivers use UART, I2C and SPI for interfacing. Luckily, they're already enabled. Check by running ls /dev/i2c* /dev/spi*

Install the support software with

  • sudo apt-get install -y python3-smbus python3-dev i2c-tools
  • sudo adduser mendel i2c

You can get info about the I2C interfaces with sudo i2cdetect -l

You can test to see what I2C addresses are connected by running sudo i2cdetect -y 0 (internal I2C) or sudo i2cdetect -y 1 (pins #3 and #5) and sudo i2cdetect -y 1 (pins #27 and #28)

You'll note there looks like an RTC on address 0x68 (a common RTC address). Some addresses are pre-allocated by the kernel (unavailable UU)

For the GPIO interface chips, you can check with sudo gpiodetect and sudo gpioinfoto see the 5 32-pin busses

Install Python libraries

Now you're ready to install all the python support

Run the following command to install adafruit_blinka

pip3 install adafruit-blinka

The computer will install a few different libraries such as adafruit-pureio (our ioctl-only i2c library), spidev (for SPI interfacing), Adafruit-GPIO (for detecting your board) and of course adafruit-blinka

That's pretty much it! You're now ready to test.

Create a new file called blinkatest.py with nano or your favorite text editor and put the following in:

Download: file
import board
import digitalio
import busio

print("Hello blinka!")

# Try to great a Digital input
pin = digitalio.DigitalInOut(board.GPIO_P13)
print("Digital IO ok!")

# Try to create an I2C device
i2c = busio.I2C(board.SCL, board.SDA)
print("I2C ok!")

# Try to create an SPI device
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
print("SPI ok!")

print("done!")

Save it and run at the command line with

sudo python3 blinkatest.py

You should see the following, indicating digital i/o, I2C and SPI all worked

This guide was first published on May 12, 2019. It was last updated on May 12, 2019. This page (Initial Setup) was last updated on Dec 05, 2019.