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).
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):
HOST~$
commands executed on the Host. (This guide is developed on an OSX system, but probably works on Linux or Windows with MinGW or PuTTy too).XCS~$
commands executed on the Cross-Compilation Server / VirtualBox. (Also called XCS)RPI~$
commands executed on the Raspberry Pi. (Shortened as RPi)In the github-repo three important folders can be found:
Hello World!
Snapping a picture with the PiCamera with a self-compiled version of “raspivid”
Displaying a picture via the OpenCV calls
imread
andimshow
.
Running
roscore
androscomm
on the Pi, printing “Hello World”
Blinking a Led.
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.