Project

General

Profile

Actions

CompilingFirmware » History » Revision 23

« Previous | Revision 23/25 (diff) | Next »
peteruithoven, 2014-04-13 22:09


Compiling from source

It is possible to compile the software from source and make a binary image that runs on the mbed. There are 3 methods:
  1. With MBED online compiler (at http://mbed.org): You need an account on mbed.org and a Internet connection.
  2. With gcc4mbed offline compiler, using GCC. Download at (https://github.com/adamgreen/gcc4mbed)
  3. With open source MBED from GitHub (recommended method).

With gcc4mbed

You can use GCC4MBED on your platform, or use a linux virtual machine to compile the sources. See:
http://jeelabs.net/projects/tosca/wiki/ARM_toolchain_setup_GCC4ARM

Installation of gcc4mbed on linux:

wget https://github.com/adamgreen/gcc4mbed/zipball/master
mv master adamgreen-gcc4mbed.zip
unzip adamgreen-gcc4mbed.zip
mv adamgreen-gcc4mbed-* gcc4mbed
cd gcc4mbed
./linux_install

Check the Github gcc4mbed page when you run into problems.
Then download / clone the firmware
git clone https://github.com/LaosLaser/Firmware.git

Place laser folder in gcc4mbed folder
Run the following command in that folder
make

And copy the resulting bin file to your MBED or LPC.

The compiler (currently) creates two .bin files. (laos.bin and laos-lpc.bin) laos-LPC is (experimental) for the lpcexpresso (not mbed).

With open source MBED from GitHub

Download the firmware from github (mbed-gcc branch):

git clone --recursive https://github.com/LaosLaser/Firmware.git -b mbed-gcc

Optional, maybe not necessary: update mbed libs. For patch compatibility we update from the /pbrier/mbed repository. See [issue 96](http://redmine.laoslaser.org/issues/96)

cd Firmware/mbed
git pull https://github.com/pbrier/mbed master

Patch mbed libraries:

cd mbed/
patch -p1 < ../laser/mbed.patch

Download GCC ARM from the following address and place it in a folder
https://launchpad.net/gcc-arm-embedded/+download

Copy Firmware/mbed/workspace_tools/settings.py to Firmware/mbed/workspace_tools/private_settings.py.
Update the GCC_ARM_PATH path in private_settings.py to for example: /Developer/gcc-arm-none-eabi-4_7-2013q3/bin (Make sure you specify the bin folder).

Now, compile the libraries

python workspace_tools/build.py -m LPC1768 -t GCC_ARM -r -e -u -c

Link LaOSlaser as an mbed example project

cd libraries/tests/net/protocols/

ln -s ../../../../../laser

Compiling the firmware:

cd ../../../../

python workspace_tools/make.py -m LPC1768 -t GCC_ARM -n laser

Then you should be able to find your new firmware at:
Firmware/mbed/build/test/LPC1768/GCC_ARM/laser/laser.bin

Read http://mbed.org/handbook/mbed-tools for more info

Debugging

You can debug the MBED by means of a USB/serial connection. This is included in the mbed (no USB/serial adapter required).
See the MBED Serial Debugging page for more information.

...

Updated by peteruithoven over 10 years ago · 23 revisions