Apertis provides tools to aid with the development of applications using the Canterbury application framework, 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. 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:
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):
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:
ssh-keygen -t rsa -m PEM
ssh-copy-id user@$HOST
  • Clone the example application:
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:
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:
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:
ade debug --device user@$HOST