This is an old revision of the document!
Table of Contents
Core Toolchain Setup
for MIOS32 application development on Linux
Preparation
This document assumes that you have a relatively modern x86 based linux distribution. While it may work other distributions, it has only been tested on x86 Ubuntu 10.10. Many of the commands, especially “aptitude” are only available on Debian derived distributions like Ubuntu.
Linux Utilities
subversion
You will need to install subversion to download the svn repository
- sudo aptitude install subversion
wget
Wget is a useful tool for downloading files from the Internet and can be downloaded with:
- sudo aptitude install wget
Required Stuff
Download the MIOS32 repository
Create a directory to download the toolchain to ( ~/midibox is my personal favourite). and download the repository:
- mkdir ~/midibox
- cd ~/midibox
- svn checkout svnmios.midibox.org/mios32
(If that doesn't work try:) * svn checkout svn://svnmios.midibox.org/mios32/
Linux build utilities
command for installing the basic build tools like “make”
* Debian/Ubuntu/Mint: sudo aptitude install build-essential
* Arch Linux/Manjaro: sudo pacman -S base-devel
GNU Multiple Precision Library
Terminal Commands:
* Debian/Ubuntu/Mint: sudo aptitude install libgmp3-dev (or lib32gmp3-dev for AMD64Version)
* Arch Linux/Manjaro: sudo pacman -S gmp
MIOS32 Toolchain
The MIDIbox community have created a modified GNU Compiler Collection, ready for use with the ARM Cortex M3 platform. The toolchain contains all of the tools required to build MIOS32 applications including GCC and NEWLIB.
The Toolchain has currently been compiled for Windows (2000+), Mac OS X (Leopard or newer) and Linux x86 (built on Ubuntu 10.10).
The download directory for the toolchain is http://www.midibox.org/mios32_toolchain
Download the latest “linux” file and extract into your favorite directory, If you extract into /usr/local the toolchain will create /usr/local/mios32_toolchain and various sub-directories containing the toolchain files.
- cd /usr/local
- sudo tar zxvf gcc-arm-none-eabi-xxxxxx.tar.bz2
replace xxxxxxx with the date of the latest linux toolchain in http://www.midibox.org/mios32_toolchain
You now need to set the path variable for the toolchain bin directory (/usr/local/mios32_toolchain/bin) this is covered in the next section
Environment Variables
If you are using the default bash shell then setting up path variables in the shell is quite easy, in a terminal window just type:
- export VARIABLE_NAME=something
and if you want to check to what the variable has been assigned, type:
- echo $VARIABLE_NAME
this will print what's inside the variable. For example, type:
- export MIOS32_PATH=~/svn/mios32/trunk
to set up the mios32 folder path, then type
- echo $MIOS32_PATH
Adding to the path
To temporarily add the mios32_toolchain bin directory to the path, type:
- export PATH=$PATH:/usr/local/mios32_toolchain/bin
to check that the path variable has been assigned type:
- echo $PATH
You should see the toolchain directory at the end of the path
Setup MIOS32 Environment
The following commands will setup the build environment for MIOS32, you must change MIOS32_PATH to be wherever you installed the svn repository:
- export MIOS32_PATH=~/midibox/mios32/trunk
- export MIOS32_BIN_PATH=$MIOS32_PATH/bin
- export MIOS32_GCC_PREFIX=arm-none-eabi
- export MIOS32_FAMILY=STM32F10x
- export MIOS32_PROCESSOR=STM32F103RE
- export MIOS32_BOARD=MBHP_CORE_STM32
- export MIOS32_LCD=universal
You can add these lines to your ~/.profile file to ensure that they are always set, the editor pico (or nano) is a fairly simple text editor but you may have your favourite.
Building your first application
Once you have completed the above steps, you should be able to build your first application.
- cd $MIOS32_PATH/apps/tutorials/001_forwarding_midi
- make
if this works great! If not, either you made a mistake (or I did!!)