Ambarella S5L

The Ambarella S5L is an IP Camera System-on-Chip (SoC). It has a quad core ARM Cortex-53 CPU and 512 MB of RAM. More information is available about these devices on Ambarella’s product page.

Xnor Bundles have been tested and benchmarked on a standard Ambarella S5L development kit.

Language-independent setup

You must already have obtained an S5L development kit from Ambarella, as well as the Ambarella SDK.

Setting up for C development

To start developing C code for your Ambarella device, you will need to install a cross-compiler. An ARM cross-compiler package is available on Ubuntu-based systems in the gcc-aarch64-linux-gnu package:

sudo apt install gcc-aarch64-linux-gnu

Make sure to set the CC environment variable to the path to this compiler when running the Xnor SDK samples:

export CC=/usr/bin/aarch64-linux-gnu-gcc

Once the compiler is installed, try compiling a test program to make sure it’s working correctly:

myworkstation% cat > hello.c << EOF
#include <stdio.h>
int main(int argc, char **argv) { puts("AI at your fingertips"); return 0; }
EOF
myworkstation% $CC -o hello hello.c
myworkstation% file hello
hello: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV),
 dynamically linked, interpreter /lib/ld-, for GNU/Linux 3.7.0,
 BuildID[sha1]=<hash>, not stripped

If this works, you can go into the samples/c directory of the Xnor SDK and compile and run any of the samples.:

myworkstation% cd xnor-sdk-ambarella-s5l/samples/c
myworkstation% make
myworkstation% scp build/* my-ambarella-s5l:/root/
myworkstation% scp ../test-images/dog.jpg root@my-ambarella-s5l:/root/
myworkstation% ssh root@my-ambarella-s5l
my-ambarella-s5l% ./detect_and_print_objects_in_image dog.jpg
In this image, there's
  pet
  vehicle
  vehicle

Setting up for C++ development

Before you begin, make sure your Ambarella SDK is set up for cross-compilation to your Ambarella S5L board. The Ambarella SDK must be configured correctly in order to build the C++ sample. In particular, make sure you’ve successfully run the following commands to generate the config file for your board (s5l_batman in this example):

myworkstation% cd ~/s5l_linux_sdk/ambarella/boards/s5l_batman
myworkstation% make sync_build_mkcfg
myworkstation% make s5l_batman_config

You should see a file in this folder called config.h when this step is complete:

myworkstation% ls ~/s5l_linux_sdk/ambarella/boards/s5l_batman
AmbaConfig  bsp  config  config.h  devices.h  Makefile  rootfs

Once this is done, set the Ambarella SDK environment variable to point to the location of your downloaded Ambarella SDK:

myworkstation% export AMBARELLA_SDK=~/s5l_linux_sdk

To build the Xnor C++ sample code for your Ambarella device, you will need to have a cross-compiler installed. An ARM cross-compiler package is available on Ubuntu-based systems in the g++-aarch64-linux-gnu package:

sudo apt install g++-aarch64-linux-gnu

Make sure to set the CXX environment variable to the path to this compiler when building the Xnor Ambarella S5L C++ sample:

export CXX=/usr/bin/aarch64-linux-gnu-g++

Then the sample can be cross-compiled from the host and run on the S5L:

myworkstation% cd xnor-sdk-ambarella-s5l/samples/cxx
myworkstation% make
myworkstation% scp build/* root@my-ambarella-s5l:/root/
myworkstation% ssh root@my-ambarella-s5l
my-ambarella-s5l% ./camera_init.sh
my-ambarella-s5l% ./object_detector

Next Steps for C/C++ development