Hello,
First of all, I would like to thanks
@Rudeog,
@Pld,
@TB323,
@Julian and
@spfrc for their great help with me :-) I must have forgot some names who helped me, sorry in advance :-)
Tutorial to build the firmware for MAC OS 10.8 and above:Note 1 - The installation steps are rather simple as I don't use anymore ECLIPSE. Indeed, configuring Eclipse on MAC to compile the code is rather tricky for a beginner like me.
Note 2 - The LXR code is divided into two mains code parts that we will compile "separately" using two different tools :-)
- the AVR Atmel CODE (LCD, front panel control, USB, SD card)
- the ARM CODE (main LXR code for the voices / sounds)
General steps:We need "specific compilers and librairies" for each CODE.
We need to change the PATH in your .bash_profile, and finally we need MAKEFILES to build the firmware:
- AVR AtmelCODE -> command/libs avr-gcc
- GNU ARM CODE --> command/libs arm-eabi-none-gcc
- Change PATH on your MAC -> I will provide an exemple later.
- LXR Code -> We need the LXR code that we will download later.
- MACOS specific MAKEFILES -> We need special makefileS that @PLD has provided. I will give you the links later
- Compiling and build the firmware.bin file-> You just have to launch the command "make firmware" from a MAC terminal window.
Let's start!
1- AVR COMPILER & LIBS: - Download of Atmel AVR 8-bit toolchain 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 2015/05/02)
- The compiler and libs are installed under /usr/local/CrossPack-AVR-20131216/
- Note that you will also find a folder like /usr/local/CrossPack-AVR/ (this folder is an alias to the previous folder - symlink).
- Take the MAC version (something like : gcc-arm-none-eabi-4_8-2014q1-20140314-mac.tar.bz2 )
- Extract the compressed/tar file.
- Copy the extracted folder under /usr/local/
- Nothing else to do !
3- Change your PATH
- We need to add a specific PATH for both compilers (and libs) for the MAC.
Here is mine...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
- 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_TOLLKIT variables, I will explain why we need this later.
4- Grab the LXR Code I advice you to grab the code either from :
- Julian repository on GITHUB (https://github.com/SonicPotions/LXR) -> but you may have issues as this code contains wrong backslashes in certain area of the code. Should be soon fixed.
- PLD repository (https://github.com/patrickdowling/LXR) -> but you may also have issues with this code containing wrong backslashes in certain area of the code.
- rudeog repository (https://github.com/rudeog/LXR) -> this one is OKAY with extra features compared to Julian code.
- rstephane repository (https://github.com/rstephane/LXR) -> this one is OKAY, it is equivalent to Julian CODE without the wrong backslashes.
- of course once downloaded, you should extract the code and copy it to any folder you like.
On my side I did copied it under: /Users/music/Documents/workspace/LXR/
5- MACOS specific makefiles I 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.
Notes:
- If you have taken the whole LXR code from @PLD or rstephane (@egnouf) or @RUDEOG you don't need to download once more the Makefiles, they are provided within ! - the Makefiles of rstephane are a copy of the one provided by @PLDNow, 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.
6- Compile
- You just have to 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.
7- Final note and test
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!
:-)
Comments
Hopefully I can get them tested on windows as well at some point.
on my side, I took the rudeog repository code and added the different makefile (coming from Patrick @pld). that's not all, then I had to replace the folder "tools" (in the rudeog repository) by the one provided by @PLD. Otherwise I get a compilation target error, can't build target bin, cortex, etc...
now, the system compiles fine the code of rudeog on a MAC OS !
have a good night!
after some further testing I will probably upload it tomorrow.
I already added the build instructions for the linux build to the readme file.
I will also include egnouf OSX instructions.
Maybe I will also test the makefiles on windows, would be great to have a unified build environment that works on all systems. Getting the makefiles to build on Linux was MUCH more straight forward than setting up eclipse!
I think I could try cygwin or an eclipse makefile project import for win.
That is weird. Which header file is it?
So to add to the instructions...
Windows Build
Follow instructions 1 to 4 above
Install Cygwin from http://cygwin.com/install.html
During installation, add the following which are in the "Devel" item in the tree:
-gcc-g++
-make
Open a cygwin terminal, and cd to the root of your LXR tree
set the two aforementioned environment variables
run make firmware
The only trouble one may run into is that the makefiles use "find" to determine which source to compile. If using eclipse you might have one or more .c files under .metadata (for what reason, I don't know), so be sure to remove these.
I still have to do some testing with the upcoming v0.33, but the fixed and merged code with the makefiles should be up in my repo by the end of the week.
/bin/sh: /bin/arm-none-eabi-gcc: No such file or directory
It can't find this file even it is where it should be and I also adapted my .bash_profile with the respective path.
Any idea what I made wrong?
can you print your path settings ('echo $PATH')
I had a problem like this with an error in the first makefiles.
The makefile added /bin/ to the path automatically.
So the resulting path was .../bin/bin/
are you using the makefiles from my (sonic-potions) repository in the latest version?
can you launch 'arm-none-eabi-gcc' directly from bash?
That's true I did not yet merged your new makefiles with the main branch :-)
You have to set AVR_TOOLKIT_ROOT in the .bash file on your mac.
(export AVR.... = the path)
Tell me if you need more details about this part :-)
Other notes
The LXR-Fusion is under DEV.
The code contains a lot of experimental add-on which are not called but present as a function (check the sequencer file, distortion file, drumvoicefile). I also tried to add comments to help ;-)
I arrive to a point where I need:
- as a good practice, merge the new LXR makefiles to my branch :-)
- finish the function RANDOM, you will be able to RND more parameters :-)
- I am playing a lot with the OTO effect, very nice!
- I would like to improve the Loop Divide function
- I would like to add more effect but I am stack on the number of sub page you can get (only two per section).
- I need to refresh values when I do a random
- I need to refresh the step sequence when playing with pre filled pattern
anyhow, I am addicted to code the LXR !!! I can put the function I aswell wanted !!!
:-)
well, if you take my code and you declare the export stuff in your bash profile, it should work.
I need to merge the new makefoile to my branch , I will test it this week-end and tell you more next week