All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Yocto Linux

The Yocto Project is an open source collaboration project that provides templates, tools and methods to help you create custom Linux-based systems for embedded products regardless of the hardware architecture.

Legato is compatible with Yocto 1.6.1

Yocto Linux Directories

Untar the file Legato-Dist-Source-mdm9x15-15.01.tar.bz2 to a directory:

$ cd <some directory>
$ tar xvjf Legato-Linux-Dist-mdm9x15-15.01.tar.bz2

These file/directories will be extracted:

  • linux-yocto-3.4.git - Linux kernel - 14.1.0.Beta.rc2
  • Legato-Yocto1_6 - Sierra Wireless specific layers
  • meta-swi - Hardware adaptations
  • meta-swi-extras - Build scripts and proprietary code

Yocto uses a layered model for its build system. In Legato, device-specific layers are meta-swi-[target] and meta-swi-bin.

Yocto 1.6.1 and poky environment documentation is available at Yocto docs

Pre-built Yocto Image

The prebuilt directory contains a kernel and root file system that can be built using the command below. It's the same as what's flashed on the device, and can be used to return to a known state.

  • kernel - kernel image
  • rootfs - smallish root file system ready for basic development.

Instructions on how to flash these images to the device are given in the file README.bsp.

Rebuild Yocto Image

Instructions for rebuilding the image are contained in the file Legato-Yocto1_6/meta-swi-extras/README.build

Running the build script with no arguments will print out the help message. There is also a file called stdbuild.sh to build the images with common options. This can take a long time the first time you run it. Once the build is complete, you'll find new images in the directory:

../build/tmp/deploy/images

Links are created at the end of the build to point to the latest kernel (kernel) and root file system (rootfs)

Warning
You can’t rebuild Yocto images on Ubuntu 13.10.

Windows Flash Yocto

The easiest way to flash a Yocto image is through Windows. The steps are the same as upgrading to the latest firmware that includes flashing the Yocto image:

  • Download SWI9X15W_06.03.39.00-wp_yocto-cwe.exe to your host.
    See Legato Downloads
  • Turn the board BOOT switch to 'OFF' (Recovery mode). Depending on your dev kit, 'LOW' is the same as 'OFF'.
  • Connect the target: displays in Device Manager list as 'Sierra DM Port' under Ports.
  • Run SWI9X15W_06.03.39.00-wp_yocto-cwe.exe by double-clicking the file. After the image flash process completes, it will advise it's resetting the target.
  • Disconnect power from your target and turn your BOOT switch to 'ON' (or 'HIGH').
  • Reconnect power to your target; it should enumerate (with other targets) under Ports in Window Device Manager.

Connect to the target's AT Port (through HyperTerminal or Tera Term), and run ati to verify the flash update was successful. Output will look like this:

Manufacturer: Sierra Wireless, Incorporated
Model: WP7102
Revision: SWI9X15W_06.03.39.00 r23799 CNSHZ-AR-BUILD 2014/xx/xx 13:02:24
IMEI: (Your imei)
IMEI SV: 0
+GCAP: +CGSM,+FCLASS,+DS
Note
Flashing a new image will override existing settings. To easily keep your ecm on Linux, just temporarily rename your usbmode file; or you can always create a new one. CDC-ECM for IP vs Ethernet and Micro-USB

Linux Flash Yocto

You can flash the Yocto images on Linux;, the device must be in fastboot mode. From the shell prompt on the device run:

root@swi-mdm9x15:~# sys_reboot bootloader

After a few seconds, the device will enumerate as an Android Bootloader Device. You can test this on the development PC with:

dave@devpc$ fastboot devices
MDM9615

Then erase and rewrite the kernel and root filesystem partitions using the fastboot command (the partitions are called kernel and rootfs):

dave@devpc $ fastboot erase kernel
...
dave@devpc $ fastboot erase rootfs
...
dave@devpc $ fastboot flash kernel kernel
...
dave@devpc $ fastboot flash rootfs rootfs
...
dave@devpc $ fastboot reboot
rebooting...
finished. total time: 0.001s
Note
You have to use the micro-USB connection for fastboot

Custom Yocto Image

Because the Legato image is a Yocto-compliant BSP, there are many options for customizing.

Here's the easy way to add some packages to the rootfs:

meta-swi-extras/meta-swi-bin/recipes/images/9615-cdp-sierra-image.inc

For more complex customizations, refer to the Yocto documentation.


Copyright (C) Sierra Wireless Inc. All rights reserved.