Skip to content

Snap support

This page documents the process of building and running an application using Snap within the Hexagon SDK.

Build binaries

  • Setup the Hexagon SDK environment

  • Download the 64-bit flavor of the Linaro tools and extract them to $HEXAGON_SDK_ROOT/tools/ folder following these instructions

  • Choose an SDK example

    For example:

    cd $HEXAGON_SDK_ROOT/examples/calculator
    
  • Build the application and DSP code using make.d or CMake

    For example (on a Windows machine):

    build_cmake ubuntuARM
    build_cmake hexagon DSP_ARCH=v66
    
  • Sign the Hexagon shared object

    For example:

    python $HEXAGON_SDK_ROOT/utils/script/signer.py -i libcalculator_skel.so
    

Create a Snap package

  • Copy both apps and DSP binaries from ship dir to a host with a Snapcraft environment

    scp -r username@hostname:source_location username@hostname:dest_location
    
  • Compile Snap with destructive-mode

    You may need to set environment variables as follows:

    HLOS_APP_PREBUILTS_PATH=$(pwd)/UbuntuARM64/
    ADSPRPC_TAR_PATH=$(pwd)/../
    HEXAGON_DSP_PREBUILTS_PATH=$(pwd)/hexagon/
    DSP_LIB_PATH=$(pwd)/qcom-fw
    

    From Linux running on AMD/X86, you can cross-compile Snap files for an ARM64 architecture as follows:

    snapcraft --destructive-mode --target-arch=arm64 --enable-experimental-target-arch
    

    From target you can compile Snap files as follows:

    snapcraft --destructive-mode
    
  • Once your Snap creation is successful, you will see {your-snap-name-version}-{arch}.snap file being generated

    For example:

    qti-calculator_0.1_arm64.snap
    

Install and run Snap

  • Copy the Snap to the target using the scp command, access the target using COM port or ssh command and install the Snap on target

    scp -r username@hostname:source_location username@hostname:dest_location
    ssh username@hostname
    sudo snap install qti-calculator_0.1_arm64.snap --dangerous
    
  • Connect the plugs

    sudo snap connect qti-calculator:ion
    sudo snap connect qti-calculator:adsprpc-smd
    
  • Check the details about your installed snap using the info command

    sudo snap info qti-calculator
    
  • Run your application using the command defined inside the snapcraft.yaml file

    sudo qti-calculator.testapp