Install Packages

Install Legato Toolchain
Install Legato
Setup Target
What's Next?

Prep Dev Host before installing Legato packages.

Ensure you have everything you need downloaded. Check Legato Installation Packages.

To access the Legato application framework, you'll need a GitHub account https://legato.io/

Then Setup Target.

Here are the Directories created.

Install Legato Toolchain

You'll need to install the cross-toolchain for building ARM applications. Copy the either the 64-bit or 32-bit [Legato-Toolchain-file] to /opt/swi and then extract it.

You may need to use sudo:

$ mkdir –p /opt/swi
$ cp [Legato-Toolchain-file-name]  /opt/swi 
$ cd /opt/swi 
$ sudo tar xvjf [Legato-Toolchain-file-name]

Install Legato

Install the Legato application framework on your development host PC.

First, create a directory where you'll run Legato (e.g., mkdir Legato).

Then run:

git clone https://github.com/legatoproject/legato-af.git

You'll be prompted for your GitHub credentials.

cd to your Legato directory

Run make.

$ bin/legs

Run this every time you open a new shell:

$ bin/legs

Build the framework on the target by running:

$ make wp7
Note
If you're building an AR7 device, substitute ar7 for wp7.

Or to include the AirVantage agent:

 $ make wp7 INCLUDE_AIRVANTAGE=1 

Setup Target

Here's how to set up your target:

Copy startup scripts to target
Reboot target
Copy libraries and executables

You need to setup a few things on the target before you can start developing Legato applications:

Copy startup scripts to target

Using ssh, access the target:

ssh root@<target ip addr>

When prompted for a password, press enter.

Then create the startup directory:

mkdir -p /mnt/flash/startup

Then copy the startup files to the target by running the following from the dev host:

scp targetFiles/mdm-9x15/startup/fg_* root@<target ip addr>:/mnt/flash/startup

Scripts beginning with fg_ are run first during startup, and then everything else is runs in the background. You can add more scripts to customize your target. fg_ scripts must have executable permissions or they will not run.

See Yocto Install Notes for helpful target setup tips.

Note
In the rare case you need to prevent legato starting automatically, run
touch /mnt/flash/startup/stoplegato

Reboot target

Wait for the target to fully reboot. The target IP address may have changed. Check it using ifconfig on the serial console before proceeding.

Copy libraries and executables

Run this to copy the Legato framework libraries and executables onto the target, and start the Legato runtime components:

$ instlegato build/wp7 <target ip address>  

Directories

Here's the top level Legato directory structure:

./apps - sample applications: airvantageDemo, helloWorld, modeDemo.

./bin - created by build system and populated with executable files run on the development host that ran the build. Contains files like mkapp and mkexe.

./build - results of a framework build. Created by the build system.

./build/tools - tools built and then used by the build system to build other things.

./build/[target] - output of a build for a specific target (e.g., ./build/wp7).

./buildTools - source code for build tools (when built, in ./build/tools).

./cmake - CMake scripts used by the build system.

./components - pre-built audio, data, modem and positioning components.

./framework - source code for the Legato framework.

./interfaces - pre-built audio, data, modem and positioning interfaces.

./targetFiles - files for installation on target devices.

What's Next?

Depending on your environment, you may need to set up other things:

Yocto Linux
Developer Studio
Windows Host

Or you can move on to creating an Hello World app.


Copyright (C) Sierra Wireless, Inc. 2014. All rights reserved. Use of this work is subject to license.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines