LXR OSX build instructions
Tested on 10.8.x and 10.9.2; likely needs Xcode installed also (https://developer.apple.com/xcode/downloads/)
Contents
General steps
The LXR code is divided into two main parts
- the AVR Atmel code (display and front-panel control)
- the Cortex M4 ARM code (main LXR code for DSP, sequencer, USB etc.)
We need different toolkits to manage to compilation of each set of code.
AVR COMPILER & LIBS
- Download the Atmel AVR 8-bit toolchain for Mac from http://www.obdev.at/products/crosspack/download.html
- You will get a .dmg file that you should extract and install (CrossPack-AVR-20131216.dmg is the most recent as of 2014/05/02)
- The compiler and libs are installed under /usr/local/CrossPack-AVR
- This will be a symlink to a folder like /usr/local/CrossPack-AVR-20131216
GNU ARM COMPILER AND LIBS
- Download the GNU bare metal ARM toolchain from https://launchpad.net/gcc-arm-embedded
- Get the Mac version (something like gcc-arm-none-eabi-4_8-2014q1-20140314-mac.tar.bz2)
- Extract the compressed tar file to /usr/local
cd /usr/local && tar -jxf /path/to/gcc-arm-none-eabi-4_8-2014q1-20140314-mac.tar.bz2
Change your PATH
- We need to add a specific PATH for both compilers (and libs) for the MAC. Here is mine...
export ARM_TOOLKIT_ROOT=/usr/local/gcc-arm-none-eabi-4_8-2014q1 export AVR_TOOLKIT_ROOT=/usr/local/CrossPack-AVR-20131216
- in a terminal window, execute "source ./.bash_profile" to update the PATH to your system.
- for the moment, don't try to understand what are ARM_TOOLKIT / AVR_TOOLKIT variables, we will explain why we need this later.
Grab the LXR Code
We advice you to grab the code either from :
Julian repository on GITHUB (https://github.com/SonicPotions/LXR) PLD repository (https://github.com/patrickdowling/LXR) rudeog repository (https://github.com/rudeog/LXR) -> extra features compared to Julian code. rstephane repository (https://github.com/rstephane/LXR) -> equivalent to Julian CODE.
- of course once downloaded, you should extract the code and copy it to any folder you like. On our side we copied it under: /Users/music/Documents/workspace/LXR/
LXR source code
We advice you to grab the makefiles either from :
PLD repository (https://github.com/patrickdowling/LXR) rstephane (@egnouf) repository (https://github.com/rstephane/LXR) RUDEOG repository https://github.com/patrickdowling/LXR
- You will find on the root path of both repository a file called MAKEFILE. You will also need the other makefiles:
https://github.com/patrickdowling/LXR/blob/makefiles/Makefile https://github.com/patrickdowling/LXR/blob/makefiles/front/AVR/Makefile https://github.com/patrickdowling/LXR/blob/makefiles/mainboard/firmware/DrumSynth_FPU/Makefile https://github.com/patrickdowling/LXR/blob/makefiles/tools/FirmwareImageBuilder/Makefile
- Once downloaded, copy them at the root PATH of the code (1) and in subfolders (2,3,4) you dowloaded in STEP 4.
- If you have taken the whole LXR code from @PLD or rstephane or @RUDEOG you don't need to download once more the Makefiles, they are provided within !
Now, let's go back to the .bash_profile file:
export PATH=$PATH:/usr/local/CrossPack-AVR-20131216/bin:/usr/local/CrossPack-AVR-20131216/:/usr/include:/usr/local/CrossPack-AVR-20131216/avr/include:/usr/local/gcc-arm-none-eabi-4_8-2014q1/bin export ARM_TOOLKIT_ROOT=/usr/local/gcc-arm-none-eabi-4_8-2014q1 export AVR_TOOLKIT_ROOT=/usr/local/CrossPack-AVR-20131216
- You can notice the two variables ARM_TOOLKIT_ROOT and AVR_TOOLKIT_ROOT.
- They are used by the MAKEFILE that has created @PLD (and also used by rstephane).
- Change their values appropriately, according to your system path, where you installed the libs... etc.
Compile
- Open a terminal window, go under your LXR code root path i.e cd /Users/music/Documents/workspace/LXR/
- Launch the command "make firmware" from a MAC terminal window. To clean the "code" you can execute "make clean".
- You will get a FIRMWARE.BIN image (in fact, we compiled two programs and the makefile combine both to one single file !), copy this file on your SD CARD and follow instruction to upload your new firmware.
If you have downloaded rstephane code, similar to @Julian and @PLD, you will noticed that when you power on the machine, it displays "LXR-Drums-V" instead of "LXR Drums V". If so, you have successfully loaded (and compiled) LXR CODE!!!!
Well done and happy hacking!