Project

General

Profile

CompilingFirmware » History » Version 4

jaap, 2013-10-27 11:38

1 2 peteruithoven
h1. Compiling from source
2 3 peteruithoven
3 4 jaap
h2. With gcc4mbed
4
5 1 peteruithoven
It is possible to compile the software from source and make a binary image that runs on the mbed.
6
# MBED online compiler (at http://mbed.org): You need an account on mbed.org and a Internet connection. 
7
# GCC4MBED offline compiler, using GCC. Download at (https://github.com/adamgreen/gcc4mbed)
8
9
You can use GCC4MBED on your platform, or use a linux virtual machine to compile the sources. See:
10
http://jeelabs.net/projects/tosca/wiki/ARM_toolchain_setup_GCC4ARM
11
12
Installation of gcc4mbed on linux:
13
<pre>
14
wget https://github.com/adamgreen/gcc4mbed/zipball/master
15
mv master adamgreen-gcc4mbed.zip
16
unzip adamgreen-gcc4mbed.zip
17
mv adamgreen-gcc4mbed-* gcc4mbed
18
cd gcc4mbed
19
./linux_install</pre>
20
Check the "Github gcc4mbed page":https://github.com/adamgreen/gcc4mbed when you run into problems. 
21
Then download / clone the firmware
22
<pre>git clone https://github.com/LaosLaser/Firmware.git</pre>
23
Place laser folder in gcc4mbed folder
24
Run the following command in that folder
25
<pre>make</pre>
26
And copy the resulting bin file to your MBED or LPC.
27
28
The compiler (currently) creates two .bin files. (laos.bin and laos-lpc.bin) laos-LPC is (experimental) for the lpcexpresso (not mbed).
29 4 jaap
30
h2. with open source MBED from GitHub
31
32
Download the firmware from github:
33
34
<pre>git clone --recursive https://github.com/LaosLaser/Firmware.git</pre>
35
36
Optional, maybe not necessary: update mbed libs
37
38
<pre>cd Firmware/mbed</pre>
39
40
<pre>git pull origin master</pre>
41
42
or from elsewhere
43
44
<pre>git pull https://github.com/pbrier/mbed master</pre>
45
46
Now, compile the libraries
47
48
<pre>python workspace_tools/build.py -m LPC1768 -t GCC_ARM -r -e -u -c</pre>
49
50
Compiling the firmware
51
52
<pre>...</pre>