├── BoardSpecs.md ├── CameraHelloWorld.md ├── CrossCompileSetup.md ├── DSPAL.md ├── DockerSetup.md ├── DroneGettingStarted.md ├── DspGettingStarted.md ├── DspHelloWorld.md ├── GettingStarted.md ├── HelloWorldCrossCompile.md ├── HelloWorldDocker.md ├── InstallPlatform.md ├── README.md ├── RosSoftware.md ├── TroubleshootFAQ.md ├── UGVGettingStarted.md ├── UserGuide.md ├── examples └── cross_compile │ ├── autotools │ ├── .gitignore │ ├── AUTHORS │ ├── COPYING │ ├── ChangeLog │ ├── Makefile.am │ ├── NEWS │ ├── README │ ├── bootstrap-cross.sh │ ├── bootstrap.sh │ ├── configure.ac │ └── src │ │ └── hello.c │ ├── cmake │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Makefile │ └── crossbuild │ │ └── Toolchain-arm-linux-gnueabihf.cmake │ └── src │ └── hello.c └── scripts ├── run_docker.sh └── sdk-fixup.sh /BoardSpecs.md: -------------------------------------------------------------------------------- 1 | # Qualcomm Flight Pro Specifications 2 | 3 | ## Main Board 4 | SoC 5 | - Qualcomm Snapdragon 820 (APQ8096) 6 | 7 | Memories: 8 | - DDR: SDHC 4 GB LPDDR4 9 | - UFS: 32 GB, UFS 2.0, HS-G3 1-Lane 10 | - SD Card: 4-bit microSD slot 11 | - Platform ID EEPROM: Serial Flash 12 | 13 | Sensors: 14 | - IMU (Gyroscope, Accelerometer, Compass): Dual Invensense MPU9250 15 | - Pressure sensor (Barometer): Bosch BMP280 16 | - Off-Board/External: I2C and UART on several connector interfaces for expansion. 17 | 18 | Connectivity 19 | - WLAN/BT/FM QCA6174A 802.11ac 2x2 20 | - NFA324 Module 21 | 22 | GPS: 23 | - Onboard: WGR7640 24 | - Offboard: SirfStarV CSRG0530 B02 25 | 26 | LEDs 27 | - RGB and discrete Red and Green LEDs for on-board status. 28 | 29 | Debugging: 30 | - Ethernet: Through USB ethernet adapter - see [here](TroubleshootFAQ.md#wired-ethernet-connection) for details 31 | - UART: Accessed on expansion connector 32 | - JTAG: Accessed on expansion connector 33 | 34 | ### Cameras 35 | One High Resolution camera 12.3MP IMX378 Sony sensor 36 | - 4K at 30 fps 37 | - Lite-on Module 4BCH05P1A 38 | - MIPI 4-lane CSI-0 39 | 40 | One Downward Facing Camera: OV7251 OmniVision sensor 41 | - B & W VGA Sensor 42 | - Sunny PJ103B module 43 | - MIPI 1+1-Lane CSI-2 44 | 45 | Two Stereo Cameras: OV7251 OmniVision sensor 46 | - B & W VGA Sensor 47 | - Sunny PJ103B module 48 | - MIPI 1-Lane CSI-1 49 | 50 | ## Additional Kit Components 51 | 52 | Advanced Power Module (APM) Cable: 53 | - Smart and advanced power supply converter board, configured into a cable, to connect power to Qualcomm Flight from either the provided 5V DC power supply or a 2S-6S LiPo battery (regulated to 5V). 54 | - The cable circuitry prioritizes the 5V DC external supply whenever present, and secondly the battery. 55 | - Concurrent use of 2S-6S battery and external DC supply connected to the APM cable is supported. 56 | 57 | Serial Console Adapter 58 | - Customer adapter to support standard Linux console interface 59 | 60 | Custom FTDI Debug Cable 61 | - Cable (only 3 pins instead of the 6 provided by FTDI) with standard-A type USB plug for connecting the serial console adapter to Qualcomm Flight. 62 | 63 | 5V DC power supply 64 | 65 | ## Software 66 | - Yocto OpenEmbedded-based build system 67 | - Linux kernel 3.18 68 | - Apps development through SDK (cross-compiler toolchain) and Docker container 69 | -------------------------------------------------------------------------------- /CameraHelloWorld.md: -------------------------------------------------------------------------------- 1 | # Camera Programming Documentation 2 | The camera programming APIs are provided by packages: 3 | - lib32-lib-robotics-camera 4 | ## Camera master APIs 5 | APIs to start/stop/configure the camera. 6 | The APIs allows only one application process to control one camera. That process is called master 7 | 8 | ## Camera subscriber APIs 9 | APIs to subscribe to fan-out frames from the same camera controlled by the master application. 10 | There could be multiple subscriber applications. 11 | 12 | The subscriber application cannot change any camera settings. 13 | If the master application stops the camera, all subscribers are notified 14 | 15 | ## Include path 16 | ### Master APIs 17 | - /usr/include/camera.h 18 | - /usr/include/camera_parameters.h 19 | ### Subscriber APIs 20 | - /usr/include/camera_subscriber.h 21 | - /usr/include/camera_subscriber_meta_data.h 22 | 23 | ## Link Path 24 | - /usr/lib/libcamera.so 25 | ## additional information 26 | - /usr/share/doc/camera/readme.md 27 | - /usr/share/doc/camera/pmd_tof_readme.md 28 | -------------------------------------------------------------------------------- /CrossCompileSetup.md: -------------------------------------------------------------------------------- 1 | # Cross Compilation with the Qualcomm Flight Pro SDK 2 | 3 | ## Setup the environment 4 | 5 | Install CMake 3.3.0 or higher and add it to your path. 6 | 7 | Set the environment variables: 8 | 9 | Set the location to where the SDK will be installed: 10 | export SDKROOT=\ 11 | ex. 12 | ```export SDKROOT=/local/mnt/workspace/excelsior-sdk``` 13 | 14 | Set the location of the SDK installer: 15 | export SDKINSTALLER=\ 16 | the location should be the directory where it has the SDK installer 17 | ex. if the location is /local/mnt/workspace/images/sdk/, it should contains 18 | ``` 19 | oecore-x86_64-aarch64-toolchain-nodistro.0.host.manifest 20 | oecore-x86_64-aarch64-toolchain-nodistro.0.target.manifest 21 | oecore-x86_64-aarch64-toolchain-nodistro.0.sh 22 | ``` 23 | Set the following environment variable: 24 | ```export SDKINSTALLER=/local/mnt/workspace/images/sdk``` 25 | 26 | ## Installing the SDK 27 | 28 | The SDK is part of the latest release builds 29 | ``` 30 | mkdir ${SDKROOT} 31 | ${SDKINSTALLER}/oecore-x86_64-aarch64-toolchain-nodistro.0.sh -y -D -d ${SDKROOT} 32 | source ./scripts/sdk-fixup.sh ${SDKROOT} 33 | ``` 34 | 35 | The scripts to set the environment are incorrect for multiarch in Yocto Jethro. A new script is created named _environment-setup-armv7a-vfp-oemllib32-linux_ that is consistent with the toolchain. 36 | The sdk-fixup.sh script creates this file. 37 | 38 | 39 | ## Setup workspace environement for building 32-bit applications 40 | The current SDK only supports building 32-bit application. 41 | 42 | ```. ${SDKROOT}/environment-setup-armv7a-vfp-oemllib32-linux``` 43 | OR 44 | ```source ${SDKROOT}/environment-setup-armv7a-vfp-oemllib32-linux``` 45 | 46 | 47 | ## Test the environment 48 | 49 | ### CMake 50 | Install CMake and add it to your path. 51 | ``` 52 | cd examples/cross_compile/cmake 53 | make cross 54 | ``` 55 | 56 | ### Autotools 57 | ``` 58 | cd examples/cross_compile/autotools 59 | ./bootstrap-cross.sh 60 | make 61 | ``` 62 | -------------------------------------------------------------------------------- /DSPAL.md: -------------------------------------------------------------------------------- 1 | # DSPAL 2 | This guide assumes that the steps in [Getting Started](DspGettingStarted.md) have already been completed. 3 | 4 | The Qualcomm Flight Pro platform so far only uses the SLPI DSP. 5 | All key programming concepts of tools of Hexagon DSP applies here too 6 | 7 | The DSP Abstraction Layer (DSPAL) provides a mostly POSIX compliant 8 | interface to ease the porting of code from Linux or another POSIX 9 | compliant OS to the Hexagon DSP. 10 | 11 | ## Using DSPAL 12 | 13 | The header file for DSPAL are maintained at: http://github.com/ATLFlight/dspal 14 | 15 | Support for DSPAL is built into the DSP image for Qualcomm Flight Pro. These files are available as part of the software available from Intrinsyc. 16 | 17 | The DSP files are located in /lib/firmware in the rootfs installed on the Qualcomm Flight Pro board. 18 | 19 | ``` 20 | # cd /lib/firmware 21 | # ls slpi* 22 | slpi.b00 slpi.b01 slpi.b02 slpi.b03 slpi.b04 slpi.b05 slpi.b06 slpi.b07 slpi.b08 slpi.b09 23 | slpi.mdt slpir.jsn 24 | ``` 25 | 26 | New versions of DSPAL may require updated DSP images. 27 | 28 | DriverFramework includes dspal as a submodule so you generally do not need to build dspal directly unless you wish to run the test SW. 29 | 30 | ## Building the test SW 31 | 32 | ``` 33 | git clone https://github.com/ATLFlight/dspal 34 | cd dspal/test 35 | make QC_SOC_TARGET=APQ8096 36 | make QC_SOC_TARGET=APQ8096 load 37 | ``` 38 | 39 | ### Checking the DSP SW version 40 | 41 | There is a utility to check the version of the DSP SW. 42 | 43 | Connect the Qualcomm Flight Pro board via micro USB connector for ADB. 44 | 45 | Then get a shell on the device: 46 | 47 | ``` 48 | adb shell 49 | # cd /home/linaro 50 | # ./version_test 51 | # exit 52 | ``` 53 | 54 | Amongst the debug output you should see something like: 55 | 56 | ``` 57 | version: DSPAL_VERSION_STRING=DSPAL-1.0.1.0001 58 | build date: BUILD_DATE_STRING=Feb 2 2016 59 | build time: BUILD_TIME_STRING=19:10:21 60 | ``` 61 | 62 | ### Running the DSPAL Unit Tests 63 | 64 | Part of the test SW is a DSPAL unit test. You will need to run mini-dm 65 | to see the output from the DSP. 66 | 67 | In a new terminal, run: 68 | ``` 69 | ${HEXAGON_SDK_ROOT}/tools/debug/mini-dm/Linux_Debug/mini-dm 70 | ``` 71 | 72 | To run the unit test: 73 | 74 | ``` 75 | adb shell 76 | # cd /home/linaro 77 | # ./dspal_tester 78 | # exit 79 | ``` 80 | -------------------------------------------------------------------------------- /DockerSetup.md: -------------------------------------------------------------------------------- 1 | A docker image will be provided in order to enable apps development for the Qualcomm Flight Pro platform. 2 | 3 | ## Download 4 | The docker image is NOT yet available for download. It will be available *later*. 5 | 6 | ## Setup 7 | This section will describe how to setup the docker container for apps development WHEN it is available. 8 | 9 | ## Usage 10 | To develop apps using the docker image, please see [Building Hello World in a Docker](HelloWorldDocker.md). 11 | 12 | ## Troubleshooting and FAQ 13 | - Remove running docker containers 14 | ``` 15 | docker ps -a 16 | docker stop 17 | ``` 18 | - Clean up local docker images 19 | ``` 20 | docker image list 21 | docker rmi 22 | ``` 23 | - List all containers (only IDs) ```docker ps -aq``` 24 | - Stop all running containers. ```docker stop $(docker ps -aq)``` 25 | - Remove all containers. ```docker rm $(docker ps -aq)``` 26 | - Remove all images. ```docker rmi $(docker images -q)``` 27 | - BAD_CREDENTIAL error when pulling down the docker image from the URL 28 | ``` 29 | docker pull 30 | Using default tag: latest 31 | Error response from daemon: Get https:////manifests/latest: unauthorized: BAD_CREDENTIAL 32 | ``` 33 | Solution: Logout and then login again: 34 | ``` 35 | docker logout atl-docker.qualcomm.com 36 | docker login atl-docker.qualcomm.com 37 | docker pull / 38 | ``` 39 | 40 | ## References 41 | - Switching docker workspaces: https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux 42 | - Start, stop and restart docker: https://github.com/boot2docker/boot2docker/issues/782 43 | - http://blog.baudson.de/blog/stop-and-remove-all-docker-containers-and-images 44 | -------------------------------------------------------------------------------- /DroneGettingStarted.md: -------------------------------------------------------------------------------- 1 | ## Build your own drone 2 | An almost ready-to-fly drone kit compatible with Qualcomm Flight Pro™ and [Qualcomm Navigator](https://developer.qualcomm.com/software/qualcomm-navigator)™ called the [Dragon Drone Development Kit](https://worldsway.com/product/dragon-drone-development-kit) is now available. See [this post](https://developer.qualcomm.com/forum/qdn-forums/hardware/snapdragon-flight/34688) for more information. This is the *recommended* option. 3 | 4 | Please refer to [snav_vehicle](https://github.com/ATLFlight/snav_vehicles) for SNAV params and ESC flashing instructions. 5 | 6 | If you're using ROS, [qflight_descriptions](https://github.com/ATLFlight/qflight_descriptions) has URDFs for the different drone configurations. Use "board=sdf_pro" for the Qualcomm Flight Pro board. 7 | 8 | Also make sure to look at the open source ROS software that supports the Qualcomm Flight Pro: [ROS Software](RosSoftware.md) 9 | -------------------------------------------------------------------------------- /DspGettingStarted.md: -------------------------------------------------------------------------------- 1 | # Getting Started on Hexagon DSP Application Development 2 | Refer to https://github.com/ATLFlight/ATLFlightDocs/blob/master/DevEnvSetup.md 3 | 4 | -------------------------------------------------------------------------------- /DspHelloWorld.md: -------------------------------------------------------------------------------- 1 | # Hello World 2 | 3 | The following instructions describe how to compile and run a hello world program on the Hexagon DSP. 4 | 5 | This guide assumes that the steps in [Getting Started](DspGettingStarted.md) have already been completed. 6 | 7 | Clone the [HelloWorld project](https://github.com/ATLFlight/HelloWorld) 8 | Follow the instructions in its README.md to build and run the test app. 9 | 10 | 11 | -------------------------------------------------------------------------------- /GettingStarted.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Qualcomm Flight Pro 2 | 3 | This page provides information on setting up your Qualcomm Flight Pro™ kit. 4 | * Create a support account [here](https://support.intrinsyc.com) 5 | * Login to the support account, navigate to the Qualcomm Flight Pro portal and follow the steps therein to get started. 6 | * Install the latest platform BSP using the instructions 7 | * Refer to the relevant sections in [the documentation](README.md) to accomplish a desired task 8 | -------------------------------------------------------------------------------- /HelloWorldCrossCompile.md: -------------------------------------------------------------------------------- 1 | 2 | Please refer to: 3 | [Setting up cross compilation](CrossCompileSetup.md) 4 | At the end of the setup steps, it gives instructions to build a hello world. The sample code and make files are in sub-directory examples/cross_compile. 5 | -------------------------------------------------------------------------------- /HelloWorldDocker.md: -------------------------------------------------------------------------------- 1 | # Using the Qualcomm Flight Pro Docker SDK for development 2 | 3 | ** NOTE: The docker image that is required to build apps for the Qualcomm Flight Pro NOT YET available. Please return to this page later. ** 4 | 5 | The docker container is an alternative to building on target. It allows for native ARM SW builds in an emulated environment. 6 | 7 | Table of Contents 8 | ================= 9 | - [Run docker image](#run-docker-image) 10 | - [Build hello example](#build-hello-example) 11 | - [Download to target](#download-to-target) 12 | - [Query and update packages](#query-and-update-packages) 13 | - [Common docker commands](#common-docker-commands) 14 | 15 | ## Run docker image 16 | 17 | Make sure you are running Ubuntu 16.04 or 14.04 with the kernel updated to the Xenial kernel (see [here](https://wiki.ubuntu.com/Kernel/LTSEnablementStack#Ubuntu_14.04_LTS_-_Trusty_Tahr)). 18 | 19 | ``` 20 | ./scripts/run_docker.sh ${docker-image-url-or-path} 21 | ``` 22 | 23 | The above command will: 24 | - Pull the docker image 25 | - Create a home directory named sdk_home in the current directory and map it as the home directory inside the container 26 | - Map the scripts directory to /opt/scripts directory inside the container (There is a script here to add the host addresses to the /etc/hosts file) 27 | - Create an interactive bash inside the docker. 28 | 29 | The container will run as the same user ID that invoked the command above. 30 | 31 | The container will run /bin/bash and anything that is created in the home directory will be accessible in the future. Data stored elsewhere will be purged when the container exits. 32 | 33 | If you run uname you will see that the Docker container is running an ARM userspace: 34 | ``` 35 | uname -a 36 | ``` 37 | 38 | ## Build hello example inside the docker shell 39 | 40 | The examples directory is mapped to /opt/examples in the Docker image. 41 | 42 | ### CMake 43 | To build the cmake example: 44 | ``` 45 | cd /opt/examples/cross_compile/cmake 46 | rm -rf build 47 | mkdir build 48 | cd build 49 | cmake .. 50 | make 51 | ``` 52 | 53 | ### Autotools 54 | _NOTE_ The SDK does not yet support native autotools. 55 | 56 | To build the autotools example: 57 | 58 | ``` 59 | cd /opt/examples/cross_compile/autotools 60 | ./bootstrap.sh 61 | make 62 | ``` 63 | 64 | ## Download to target 65 | 66 | First copy the files from docker to Linux home directory (sdk_home). 67 | ``` 68 | cd /opt 69 | cp -r examples/cross_compile ~/. 70 | ``` 71 | 72 | Next, connect the Qualcomm Flight Pro board to the computer via USB. Next steps will push files from Linux home directory to Excelsior using adb. 73 | 74 | In the hello example there is only one file each to upload for cmake: 75 | ``` 76 | cd sdk_home/cross_compile/cmake/build 77 | adb devices 78 | adb push hello /home/root/hello_cmake 79 | ``` 80 | 81 | Similarly for autotools 82 | 83 | ``` 84 | cd sdk_home/cross_compile 85 | adb push autotools /home/root/hello_autotools 86 | ``` 87 | 88 | You can now open a terminal and access shell on the target (Qualcomm Flight Pro board) and run the files. 89 | ``` 90 | adb shell 91 | cd /home/root 92 | ./hello_cmake 93 | ./hello_autotools 94 | ``` 95 | 96 | ## Common docker commands 97 | ``` docker image list ``` 98 | ``` docker image rm ``` 99 | 100 | To pull down a docker image: 101 | ```docker pull atl-docker.com/project/excelsior/:latest``` 102 | For example: 103 | ```docker pull atl-docker.com/project/excelsior/excelsior-arm-sdk-sprint130:latest``` 104 | 105 | -------------------------------------------------------------------------------- /InstallPlatform.md: -------------------------------------------------------------------------------- 1 | Your board should already have a working version of the latest Qualcomm Flight Pro platform BSP images. 2 | 3 | If you need to download and install the latest images, please visit our partner's [support site](https://support.intrinsyc.com). 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Qualcomm Flight Pro Documentation 2 | 3 | These pages provide information on how to use the Qualcomm Flight Pro™ (820) platform including setup, various software components and more. 4 | 5 | ## Table of Contents 6 | 7 | 1. [Board Specifications](BoardSpecs.md) 8 | 1. [Getting Started](GettingStarted.md) 9 | 1. [With a Drone](DroneGettingStarted.md) 10 | 1. [With a Ground Vehicle](UGVGettingStarted.md) 11 | 1. [User Guide](UserGuide.md) 12 | 1. Developer Guide 13 | 1. Setup 14 | 1. [Installing a Platform Image](InstallPlatform.md) 15 | 1. [Setting up cross compilation](CrossCompileSetup.md) 16 | 1. [Setting up a board emulation Docker](DockerSetup.md) 17 | 1. Building Apps 18 | 1. [Building Hello World in a Docker](HelloWorldDocker.md) 19 | 1. [Building Hello World via Cross Compilation](HelloWorldCrossCompile.md) 20 | 1. [Develop a Camera Application](CameraHelloWorld.md) 21 | 1. Libraries/SDKs 22 | 1. [Machine Vision SDK](https://developer.qualcomm.com/hardware/snapdragon-flight/machine-vision-sdk) 23 | 1. [Qualcomm Navigator SDK](https://developer.qualcomm.com/hardware/snapdragon-flight/sd-navigator) 24 | 1. [Working with ROS](ROS.md) 25 | 1. DSP development (Real-time I/O, Flight Control) 26 | 1. [Getting Started](DspGettingStarted.md) 27 | 1. [Hello World](DspHelloWorld.md) 28 | 1. [DSPAL](DSPAL.md) 29 | 1. Example applications 30 | 1. [ROS Software](RosSoftware.md) - links to ROS packages and other examples 31 | 1. [DFS ROS example](https://github.com/ATLFlight/dfs-ros-example) 32 | 1. [Drone Controller Android Application](https://github.com/ATLFlight/drone-controller) 33 | 1. [Troubleshooting and FAQ](TroubleshootFAQ.md) 34 | 35 | ## License 36 | Content: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), © 2018 Michael Shomin, Bharath Ramaswamy, James Wilson, Liang Zhang 37 | -------------------------------------------------------------------------------- /RosSoftware.md: -------------------------------------------------------------------------------- 1 | # Qualcomm Flight Pro ROS Software 2 | 3 | Nearly all of the ROS packages released for Qualcomm Flight are compatible with Qualcommm Flight Pro. You simply need to add a cmake variable to your build command inside the docker container. 4 | 5 | ``` 6 | catkin_make -DCMAKE_BUILD_TYPE=Release -DQC_SOC_TARGET=APQ8096 install 7 | ``` 8 | 9 | inside your development docker container. Note that you'll have to run ```source /opt/ros/indigo/setup.bash``` and also ```source devel/setup.bash``` after generating your msh headers (the first run of catkin_make). 10 | 11 | 12 | Compatible packages: 13 | * Vision Packages 14 | * [snap_cam_ros](https://github.com/ATLFlight/snap_cam_ros) 15 | * [snap_dfs](https://github.com/ATLFlight/dfs-ros-example) 16 | * [snap_vio](https://github.com/ATLFlight/snap_vio) 17 | * [snap_msgs](https://github.com/ATLFlight/snap_msgs) 18 | * [snap_cpa](https://github.com/ATLFlight/snap_cpa) 19 | * [snap_cam_manager](https://github.com/ATLFlight/snap_cam_manager) (ROS-independent) 20 | * Other packages 21 | * [snap_imu](https://github.com/ATLFlight/snap_imu) 22 | * [qflight_descriptions](https://github.com/ATLFlight/qflight_descriptions) 23 | * [snav_ros](https://github.com/ATLFlight/snav_ros) 24 | * [snav_msgs](https://github.com/ATLFlight/snav_msgs) 25 | * [snav_fci](https://github.com/ATLFlight/snav_fci) 26 | -------------------------------------------------------------------------------- /TroubleshootFAQ.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting and FAQs 2 | This page provides answers to common questions, solutions to common problems and other how-tos for the Qualcomm Flight Pro™. 3 | 4 | 1. [Host computer requirements](#host-computer-requirements) 5 | 1. [Revive board that will not boot](#revive-board-that-will-not-boot) 6 | 1. [Serial console adapter board](#serial-console-adapter-board) 7 | 1. [Older versions](#older-versions) 8 | 1. [Pin compatibility issues](#pin-compatibility-issues) 9 | 1. [apt-get does not work](#apt-get-does-not-work) 10 | 1. [Install OpenCV](#install-opencv) 11 | 1. [WiFi network connection](#wifi-network-connection) 12 | 1. [Wired ethernet connection](#wired-ethernet-connection) 13 | 1. [USB3 cable](#usb3-cable) 14 | 1. [USB-to-serial debug cable](#usb-to-serial-debug-cable) 15 | 1. [Debugging ADB problems](#debugging-adb-problems) 16 | 1. [Unable to flash platform BSP](#unable-to-flash-platform-bsp) 17 | 1. [Debugging IMU issues](#debugging-imu-issues) 18 | 1. [GPS support](#gps-support) 19 | 1. [Build your own drone](#build-your-own-drone) 20 | 1. [Change root login](#change-root-login) 21 | 1. [Find platform version](#find-platform-version) 22 | 23 | ## Host computer requirements 24 | A host PC running Ubuntu 14.04 Linux is recommended for building code, debugging and testing the Qualcomm Flight Pro™ board (newer versions of the host OS may work too but have not been tested or officially supported). 25 | 26 | ## Revive board that will not boot 27 | If your Qualcomm Flight Pro™ board does not boot up, you may be able to recover it as follows: 28 | 29 | If your board gets bricked, the SD card recovery method may work IF the partitions are untouched. 30 | 31 | To create the recovery SD card, please do the following: 32 | - Download the SD card image from the [support site](https://www.intrinsyc.com/contact-support). 33 | - Insert an 8G MicroSD card into its adapter. 34 | - Insert the adapter into an an SD card reader. 35 | - Plug the SD card reader into a Linux PC. 36 | - Determine the ```/dev/sd*``` device corresponding to your SD card. 37 | - Flash the image to the SD card: 38 | ```sudo dd if=singleimage.bin of=``` 39 | 40 | EXAMPLE: ```sudo dd if=singleimage.bin of=/dev/sdx``` 41 | 42 | *WARNING* Use the correct /dev/sd* device for your system otherwise you may overwite your hard drive! 43 | 44 | - Once the image is flashed, power off the target. 45 | - Insert the MicroSD card into the Qualcomm Flight Pro MicroSD card slot and power it back on. 46 | - This should put the device into fastboot, and you can now flash a build. 47 | - Run the following command and ensure that your device appears in the list: 48 | ```fastboot devices``` 49 | - Remove the SD card before proceeding further. 50 | 51 | *NOTE:* If the above option does not work, please contact [support](https://www.intrinsyc.com/contact-support) to get it reflashed. 52 | 53 | ## Serial console adapter board 54 | The serial console adapter board and cable are available as part of the [Qualomm Flight Pro™ developer's edition](https://shop.intrinsyc.com/products/qualcomm-flight-pro-development-kit). This allows the board to be accessed through a USB connector for debugging purposes. It also provides jumpers to force the board in fastboot and other special modes if necessary. 55 | 56 | ### Older versions 57 | Some customers may have received an older deprecated version of the serial console adapter board does not include the fastboot jumper support. Please look at the MCN printed on the board to identify it: 58 | - 25-H9563 - Older serial console board, it does not include the fastboot jumper pins 59 | - 25-H9916 - New serial console board, it includes the fastboot jumper pins (J4) 60 | 61 | If you have the older version, please contact [support](https://www.intrinsyc.com/contact-support) to get the newer Serial Console Adapter board. 62 | 63 | ### Pin compatibility issues 64 | Some serial console adapter parts have all 4 pins on the header whereas they should only have 3. If you have such a part, please *clip pin 2* on the header. This allows the FTDI serial cable to be inserted in only 1 way as below: 65 | 66 | Pin 1 (TXD) Orange 67 | Pin 3 (RXD) Yellow 68 | Pin 4 (GND) Black 69 | 70 | ## apt-get does not work 71 | apt-get is NOT supported on this platform. To install new packages, you need to build them in a docker container *when* it is available (see [this page](HelloWorldDocker.md) for details). 72 | 73 | ## Install OpenCV 74 | The procedure to build and install OpenCV *will be provided later*. 75 | 76 | ## WiFi network connection 77 | 78 | ### Station mode 79 | Update the ```/data/misc/wifi/wpa_supplicant.conf``` file on target to connect to the WiFi network of your choice. 80 | 81 | To set wifi to station mode and camp on the WiFi network: 82 | ```$ atl-wifi-mode.sh station ``` 83 | OR 84 | ```$ echo sta > /data/misc/wifi/wlan_mode``` 85 | 86 | Reboot the target and check the network configuration: 87 | ``` 88 | $ systemctl reboot 89 | $ ifconfig wlan0 90 | ``` 91 | 92 | You should now see a DHCP-assigned IP address. 93 | 94 | ### Soft AP mode 95 | This is the default mode. To connect to the default SSID on target, look for "QSoftAP" on the available wireless connections from your host PC/device and click Connect using password: ```1234567890```. 96 | 97 | To set WiFi to softAP mode and connect to a certain SSID: 98 | ``` 99 | $ atl-wifi-mode.sh softap [optional-ssid] 100 | $ systemctl reboot 101 | ``` 102 | Update the "ssid" in the ```/data/misc/wifi/sta_mode_hostapd.conf``` file on target to an identifiable string. 103 | ``` 104 | $ echo softap > /data/misc/wifi/wlan_mode 105 | $ systemctl reboot 106 | ``` 107 | Check the network configuration 108 | ```$ ifconfig wlan0``` 109 | You should now see the IP address as 192.168.1.1 and be able to connect to the soft AP from a host PC or device. 110 | 111 | ### Antenna 112 | A WiFi antenna is NOT included in the kit. It needs be purchased (ex. [Molex part# 146153-0150](http://www.molex.com/molex/products/datasheet.jsp?part=active/1461530150_ANTENNAS.xml)) and installed. See [here](UserGuide.md#wifi-control) for installation and setup. 113 | 114 | ## Wired ethernet connection 115 | The board can be connected to the network over a wired connection via the OTG USB port by using a USB Ethernet adapter (such as http://www.apple.com/shop/product/MC704LL/A/apple-usb-ethernet-adapter OR Linksys USB 3.0 Gigabit Ethernet Adapter - model USB3GIGV1) along with a USB 2.0 Female to Micro USB Male OTG adapter (such as http://www.rakuten.com/prod/268480078.html). 116 | 117 | ## USB3 cable 118 | Any standard USB micro-B cable may be used with the board. But in order to get USB 3.0 SuperSpeed functionality, one requires a MICRO-A PLUG TO STD-A cable (such as the Amphenol RUB30-0075 http://www1.amphenol-ast.com/v3/en/product_view.aspx?id=189). 119 | 120 | ## USB-to-serial debug cable 121 | The USB-to-Serial Debug Cable that plugs into the Serial Console Adapter is the TTL-232R-3V3 part from FTDI modified to be 4-pins and keying added to prevent incorrect insertion. For more information, see http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf. 122 | 123 | ## Debugging ADB problems 124 | - Verify that the Qualcomm Flight Pro target is listed when you type ```adb devices``` on the host computer? 125 | - Do ```ls -l /etc/udev/rules.d``` and check for the existance of the 51-android.rules file. 126 | - Verify that the following lines are present in your ```/etc/udev/rules.d/51-android.rules``` file? If not, add them and try again. 127 | ``` 128 | #for Device adb interface 129 | SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev" 130 | #for Fastboot bootloader interface 131 | SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" 132 | ``` 133 | - Do ```lsusb``` on the host PC after the Qualcomm Flight Pro board is connected and powered up. You must see an entry for the target (usually listed as ```Qualcomm, Inc. Qualcomm HSUSB Device```). 134 | - Do ```adb kill-server``` and then ```adb start-server``` and try again? 135 | - If none of this works, verify that adb is functional on your host computer by connecting a phone or other device. 136 | - Try replacing the cable. Sometimes the microUSB 3.0 cable does not work, and you might need a microUSB 2.0 cable. 137 | 138 | ## Unable to flash platform BSP 139 | Information will be available *later*. 140 | 141 | ## Debugging IMU issues 142 | Do the following steps if you experience issues that may be due to IMU data. This is a test utility to verify that IMU data is being received correctly. 143 | 144 | On the host machine via a separate terminal (*optional*): 145 | ``` ${HEXAGON_SDK_ROOT}/tools/mini-dm/Linux_Debug/mini-dm ``` 146 | 147 | On the target: 148 | 149 | ```shell 150 | cd /home/root 151 | 152 | # Run the imu_app (in the background) 153 | ./imu_app & 154 | 155 | # Run the sensor_imu_tester app for 'n' seconds 156 | ./sensor_imu_tester 157 | ## It should run and then say "test completed..." 158 | ## It should log the IMU data in a file called IMU-*.txt 159 | 160 | # Stop the imu_app 161 | VAR=$(ps -eaf | grep imu_app | grep -v grep | awk '{print $2}' | cut -d' ' -f2); kill $VAR 162 | ``` 163 | 164 | If the IMU_*.txt file was not created or the IMU data in it does not look correct, please try the following: 165 | - Ensure that you installed the latest versions platform BSP from [here](http://support.intrinsyc.com). 166 | - Post your issue on the [QDN forum](https://developer.qualcomm.com/forums/hardware/qualcomm-flight-pro) with a snippet of the target console log as well as the log from mini-dm. 167 | 168 | ## GPS support 169 | Information will be available *later*. 170 | 171 | ## Build your own drone 172 | An almost ready-to-fly drone kit compatible with Qualcomm Flight Pro™ and [Qualcomm Navigator](https://developer.qualcomm.com/hardware/snapdragon-flight/sd-navigator)™ called the [Dragon Drone Development Kit](https://worldsway.com/product/dragon-drone-development-kit) is now available. See [this post](https://developer.qualcomm.com/forum/qdn-forums/hardware/snapdragon-flight/34688) for more information. This is the *recommended* option. 173 | 174 | ## Change root login 175 | Information to accomplish this will be available *later*. 176 | 177 | ## Find platform version 178 | To find out the platform BSP version, type the following on target: 179 | ```version``` 180 | 181 | -------------------------------------------------------------------------------- /UGVGettingStarted.md: -------------------------------------------------------------------------------- 1 | # Ground Vehicles 2 | 3 | The following information documents the provisioning of a Turtlebot 2 as a ground vehicle reference platform. 4 | 5 | 6 | 7 | ## Getting Started with the Turtlebot2 Ground Vehicle 8 | ### Hardware 9 | You'll need the following pieces of hardware to begin. For the peripherals such as hub and usb cables, the links show the actual parts used in the prototype system. However, other parts may also be suitable. 10 | 11 | - [Turtlebot 2 Core Kit](https://dabit.industries/products/turtlebot-2-core-kit) 12 | - [Qualcomm Flight Board](https://shop.intrinsyc.com/collections/product-development-kits/products/) 13 | - [Micro USB Male to USB OTG cable](https://www.startech.com/Cables/USB-2.0/USB-Adapters/5in-Micro-USB-to-USB-OTG-Host-Adapter-Male-to-Female~UUSBOTG) 14 | - [USB Hub](https://www.monoprice.com/product?c_id=103&cp_id=10307&cs_id=1030702&p_id=6631&seq=1&format=2) 15 | - Molex Power Cable for Board 16 | 17 | The following guidelines will provide assembly instructions for the Turtlebot and Qualcomm Flight Board. If not explicitly mentioned, it is best to secure the components since this will be a moving platform. Double sided tape can be used if there is no way to use the mounting holes in the platform. 18 | 19 | #### Turtlebot and Qualcomm Flight Board Assembly 20 | Assemble the plates and 3D depth sensor with the base as presented in the [Turtlebot 2 Core Kit](https://dabit.industries/products/turtlebot-2-core-kit). Mount the Qualcomm Flight Board somewhere on the plates. The installation documented here does not use the tracking camera. If you plan to integrate a solution to use the tracking camera, then it may be best for the Qualcomm Flight Board to be mounted on the top plate so that the tracking camera has visibility to its surroundings. 21 | 22 | #### Power Assembly 23 | Secure and connect the Qualcomm Flight Board power adapter (APM) to the board. Use the Molex Power Cable for the Qualcomm flight board to get power from the 12V@5A Molex connection found on the base of Kobuki. Consult the [Turtlebot user guide](https://docs.google.com/document/d/15k7UBnYY_GPmKzQCjzRGCW-4dIP7zl_R_7tWPLM0zKI/edit) for additional information. 24 | 25 | #### Peripheral Assembly 26 | Next, setup the USB Hub to connect peripheral devices to the Qualcomm Flight Board. Connect the micro USB OTG cable to the female USB connection on the board. Connect the USB Hub to the OTG cable. The USB cable that comes with the Turtlebot base is connected to the Kobuki and the USB Hub. Connect the USB cable from the Orbbec Astra to the USB Hub. 27 | 28 | ### Platform Image 29 | 30 | Make sure that you have the most up-to-date platform. Instructions can be found [here](https://github.com/ATLFlight/QFlightDocs/blob/master/PlatformGettingStarted.md). 31 | 32 | Many of the steps require the use of adb ([Android Debug Bridge](https://developer.android.com/studio/command-line/adb.html)) for communication via usb. Make sure that your Qualcomm Flight board is connected via usb and that you have adb installed. 33 | 34 | 35 | ## Provisioning Turtlebot2 36 | 37 | This setup will utilize existing ROS packages for the Turtlebot. For background, see common Turtlebot2 bringup tutorials [here](http://wiki.ros.org/turtlebot_bringup/Tutorials) and select the "Indigo" version. 38 | 39 | The core installation will provide mapping and navigation using the Kobuki wheel encoder and Astra sensor. Extended installations may use the tracking camera for position. 40 | 41 | ### Building the Docker Image 42 | 43 | To provide the packages needed for Turtlebot2, this must be built into the image. 44 | See [Docker Setup](https://github.qualcomm.com/ATLFlight/QFlightProDocs/blob/develop/DockerSetup.md) for information on the process to include additional source and build procedure for the docker image. 45 | -------------------------------------------------------------------------------- /UserGuide.md: -------------------------------------------------------------------------------- 1 | # Qualcomm Flight Pro User Guide 2 | This page provides useful information about the Qualcomm® Flight Pro™ Kit (Developer's edition) available [here](https://shop.intrinsyc.com/products/qualcomm-flight-pro-development-kit). The Qualcomm® Flight Pro™ is a highly integrated second-generation board based on a Qualcomm® Snapdragon™ 820 series processor that targets consumer drones and robotics applications. 3 | 4 | # Table of Contents 5 | 1. [Target Access](#target-access) 6 | - [ADB](#adb) 7 | - [SSH](#ssh) 8 | 1. [Logging](#logging) 9 | - [Apps processor](#apps-processor) 10 | - [SLPI](#slpi) 11 | 1. [Camera](#camera) 12 | 1. [Camera Frame Fan-out](#camera-fan-out) 13 | 1. [ToF](#tof) 14 | 1. [Useful utilities](#useful-utilities) 15 | 1. [Acronyms and abbreviations](#acronyms-and-abbreviations) 16 | 1. [Additional references](#additional-references) 17 | 18 | ## Target Access 19 | 20 | ### ADB 21 | Information will be available *later*. 22 | 23 | ### SSH 24 | To login to the board and run the commands remotely, do the following: 25 | - Ensure that the target and host computer are connected to the same network. 26 | - Determine the IP address of the target. 27 | - Run the following commands to ssh to the device: 28 | ```$ ssh root@``` 29 | Enter the password (oelinux123) when prompted. 30 | 31 | ## Logging 32 | 33 | ### Apps processor 34 | 35 | ### Logging 36 | - For logging from userspace modules, please use adb logcat. 37 | ```adb logcat -v time | tee .log``` 38 | - For logging from kernel modules, you can use the serial console or adb shell dmesg. 39 | ```adb shell dmesg``` 40 | 41 | ### Serial console 42 | The serial console baud rate is 115200. On Linux, you can use the "screen" or miniterm. Look at /dev/ttyUSBx to find the serial port. For instance: 43 | ```$ sudo miniterm.py /dev/ttyUSB0 115200``` 44 | 45 | When prompted, enter the username as "root" and password as "oelinux123". 46 | 47 | ### SLPI 48 | Information will be available *later*. 49 | 50 | ### Fan control 51 | A fan could be installed as follows that helps in cooling the CPU and helps in avoiding CPU frequencies to be limited and/or CPU to be overheated: 52 | - Connect the 5V fan to J6 on the Qualcomm Flight Pro board. 53 | - After bootup, run following commands: 54 | ``` 55 | $ echo 0 > /sys/class/pwm/pwmchip0/export 56 | $ echo 50000 > /sys/class/pwm/pwmchip0/pwm0/period 57 | $ echo 25000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle 58 | Fan ON 59 | $ echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable 60 | Fan OFF 61 | $ echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable 62 | ``` 63 | 64 | #### Serial console logging 65 | 66 | ## Camera 67 | The Camera API test application (camera-test) may be used to dump frames from any of the installed cameras. For more on how to use this application and the various options, do the following on target: ```camera-test -h``` 68 | 69 | ### Take a picture 70 | To get images from the hi-resolution camera: 71 | ```camera-test -f hires -t 10 -d 30 -s 1080p -b 2``` 72 | 73 | To get images from the tracking (optical flow) camera: 74 | ```camera-test -Z 1 -f tracking -o 0 -t 10 -d 30``` 75 | 76 | 77 | ### Record video 78 | Run one of the following command(s) to record video: 79 | ```recorder_gtest --gtest_filter=RecorderGtest.SessionWith1080p60fpsEncTrack``` 80 | ```recorder_gtest --gtest_filter=RecorderGtest.SessionWith1080p60fps480p30fpsSnapshotEncTrack``` 81 | 82 | The output files would become available at ```/data/misc/qmmf/```. 83 | 84 | ### View FPV video stream 85 | Information will be available *later*. 86 | 87 | ### Use cases 88 | Information will be available *later*. 89 | 90 | ## Camera fan out 91 | The camera library actuall provides two set of APIs, the first set of APIs are called master APIs, the application that invokes them has 92 | the full control of the camera, including setting parameters. For example, test application camera-test uses master APIs. The master APIs 93 | are in /usr/include/camera.h 94 | 95 | However, while the app using master APIs is running, if other applications want to have read-only access to the frames produced by the same camera, they may use the second set of APIs, the subscriber APIs. ( /usr/include/camera_subscriber.h ) 96 | The test app camera-subscriber-test uses those APIs 97 | Example: first start the master app on hires camera 98 | ```camera-test -Z 0 -f hires -t 40``` 99 | then start the subscriber app on the same camera id 100 | ```camera-subscriber-test -p 0 -t 20 -d 30``` 101 | run ```camera-subscriber-test -h``` for more details 102 | 103 | You may run multiple camera-subscriber-test on the same camera id 104 | 105 | ## Useful utilities 106 | 107 | ### Version utility 108 | This is an on-target utlity that displays platform version information including QCT AU tag, list of unmerged gerrits and build time. Just run this command: 109 | ```version``` 110 | 111 | ### Package utility 112 | The target image has default versions of pre-installed packages for libcamera, mv, snav and libautonomy. ```atl-pkg-utils``` is an on-target utility that provides the ability to query, remove and install packages (such as mv, snav and autonomy). For more information and usage, please run: 113 | ```atl-pkg-utils.sh -h``` 114 | 115 | ### WiFi utility 116 | This is an on-target utlity to easily switch WiFi modes and connect to a network. For more information and usage, please run: 117 | ```atl-wifi-mode.sh -h``` 118 | 119 | ### Commision utility 120 | Information will be available *later*. 121 | 122 | ### Docker package utility 123 | Information will be available *later*. 124 | 125 | ## Acronyms and abbreviations 126 | Information will be available *later*. 127 | 128 | ## Additional references 129 | Please refer to the following pages and documents for additional information: 130 | - [ADB commands guide](https://developer.qualcomm.com/download/db410c/adb-commands-guide.pdf) 131 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/.gitignore: -------------------------------------------------------------------------------- 1 | INSTALL 2 | aclocal.m4 3 | autom4te.cache/ 4 | compile 5 | configure 6 | depcomp 7 | install-sh 8 | missing 9 | hello 10 | Makefile 11 | Makefile.in 12 | config.log 13 | config.status 14 | .deps/ 15 | .dirstamp 16 | src/hello.o 17 | 18 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/AUTHORS: -------------------------------------------------------------------------------- 1 | Copyright 2010-2016 Linux Foundation 2 | 3 | bootstrap.sh, AUTHORS, Changelog, COPYING, NEWS, README files: 4 | Copyright 2017 Mark Charlebois 5 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/COPYING: -------------------------------------------------------------------------------- 1 | Permission is granted to copy, distribute and/or modify this document under 2 | the terms of the Creative Commons Attribution-Share Alike 2.0 UK: England 3 | & Wales as published by Creative Commons. 4 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/ChangeLog: -------------------------------------------------------------------------------- 1 | Initial version 2 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = hello 2 | hello_SOURCES = src/hello.c 3 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATLFlight/QFlightProDocs/a6ac5d43566a1edda419ac0b20f8a441dbdeac9f/examples/cross_compile/autotools/NEWS -------------------------------------------------------------------------------- /examples/cross_compile/autotools/README: -------------------------------------------------------------------------------- 1 | Example from http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-using-the-standard-sdk 2 | 3 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/bootstrap-cross.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | aclocal 3 | autoconf 4 | automake -a 5 | ./configure --host=x86_64-ubuntu-linux-gnu 6 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | aclocal 3 | autoconf 4 | automake -a 5 | ./configure 6 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT([hello], [0.1]) 2 | AC_CONFIG_SRCDIR([src/hello.c]) 3 | AM_INIT_AUTOMAKE([subdir-objects]) 4 | AC_PROG_CC 5 | AC_PROG_INSTALL 6 | AC_OUTPUT(Makefile) 7 | 8 | -------------------------------------------------------------------------------- /examples/cross_compile/autotools/src/hello.c: -------------------------------------------------------------------------------- 1 | ../../src/hello.c -------------------------------------------------------------------------------- /examples/cross_compile/cmake/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /examples/cross_compile/cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.3.0) 2 | project (hello) 3 | add_executable(hello ../src/hello.c) 4 | -------------------------------------------------------------------------------- /examples/cross_compile/cmake/Makefile: -------------------------------------------------------------------------------- 1 | native: 2 | rm -rf build 3 | mkdir build 4 | (cd build && cmake ..) 5 | (cd build && make) 6 | 7 | 8 | SDKROOT?=/opt/sdk-122 9 | cross: 10 | rm -rf build 11 | mkdir build 12 | (cd build && cmake -DSDKROOT=${SDKROOT} -DCMAKE_TOOLCHAIN_FILE=../crossbuild/Toolchain-arm-linux-gnueabihf.cmake ..) 13 | (cd build && make) 14 | 15 | -------------------------------------------------------------------------------- /examples/cross_compile/cmake/crossbuild/Toolchain-arm-linux-gnueabihf.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 Mark Charlebois. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions 6 | # are met: 7 | # 8 | # 1. Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # 2. Redistributions in binary form must reproduce the above copyright 11 | # notice, this list of conditions and the following disclaimer in 12 | # the documentation and/or other materials provided with the 13 | # distribution. 14 | # 3. Neither the name PX4 nor the names of its contributors may be 15 | # used to endorse or promote products derived from this software 16 | # without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 | # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 25 | # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 26 | # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # defines: 32 | # 33 | # NM 34 | # OBJCOPY 35 | # LD 36 | # CXX_COMPILER 37 | # C_COMPILER 38 | # CMAKE_SYSTEM_NAME 39 | # CMAKE_SYSTEM_VERSION 40 | # LINKER_FLAGS 41 | # CMAKE_EXE_LINKER_FLAGS 42 | # CMAKE_FIND_ROOT_PATH 43 | # CMAKE_FIND_ROOT_PATH_MODE_PROGRAM 44 | # CMAKE_FIND_ROOT_PATH_MODE_LIBRARY 45 | # CMAKE_FIND_ROOT_PATH_MODE_INCLUDE 46 | 47 | include(CMakeForceCompiler) 48 | 49 | if ("${SDKROOT}" STREQUAL "") 50 | message(FATAL_ERROR "SDKROOT not set") 51 | endif() 52 | 53 | # this one is important 54 | set(CMAKE_SYSTEM_NAME Generic) 55 | 56 | # this one not so much 57 | set(CMAKE_SYSTEM_VERSION 1) 58 | 59 | # specify the cross compiler 60 | find_program(C_COMPILER arm-oemllib32-linux-gcc 61 | PATHS 62 | ${SDKROOT}/sysroots/x86_64-oesdk-linux/usr/bin/arm-oemllib32-linux 63 | NO_DEFAULT_PATH 64 | ) 65 | 66 | if(NOT C_COMPILER) 67 | message(FATAL_ERROR "could not find arm-oemllib32-linux-gcc compiler") 68 | endif() 69 | cmake_force_c_compiler(${C_COMPILER} GNU) 70 | 71 | find_program(CXX_COMPILER arm-oemllib32-linux-g++ 72 | PATHS 73 | ${SDKROOT}/sysroots/x86_64-oesdk-linux/usr/bin/arm-oemllib32-linux 74 | NO_DEFAULT_PATH 75 | ) 76 | 77 | if(NOT CXX_COMPILER) 78 | message(FATAL_ERROR "could not find arm-oemllib32-linux-g++ compiler") 79 | endif() 80 | cmake_force_cxx_compiler(${CXX_COMPILER} GNU) 81 | 82 | # compiler tools 83 | foreach(tool objcopy nm ld) 84 | string(TOUPPER ${tool} TOOL) 85 | find_program(${TOOL} arm-oemllib32-linux-${tool} 86 | PATHS 87 | ${SDKROOT}/sysroots/x86_64-oesdk-linux/usr/bin/arm-oemllib32-linux 88 | NO_DEFAULT_PATH 89 | ) 90 | if(NOT ${TOOL}) 91 | message(FATAL_ERROR "could not find arm-oemllib32-linux-${tool}") 92 | endif() 93 | endforeach() 94 | 95 | # os tools 96 | foreach(tool echo grep rm mkdir nm cp touch make unzip) 97 | string(TOUPPER ${tool} TOOL) 98 | find_program(${TOOL} ${tool}) 99 | if(NOT ${TOOL}) 100 | message(FATAL_ERROR "could not find ${TOOL}") 101 | endif() 102 | endforeach() 103 | 104 | set(CMAKE_SYSROOT ${SDKROOT}/sysroots/aarch64-oe-linux) 105 | 106 | # where is the target environment 107 | set(CMAKE_FIND_ROOT_PATH get_file_component(${C_COMPILER} PATH)) 108 | 109 | # search for programs in the build host directories 110 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 111 | # for libraries and headers in the target directories 112 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 113 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 114 | -------------------------------------------------------------------------------- /examples/cross_compile/src/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | printf("Hello World!\n"); 6 | } 7 | -------------------------------------------------------------------------------- /scripts/run_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | 5 | IMAGE=$1 6 | docker images ${IMAGE} | grep ${IMAGE} || docker pull ${IMAGE} 7 | 8 | mkdir -p sdk_home 9 | docker run --rm -it --privileged -e LOCAL_USER_ID=`id -u` \ 10 | -e LOCAL_USER_NAME=`echo ${USER}` -e LOCAL_GID=`id -g` \ 11 | -v `pwd`/sdk_home:/home/${USER}:rw \ 12 | -v `pwd`/scripts:/opt/scripts:rw \ 13 | -v `pwd`/examples:/opt/examples:rw \ 14 | ${IMAGE} /bin/bash 15 | 16 | -------------------------------------------------------------------------------- /scripts/sdk-fixup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SDKROOT=$1 4 | 5 | if [ "${SDKROOT}" = "" ]; then 6 | echo "Usage $0 sdkroot" 7 | exit 1 8 | fi 9 | 10 | if [ ! -f ${SDKROOT}/environment-setup-armv7a-vfp-oemllib32-linux ]; then 11 | cp ${SDKROOT}/environment-setup-armv7a-vfp-neon-oemllib32-linux-gnueabi ${SDKROOT}/environment-setup-armv7a-vfp-neon-oemllib32-linux 12 | mv ${SDKROOT}/environment-setup-armv7a-vfp-neon-oemllib32-linux-gnueabi ${SDKROOT}/environment-setup-armv7a-vfp-neon-oemllib32-linux-gnueabi.orig 13 | sed -i -e "s/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux/" ${SDKROOT}/environment-setup-armv7a-vfp-neon-oemllib32-linux 14 | #sed -i -e '/^export CC=/s/"$$/ -B\$$\{SDKROOT\}\/sysroots\/aarch64-oe-linux\/usr\/lib\/arm-oemllib32-linux-gnueabi\/4.9.3"/' sdk/environment-setup-armv7a-vfp-oemllib32-linux 15 | rm -f ${SDKROOT}/environment-setup-armv7a-vfp-neon-oemllib32-linux-gnueabi 16 | pushd ${SDKROOT} 17 | ln -s environment-setup-armv7a-vfp-neon-oemllib32-linux environment-setup-armv7a-vfp-neon-oemllib32-linux-gnueabi 18 | popd 19 | 20 | # The compiler search path is wrong 21 | pushd ${SDKROOT}/sysroots/aarch64-oe-linux/usr/lib/ 22 | ln -s arm-oe-linux arm-oe-linux-gnueabi 23 | popd 24 | fi 25 | echo "SDK fixed" 26 | --------------------------------------------------------------------------------