CompilingFirmware » History » Version 6
peter, 2013-10-27 13:27
| 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 | Now, compile the libraries |
||
| 49 | |||
| 50 | <pre>python workspace_tools/build.py -m LPC1768 -t GCC_ARM -r -e -u -c</pre> |
||
| 51 | |||
| 52 | Compiling the firmware |
||
| 53 | |||
| 54 | 6 | peter | h1. Debugging |
| 55 | |||
| 56 | You can debug the MBED by means of a USB/serial connection. This is included in the mbed (no USB/serial adapter required). |
||
| 57 | See the [[MBED Serial Debugging]] page for more information. |
||
| 58 | |||
| 59 | 4 | jaap | <pre>...</pre> |