Building an Intel-Based Platform for Ardupilot

Using the PXFMini with an Intel UP

Kevin Angstadt

angstadt@umich.edu

University of Michigan

Introduction

This tutorial provides step-by-step instructions for developing a Intel-based autonomous vehicle platform running an Ardupilot software stack. Steps include: assembling computation and sensor hardware, building an operating system distribution, and building software on the system. The base system consists of an Intel UP board, which is augmented by the PXFMini autopilot HAT developed by Erle Robotics.

Note: this tutorial is a work in progress. This document will be updated as the build process becomes more refined and bugs are resolved.

Known Issues

Parts List

The following parts are needed to construct the autopilot:

Intel Up Shop

Erle Robotics

MRobotics

Digikey

Miscellaneous

Construction

TODO: Schematic and instruction for RC input processor

  1. Stack 40-pin headers and connect to GPIO pins of the UP Board
  2. Remove the two screws attaching the lower heatsink to the UP Board near the GPIO pins
  3. Attach PXFMini HAT to 40-pin header
  4. Use spacers and screws to firmly attach the PXFMini to the UP Board
  5. Connect the GPS/Compass unit to the PXFMini using a JST GH cable
  6. Connect RC input processor to the PXFMini using a JST GH breakout cable
  7. Connect the telemetry radio to the UP Board with a micro-USB cable

TODO: Add diagrams and design for 3D-printed case

Build OS Image

The next step is to build a custom operating system image using the Yocto Project build system, Poky.
  1. Download poky and cd into the directory:
    git clone -b krogoth-15.0.2 git://git.yoctoproject.org/poky.git
    cd poky
  2. Download the OpenEmbedded meta layer:
    git clone -b krogoth https://github.com/openembedded/meta-openembedded
  3. Download the Intel BSP layer:
    git clone -b krogoth git://git.yoctoproject.org/meta-intel.git
  4. Download the Intel UP board BSP layer:
    git clone -b krogoth https://github.com/emutex/meta-up-board
  5. Next, we need to create a configuration file for the RT kernel. Save the following as meta-up-board/recipes-kernel/linux/linux-yocto-rt_4.4.bbappend:
    FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
    
    PR := "${PR}.7"
    
    COMPATIBLE_MACHINE_up-board = "up-board"
    
    
    KERNEL_FEATURES_append_up-board += " cfg/smp.scc"
    
    # aufs is needed for the live-boot feature
    KERNEL_FEATURES_append_up-board += "${@bb.utils.contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-disable.scc', '', d)}"
    
    SRC_URI += "file://up-board-preempt-rt.scc \
                file://up-board-user-config.scc \
                file://up-board-user-patches.scc \
                file://up-board-user-features.scc \
               "
  6. Create the build environment (this will change into the build directory):
    TEMPLATECONF=meta-up-board/conf source oe-init-build-env
  7. Remove "default up-board.spidev1 to false" patch:
    yocto-kernel patch rm up-board
    Enter the number of the patch related to spidev1 and press return
  8. Edit conf/bblayers.conf to include the following BBLAYERS (be sure to provide the appropriate paths):
    BBLAYERS ?= " \
      /path/to/poky/meta \
      /path/to/poky/meta-poky \
      /path/to/poky/meta-yocto-bsp \
      /path/to/poky/meta-openembedded/meta-oe \
      /path/to/poky/meta-openembedded/meta-python \
      /path/to/poky/meta-intel \
      /path/to/poky/meta-up-board \
      "
  9. Edit conf/local.conf and add the following lines to the end of the file:
    PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"
    IMAGE_INSTALL_append = " git python-pip linux-firmware"
  10. Build the OS image:
    bitbake core-image-sato-sdk
  11. Write the generated iso (tmp/deploy/images/up-board/core-image-sato-sdk-up-board.iso) to a flash drive.

Configure Software on UP Board

  1. Attach USB drive created in the previous section to the UP Board and boot
  2. Press esc at boot to enter system setup
  3. Ensure that Advanced > HAP Configuration has the following settings:
    LPSS I2C #1 Support       [ACPI Mode]
         I2C #1 Speed         [400KHz]
    LPSS I2C #2 Support       [ACPI Mode]
         I2C #2 Speed         [400KHz]
    LPSS PWM #1 Support       [ACPI Mode]
    LPSS PWM #2 Support       [ACPI Mode]
    LPSS SPISupport           [ACPI Mode]
    LPSS HSUART #1 Suppor     [ACPI Mode]
    SCC SDIO Support          [ACPI Mode]
    
    I2CO/GPIO Selection       [GPIO]
    I2S/GPI Selection         [GPIO]
    Save and exit configuration
  4. Press F7 to bring up the boot device menu. Select the USB drive from the menu, and follow the prompts to install the OS. Allow installation to complete and reboot.
  5. Install git:
    git clone https://github.com/git/git
    cd git
    git checkout v2.11.3
    make configure
    ./configure --prefix=/usr
    make all -j4
    make install
  6. Download and build Ardupilot:
    cd ~
    git clone https://bitbucket.org/kevinaangstadt/ardupilot
    cd ardupilot
    git checkout upboard
    git submodule update --init
    ./waf configure --board=upboard
    ./waf build
  7. Binaries for Ardupilot are available in build/up-board/bin

Running Ardupilot

Ardupilot binaries require several flags to configure external devices:

Execution of ardupilot might then look something like the following:

~/ardupilot/build/up-board/ardurover -A /dev/null -B /dev/ttyS1 -C /dev/ttyUSB0

References

Last modified: 2017-09-29