Skip to content
Snippets Groups Projects
ade.md 2.48 KiB
Newer Older
Martyn Welch's avatar
Martyn Welch committed
+++
date = "2018-10-17"
weight = 100

title = "Apertis Development Environment"

aliases = [
    "/old-wiki/SDK"
]
+++

Apertis provides tools to aid with the development of applications using the
Martyn Welch's avatar
Martyn Welch committed
[Canterbury application framework]( {{< ref "canterbury-legacy-application-framework.md" >}} ),
Martyn Welch's avatar
Martyn Welch committed
which help with the building of applications targeting a hardware platform;
the installation of development versions of the application to the target
device and debugging of the application.

These tools are pre-installed in the Apertis SDK. The SDK images shipped by
Apertis are meant to be run in [VirtualBox]( {{< ref "/virtualbox.md" >}} ).
They provide a common, reproducible environment to build both platform
packages and application-bundles for Apertis.

# Building and debugging app bundles with ade

The following steps can be used to cross-compile an example "Hello World"
agent, deploy it onto the target device and debug it remotely using `gdb` using
the Apertis helper tool called `ade`:

- Setup the `HOST` environment variable for the address of your target board:

<!-- end list -->

    HOST=<target IP address or hostname>

- Install sysroot for target board. This will default to installing a sysroot
  for `armhf`, using the distribution and release of the current SDK, specify
  using the command line arguments if this is not what is required (see
  `ade sysroot install --help` for more information):

<!-- end list -->

    ade sysroot install

- Create a ssh RSA key (using the legacy PEM format), accepting the default
  settings so as not to require any password to access the target board
  over SSH and copy it to the target:

<!-- end list -->

    ssh-keygen -t rsa -m PEM
    ssh-copy-id user@$HOST

- Clone the example application:

<!-- end list -->

    git clone https://gitlab.apertis.org/sample-applications/helloworld-simple-agent.git
    cd helloworld-simple-agent

- Get `ade` to configure, build and install the application on the target:

<!-- end list -->

    ade configure --debug --device user@$HOST
    ade export
    ade install --device user@$HOST

- Before starting to debug of target, we need to ensure that `gdbserver` is
  installed on the remote device:

<!-- end list -->

    ssh user@$HOST "sed -e '/target/!d' -e 's/target/development/' /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/development.list"
    ssh user@$HOST "sudo apt update && sudo apt install gdbserver"

- The following command will start remote debugging:

<!-- end list -->

    ade debug --device user@$HOST