rpicross_notes

Guide to Cross Compilation for a Raspberry Pi

  1. > Start
  2. Setup XCS and RPi
  3. Setup RPi Network and SSH
  4. Setup RPi Peripherals
  5. Setup Cross-compile environment
  6. Cross-compile and Install Userland
  7. Cross-compile and Install OpenCV
  8. Cross-compile and Install ROS
  9. Compile and Install OpenCV
  10. Compile and Install ROS
  11. Remote ROS (RPi node and XCS master)
  12. ROS package development (RPi/XCS)
  13. Compile and Install WiringPi

1. Start

Welcome at this Cross Compilation Guide for a Raspberry Pi.

This repository started as a personal guide to keep track of how to setup a proper cross-compilation system, but grew to a public guide, where it hopefully can help many others too. It also contains toolchains and scripts to ease the cross-compilation process as well as examples and tests to verify the setup.

The system is build within a VirtualBox running an Ubuntu OS. This VirtualBox holds all tools for the cross-compilation. A VirtualBox is chosen to ensure that we cannot mess up the main machine with faulty (library) installations or accidentally changing system-critical symbolic links (which happened to me on earlier journeys).

During this guide the following systems will be configured, (cross)compiled and installed:

Additionally we setup:

To use this guide, experience with VirtualBox, C, Python and the terminal/nano are assumed. You also need a Raspberry Pi and SDCard-reader (as we’ll initially configure the Pi via the SDCard, connected to the VirtualBox).

How to Read?

The notes are in chronological order and can be followed with the table of contents on the top of the page. As both the VirtualBox and Raspberry Pi will be configured to run headless (that is, without a display) instructions are command-line styled. These instructions are prefixed with identifiers, as we use 3 different systems (Host, XCS and RPI):

In the github-repo three important folders can be found:

In the main directory you can also find the toolchain which will be used throughout this guide.

If you encounter problems or see mistakes, feel free to create an issue or pull request.

Enjoy! Hessel.

PS. This guide is also available at https://hesselm.github.io/rpicross_notes/.

PPS. Special thanks to: RaymondKirk, ConnorChristie, Skammi, compyl118 for suggestions, fixes, testing and helping out.