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.
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:
-
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
- Windows:
-
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/
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 by running Setup.exe
from %HEXAGON_SDK_ROOT%\tools\debug\usb
.
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 |
Eclipse | Eclipse is an Integrated Development Environment (IDE) with an extensive suite of plugins that allow users to customize its functionality. | eclipse | Yes | Yes |
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 |
Libusb | Libusb is a C library that provides generic access to USB devices. It is intended to be used by developers to facilitate the production of applications that communicate with USB hardware. | libusb | No | Yes |
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/depDl.jar
Usage:
Windows:
%HEXAGON_SDK_ROOT%\tools\hexagon_ide\jre\bin\java.exe -jar %HEXAGON_SDK_ROOT%\utils\scripts\depDl.jar -c <key> -t %HEXAGON_SDK_ROOT%
Linux:
$HEXAGON_SDK_ROOT/tools/hexagon_ide/jre/bin/java -jar $HEXAGON_SDK_ROOT/utils/scripts/depDl.jar -c <key> -t $HEXAGON_SDK_ROOT
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 "hexSDKCFG.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
. However, the minimalandroidndk
key may still be used to specify the minimal version of the android-ndk-r19c
.
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",
"eclipse" : "D:\\sdk_deps\\eclipse_64.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",
"eclipse" : "/local/sdk/deps/eclipse-cpp-photon-R-linux-gtk-x86_64.tar.gz",
"libusb" : "/local/sdk/deps/libusb-1.0.so",
"cmake" : ""
}
}
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
- Eclipse : https://www.intrinsyc.com/hexagonsdk/windows/eclipse-cpp-photon-R-win32-x86_64.zip
- 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
- Eclipse : https://www.intrinsyc.com/hexagonsdk/linux/eclipse-cpp-photon-R-linux-gtk-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
- Libusb : https://www.intrinsyc.com/hexagonsdk/linux/libusb-1.0.so
- 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