CompilingFirmware » History » Version 14
peteruithoven, 2013-12-04 17:56
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 | 11 | peteruithoven | Patch mbed libraries: |
49 | 1 | peteruithoven | |
50 | 13 | jaap | <pre>cd mbed/ |
51 | 14 | peteruithoven | patch -p1 < ../laser/mbed.patch</pre> |
52 | 11 | peteruithoven | |
53 | 7 | peteruithoven | Download _GCC ARM_ from the following address and place it in a folder |
54 | _https://launchpad.net/gcc-arm-embedded/+download_ |
||
55 | |||
56 | 8 | peteruithoven | When necessary update the _GCC_ARM_PATH_ path in _Firmware/mbed/workspace_tools/settings.py_ |
57 | For example: _/Developer/gcc-arm-none-eabi-4_7-2013q3/bin_ (Make sure you specify the _bin_ folder). |
||
58 | 7 | peteruithoven | |
59 | 4 | jaap | Now, compile the libraries |
60 | |||
61 | 1 | peteruithoven | <pre>python workspace_tools/build.py -m LPC1768 -t GCC_ARM -r -e -u -c</pre> |
62 | |||
63 | 9 | peteruithoven | Link LaOSlaser as an mbed example project |
64 | 11 | peteruithoven | <pre>cd libraries/tests/net/protocols/</pre> |
65 | 1 | peteruithoven | |
66 | 11 | peteruithoven | <pre>ln -s ../../../../../laser</pre> |
67 | |||
68 | 9 | peteruithoven | Compiling the firmware: |
69 | 11 | peteruithoven | <pre>cd ../../../../</pre> |
70 | |||
71 | <pre>python workspace_tools/make.py -m LPC1768 -t GCC_ARM -n laser</pre> |
||
72 | 9 | peteruithoven | |
73 | 4 | jaap | Read http://mbed.org/handbook/mbed-tools for more info |
74 | 6 | peter | |
75 | h1. Debugging |
||
76 | |||
77 | You can debug the MBED by means of a USB/serial connection. This is included in the mbed (no USB/serial adapter required). |
||
78 | See the [[MBED Serial Debugging]] page for more information. |
||
79 | 4 | jaap | |
80 | 1 | peteruithoven | <pre>...</pre> |