Skip to content

Setup

SDK environment

Before using the SDK tools from the command line, run the SDK setup script, which points environment variables to the tools and utilities required by the Hexagon SDK. If some of the tools are missing or the environment is already setup, the script will generate some warnings.

NOTE: The system path and tool changes are made locally only for the current shell or terminal. They do not have any effect on the global variables.

The instructions for running the setup script are different for Windows and Linux.

Windows

To set up the SDK environment in Windows, run the following command from the Hexagon SDK root directory:

  • From the command prompt

    setup_sdk_env.cmd
    
  • From the powershell

    setup_sdk_env_power.ps1
    

Linux

To set up SDK environment in Linux, you must first to switch to a bash shell. To switch from any unknown shell to a bash shell in Linux, enter bash in the terminal. This step is required because the setup script works in the bash environment.

Once in a bash shell, run the setup script:

source setup_sdk_env.source

Or

. setup_sdk_env.source

Hexagon tools

By default, the Hexagon SDK uses the Hexagon tools installed with the SDK to compile and run the code on the simulator. You can override this default behavior by setting the HEXAGON_TOOLS_ROOT environment variable.

Hexagon tools for any specific version can be downloaded from QPM. Refer to the feature matrix to find right tools versions for a specific target.

Note: Please note that in Windows, the PATH environment variable should NOT contain paths to the Hexagon Tools as this may cause the simulator to crash.

Android NDK

The setup_sdk_env script of the Hexagon SDK sets the Android Tools location to the default directory where they get installed as part of Hexagon SDK installation. However, this location can be changed by setting the ANDROID_ROOT_DIR environment variable. By default we are supporting android-ndk-r25c, but the SDK still supports android-ndk-r19c. To use android-ndk-r19c follow the steps below:

  1. Download the android NDK r19c:

    • Windows:
      • Full NDK: https://www.intrinsyc.com/hexagonsdk/windows/android-ndk-r19c-windows-x86_64.zip
      • Minimal NDK: https://www.intrinsyc.com/hexagonsdk/windows/minimal_android-ndk-r19c-windows-x86_64.zip
    • Linux:
      • Full NDK: https://www.intrinsyc.com/hexagonsdk/linux/android-ndk-r19c-linux-x86_64.zip
      • Minimal NDK: https://www.intrinsyc.com/hexagonsdk/linux/minimal_android-ndk-r19c-linux-x86_64.zip
  2. Unzip the ndk zip to your desired location and set the ANDROID_ROOT_DIR environment variable to that location.

    • Windows: set ANDROID_ROOT_DIR="C:\Windows\android-ndk-r19c"
    • Linux: export ANDROID_ROOT_DIR=/local/mnt/workspace/android-ndk-r19c/

Linaro

Linaro tools are required to build HLOS binaries for LE variant. The setup_sdk_env script sets the Linaro Tools default location to $HEXAGON_SDK_ROOT/tools/linaro64/. However, this location can be changed by setting UBUNTUARM32_TOOLS_DIR or UBUNTUARM64_TOOLS_DIR environment variables for building 32-bit or 64-bit applications respectively. Follow these steps to download and extract linaro tools.

OELinux Toolchain

OELinux tools are also used to build HLOS binaries for the LE variant on Ubuntu Host. The $HEXAGON_SDK_ROOT/build/setup_LE_Toolchain_env.source script contains an UBUNTUARM_DIR variable set to $HEXAGON_SDK_ROOT/tools/OELinuxTools/sysroots/x86_64-qtisdk-linux. This location may be changed if the tools are installed in a different location. Follow these steps to download and extract OELinux Tools.

Device setup verification

If the correct drivers and the Android Debug Bridge (ADB) are installed, access the device by entering the following command:

adb devices

This command lists all devices accessible via ADB. A typical response looks like this:

List of devices attached
68070104        device

To obtain additional details for each connected device, append the -l option to the the command.

If ADB reports one device as being connected, check whether the SDK is installed correctly with the required dependencies by running an SDK example such as the calculator.

If your setup is not working properly, the following sections will help you install any missing components.

USB drivers

Install USB drivers for Windows

Install USB drivers from QPM3 by running the following command from the command prompt:

qpm-cli --install qud

After successful installation of USB drivers, run the com_finder.py script to get the port number to which the device is attached. The script returns a message like the following example:

Qualcomm HS-USB Com ports found: COM6

If the following error message is returned instead:

No comm port found for Qualcomm HS-USB Device

Uninstall and reinstall the drivers. If the error persists, see the support instructions.

Install USB drivers for Linux

Qualcomm does not provide USB drivers to work with devices on Linux. Use the default Linux USB drivers on Ubuntu to connect the devices.

After installing ADB, adb logcat may not be able to connect to your device directly:

$ adb logcat
- waiting for device -

adb devices may also indicate that you do not have permission to access your device:

$ adb devices
List of devices attached
???? no permissions (user is not in the plugdev group);

These issues can be resolved with the instructions below:

Use the lsusb command to confirm that the device is actually connected:

$ lsusb
Bus 001 Device 006: ID 05c6:90db Qualcomm, Inc.

Ensure that udev rules are set correctly for access to the USB device. You can add udev rules to have the permissions of the device changed. Create or append to /etc/udev/rules.d/99-android.rules:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="90db", MODE="0666", OWNER="root", GROUP="plugdev", SYMLINK+="android%n"

For further information on udev refer to the man page.

ADB and fastboot

ADB and fastboot are required to work with Android devices. The following pages from the Android developer website describe the usage of ADB and how to configure Android devices.

To install ADB and fastboot on Linux, run the following commands:

wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip \platform-tools-latest-linux.zip
sudo cp platform-tools/adb /usr/bin/adb
sudo cp platform-tools/fastboot /usr/bin/fastboot

If you are still unable to see your device using adb devices, run the following commands:

adb kill-server
sudo adb start-server

SDK dependencies

The SDK installer should install all its dependencies. If the installer does not complete successfully or if errors are present when running the setup script, you might need to manually install some of these dependencies.

Available Dependencies

Component Description Key Windows Linux
CMake CMake is a cross-platform free and open-source software tool for managing the build process of software using a compiler-independent method. cmake Yes Yes
Devcon DevCon (Devcon.exe), the Device Console, is a command-line tool that displays detailed information about devices on computers running Windows. You can use DevCon to enable, disable, install, configure, and remove devices. devcon Yes No
Full Android NDK The Android NDK is a toolset that lets you implement parts of your app in native code, using languages such as C and C++. fullndk Yes Yes
Gnu on Windows Gnu On Windows (GoW) is the lightweight alternative to Cygwin. gow Yes No
Minimal Android NDK The minimal NDK is a lightweight version of the Android NDK that excludes unneeded APIs and toolchains. minimalndk Yes Yes
Python Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. python Yes No

Installing a Missing Dependency

A tool for installing missing dependencies has been provided at $SDK_ROOT/utils/scripts/SDKDependencyDownloader

Usage:

Windows:
    %HEXAGON_SDK_ROOT%\utils\scripts\SDKDependencyDownloader.exe --sdk_root %HEXAGON_SDK_ROOT% --d <key>

Linux:
    $HEXAGON_SDK_ROOT/utils/scripts/SDKDependencyDownloader --sdk_root $HEXAGON_SDK_ROOT --d <key>
NOTE: For the list of supported keys, refer to the table above.

Defining a Source to Install From

If you wish to download these dependencies from a custom location you may define the locations in a config file. The config file is a JSON-formatted file named "deps_overridejson.json" This file must be placed in %TEMP% for Windows or /tmp for Linux. This file allows users to specify local paths, network paths, or URLs to download each of the dependencies. An example format is provided below.

NOTE: There is no minimal Android NDK installer available for version Android NDK r25c.

Please use the paths mentioned in the next section to install android-ndk-r19c if required.

Windows

{
    "DependencyPaths" : {
        "7zexe" : "C:\\7-Zip\\7z.exe",
        "minimalandroidndk" : "D:\\sdk_deps\\android-ndk-r25c-windows.zip",
        "fullandroidndk" : "D:\\sdk_deps\\android-ndk-r25c-windows.zip",
        "gnuwin" : "D:\\sdk_deps\\gow-0.8.0.zip",
        "devcon" : "D:\\sdk_deps\\devcon.exe",
        "python" : "D:\\sdk_deps\\python-3.11.2-amd64.exe",
        "cmake" : "D:\\sdk_deps\\cmake-3.22.2-windows-x86_64.zip"
        }
}

Linux

{
    "DependencyPaths" : {
        "minimalandroidndk" : "/local/sdk/deps/android-ndk-r25c-linux.zip",
        "fullandroidndk" : "/local/sdk/deps/android-ndk-r25c-linux.zip",
        "cmake" : "/local/sdk/cmake-3.22.2-linux-x86_64.tar.gz"
        }
}
If you wish to download a single dependency from a custom location you may pass the location as an argument with --s as follows:

Usage:

Windows:
    %HEXAGON_SDK_ROOT%\utils\scripts\SDKDependencyDownloader.exe --sdk_root %HEXAGON_SDK_ROOT% --d <key> --s <custom_location>

Linux:
    $HEXAGON_SDK_ROOT/utils/scripts/SDKDependencyDownloader --sdk_root $HEXAGON_SDK_ROOT --d <key> --s <custom_location>

Available Online Sources for Dependencies

If you would like to download the dependencies yourself they are available at the locations below.

Windows
  • CMake : https://www.intrinsyc.com/hexagonsdk/windows/cmake-3.22.2-windows-x86_64.zip
  • Devcon : https://www.intrinsyc.com/hexagonsdk/windows/devcon.exe
  • Full Android NDK :
    android-ndk-r25c: https://www.lantronix.com/hexagonsdk/windows/android-ndk-r25c-windows.zip
    android-ndk-r19c: https://www.intrinsyc.com/hexagonsdk/windows/android-ndk-r19c-windows-x86_64.zip
  • GoW : https://www.intrinsyc.com/hexagonsdk/windows/gow-0.8.0.zip
  • Minimal Android NDK :
    android-ndk-r25c: Does not have minimal NDK
    android-ndk-r19c: https://www.intrinsyc.com/hexagonsdk/windows/minimal_android-ndk-r19c-windows-x86_64.zip
  • Python : https://www.intrinsyc.com/hexagonsdk/windows/python-3.11.2-amd64.exe
  • 7Zip : https://www.intrinsyc.com/hexagonsdk/windows/7z1900.msi
Linux
  • CMake : https://www.intrinsyc.com/hexagonsdk/linux/cmake-3.22.2-linux-x86_64.tar.gz
  • Full Android NDK :
    android-ndk-r25c: https://www.lantronix.com/hexagonsdk/linux/android-ndk-r25c-linux.zip
    android-ndk-r19c: https://www.intrinsyc.com/hexagonsdk/linux/android-ndk-r19c-linux-x86_64.zip
  • Minimal Android NDK :
    android-ndk-r25c: Does not have minimal NDK
    android-ndk-r19c: https://www.intrinsyc.com/hexagonsdk/linux/minimal_android-ndk-r19c-linux-x86_64.zip