Project

General

Profile

CompilingFirmware » History » Version 8

peteruithoven, 2013-12-03 20:51

1 5 jaap
{{>toc}}
2
3 2 peteruithoven
h1. Compiling from source
4 3 peteruithoven
5 4 jaap
h2. With gcc4mbed
6
7 1 peteruithoven
It is possible to compile the software from source and make a binary image that runs on the mbed.
8
# MBED online compiler (at http://mbed.org): You need an account on mbed.org and a Internet connection. 
9
# GCC4MBED offline compiler, using GCC. Download at (https://github.com/adamgreen/gcc4mbed)
10
11
You can use GCC4MBED on your platform, or use a linux virtual machine to compile the sources. See:
12
http://jeelabs.net/projects/tosca/wiki/ARM_toolchain_setup_GCC4ARM
13
14
Installation of gcc4mbed on linux:
15
<pre>
16
wget https://github.com/adamgreen/gcc4mbed/zipball/master
17
mv master adamgreen-gcc4mbed.zip
18
unzip adamgreen-gcc4mbed.zip
19
mv adamgreen-gcc4mbed-* gcc4mbed
20
cd gcc4mbed
21
./linux_install</pre>
22
Check the "Github gcc4mbed page":https://github.com/adamgreen/gcc4mbed when you run into problems. 
23
Then download / clone the firmware
24
<pre>git clone https://github.com/LaosLaser/Firmware.git</pre>
25
Place laser folder in gcc4mbed folder
26
Run the following command in that folder
27
<pre>make</pre>
28
And copy the resulting bin file to your MBED or LPC.
29
30
The compiler (currently) creates two .bin files. (laos.bin and laos-lpc.bin) laos-LPC is (experimental) for the lpcexpresso (not mbed).
31 4 jaap
32
h2. with open source MBED from GitHub
33
34
Download the firmware from github:
35
36
<pre>git clone --recursive https://github.com/LaosLaser/Firmware.git</pre>
37
38
Optional, maybe not necessary: update mbed libs
39
40
<pre>cd Firmware/mbed</pre>
41
42
<pre>git pull origin master</pre>
43
44
or from elsewhere
45
46
<pre>git pull https://github.com/pbrier/mbed master</pre>
47
48 7 peteruithoven
Download _GCC ARM_ from the following address and place it in a folder
49
_https://launchpad.net/gcc-arm-embedded/+download_
50
51 8 peteruithoven
When necessary update the _GCC_ARM_PATH_ path in _Firmware/mbed/workspace_tools/settings.py_
52
For example: _/Developer/gcc-arm-none-eabi-4_7-2013q3/bin_ (Make sure you specify the _bin_ folder).
53 7 peteruithoven
54 4 jaap
Now, compile the libraries
55
56
<pre>python workspace_tools/build.py -m LPC1768 -t GCC_ARM -r -e -u -c</pre>
57
58
Compiling the firmware
59
60 6 peter
h1. Debugging
61
62
You can debug the MBED by means of a USB/serial connection. This is included in the mbed (no USB/serial adapter required).
63
See the [[MBED Serial Debugging]] page for more information.
64
65 4 jaap
<pre>...</pre>