Fetch And Fill Rb3 Linux User Guide

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 63

Qualcomm Technologies, Inc.
For additional information or to submit technical questions, go to: https://createpoint.qti.qualcomm.com
Confidential and Proprietary Qualcomm Technologies, Inc.
NO PUBLIC DISCLOSURE PERMITTED: Please report postings of this document on public servers or websites to:
DocCtrlAgent@qualcomm.com.
Restricted Distribution: Not to be distributed to anyone who is not an employee of either Qualcomm Technologies, Inc. or its affiliated
companies without the express approval of Qualcomm Configuration Management.
Not to be used, copied, reproduced, or modified in whole or in part, nor its contents revealed in any manner to others without the express
written permission of Qualcomm Technologies, Inc.
Hexagon, Qualcomm, and Snapdragon are trademarks of Qualcomm Incorporated, registered in the United States and other countries. Other
product and brand names may be trademarks or registered trademarks of their respective owners.
This technical data may be subject to U.S. and international export, re-export, or transfer (“export”) laws. Diversion contrary to U.S. and
international law is strictly prohibited.
Qualcomm Technologies, Inc.
5775 Morehouse Drive
San Diego, CA 92121
U.S.A.
© 2019 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
Qualcomm® Robotics RB3 Platform
Linux User Guide
Rev. A
February 11, 2019
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 2
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Revision history
Revision
Date
Description
A
February 2019
Initial release
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 3
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Contents
1 RB3 Platform Linux SDK ......................................................................................................... 5
1.1 RB3 Platform Linux SDK support ............................................................................................................... 5
2 Set Up the Development Environment ................................................................................... 6
2.1 Required hardware, software, and equipment ........................................................................................... 6
2.2 Install Ubuntu 14.04 (64-bit) system .......................................................................................................... 7
2.3 Install ADB, Fastboot, and USB host interface .......................................................................................... 7
2.3.1 On the Windows host machine ................................................................................................. 8
2.3.2 On the Linux (Ubuntu) host ....................................................................................................... 8
2.4 Required build environment ....................................................................................................................... 9
3 Program the Firmware ........................................................................................................... 11
3.1 Program system images using Fastboot .................................................................................................. 11
4 RB3 Platform Features and Use Cases ................................................................................ 13
4.1 Set up the serial port ................................................................................................................................ 13
4.2 Button events ........................................................................................................................................... 14
4.3 Set up the FAN control interface .............................................................................................................. 14
4.4 Configure CAN interface .......................................................................................................................... 15
4.5 Connectivity ............................................................................................................................................. 16
4.5.1 Set up Wi-Fi ............................................................................................................................ 16
4.5.2 Bluetooth Generic Access Profile (GAP) ................................................................................ 17
4.5.3 Enable Bluetooth .................................................................................................................... 18
4.5.4 Start inquiry ............................................................................................................................ 18
4.5.5 Check the inquiry list .............................................................................................................. 19
4.5.6 Pair outgoing SSP .................................................................................................................. 19
4.5.7 Check the bonded list ............................................................................................................. 19
4.6 Ethernet ................................................................................................................................................... 20
4.7 Digital microphone ................................................................................................................................... 20
4.8 Audio ........................................................................................................................................................ 21
4.8.1 Playback WAV using amixer + aplay ...................................................................................... 22
4.8.2 Playback AAC_LC using hal_play_test_64bit ......................................................................... 22
4.8.3 HE-AAC-V1 using hal_play_test_64bit ................................................................................... 22
4.8.4 HE-AAC-V2 using hal_play_test_64bit ................................................................................... 22
4.8.5 Mp3 using hal_play_test_64bit ............................................................................................... 22
4.9 Sensors .................................................................................................................................................... 23
4.9.1 Get sensor data via sns_hal_batch ........................................................................................ 23
4.9.2 Get accelerometer data .......................................................................................................... 24
4.9.3 Get gyroscope data ................................................................................................................ 25
4.9.4 Get magnetometer data .......................................................................................................... 26
4.9.5 Get pressure sensor data ....................................................................................................... 26
4.9.6 Get light sensor data .............................................................................................................. 27
4.9.7 Get proximity sensor data ....................................................................................................... 28
4.10 Camera .................................................................................................................................................. 28
4.10.1 Main Camera (OV8856) ........................................................................................................ 30
4.10.2 Tracking (OV7251) ............................................................................................................... 35
4.10.3 Stereo camera ...................................................................................................................... 35
4.10.4 ToF Dump RAW ................................................................................................................... 36
4.10.5 Three camera concurrency mode ......................................................................................... 38
Qualcomm® Robotics RB3 Platform Linux User Guide Contents
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 4
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4.11 Video ...................................................................................................................................................... 39
4.11.1 OMX ..................................................................................................................................... 39
4.11.2 GST ...................................................................................................................................... 40
4.12 OpenGL ES ........................................................................................................................................... 42
4.13 LTE Module ........................................................................................................................................... 44
4.14 Software tools and libraries .................................................................................................................... 45
4.14.1 ROS ...................................................................................................................................... 45
4.14.2 Qualcomm® Hexagon™ Vector eXtensions (HVX) ............................................................. 46
4.14.3 FastCV .................................................................................................................................. 50
5 Develop an application .......................................................................................................... 54
5.1 Hello RB3 ................................................................................................................................................. 55
5.2 Sensors .................................................................................................................................................... 56
5.2.1 Accelerometer example .......................................................................................................... 56
5.2.2 Other sensors ......................................................................................................................... 60
6 Set Up the System SDK ......................................................................................................... 61
6.1 Build the SDK .......................................................................................................................................... 61
6.1.1 Build images ........................................................................................................................... 61
6.1.2 Build kernel image .................................................................................................................. 61
6.1.3 Build rootfs image ................................................................................................................... 62
6.1.4 Add new module ..................................................................................................................... 62
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 5
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
1 RB3 Platform Linux SDK
The Linux SDK for the Qualcomm® Robotics RB3 Platform is built by Thundercomm. The
platform is based on Yocto Rocko with Linux Kernel 4.9 and GCC 6.5.
This document provides information on how to obtain, build, and program SDA845 software into
the RB3 Platform.
For more information about software updates and the software development kit (SDK) for your
host machine operating system visit:
https://www.thundercomm.com/
1.1 RB3 Platform Linux SDK support
For support, create a request in the Qualcomm Robotics RB3 Platform forum:
https://www.thundercomm.com/forum/category/1/qualcomm-robotics-rb3-platform
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 6
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
2 Set Up the Development Environment
This chapter describes how to set up the Linux development environment on an Ubuntu/Windows
host machine.
For compiling code using Qualcomm SDK, Ubuntu 14.04 is required.
For flashing firmware images, an Ubuntu/Windows machine is needed.
2.1 Required hardware, software, and equipment
The following table lists the hardware, software, and other equipment required to install and run
the software.
Item description
Version
Source/vendor
Standalone system minimum requirement:
8 GB RAM
Quadcore CPU
NOTE: Lower specs will increase
compilation time. Ideal compilation time
required for a system with 16 GB RAM
and Intel i7-2600 @3.4 GHz is about an
hour.
Ubuntu 14.04 LTS Linux distribution for
64-bit architecture
14.04 LTS
Ubuntu Community/
Canonical, Ltd.
Repo
SDK Open Source
Project
Python
Python 2.7.6 with
sqlite3 library
Python.org
QTI USB driver
QUD.WIN 1.1
Installer 10032.1
or later
https://www.thunder
comm.com/
Android SDK tools (ADB, Fastboot)
r10 or later ADB
1.0.29 or later
Android open-
source project
NOTE: See the release notes for current versions of the ARM toolchain and Qualcomm® Hexagon™
LLVM toolchain.
Qualcomm® Robotics RB3 Platform Linux User Guide Set Up the Development Environment
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 7
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
2.2 Install Ubuntu 14.04 (64-bit) system
Prerequisite: You must be able to log in as root or use sudo to have root permissions during the
installation.
1. Create an installation CD (the CD image is ubuntu-14.04.2-desktop-amd64.iso) and install it
on the computer following the instructions at:
http://www.ubuntu.com/download/desktop/install-ubuntu-desktop
2. Perform a software update using one of the following options:
In the GUI, select System > Administration > Update Manager.
From a shell command line:
a. Edit the source config file to directly enable the universe and multiverse sources and
disable the Ubuntu installation CD source.
sudo vi /etc/apt/sources.list
b. From the command line, perform the package list update and package upgrades.
sudo apt-get update
sudo apt-get upgrade
c. Use apt-get to install the additional required packages.
d. See https://source.android.com/source/initializing.html for the required packages. In
addition to the packages mentioned in the link, install libssl-dev.
sudo apt-get install libssl-dev
e. Make bash the default shell (shell /bin/sh to invoke bash) using one of the following
options:
Use sudo dpkg-reconfigure dash command and reconfigure the package.
Manually change the symlink /bin/sh > dash to /bin/sh> bash. Use the sudo rm /bin/sh
command to remove
Use sudo ln -s /bin/bash /bin/sh
For more information, see the Ubuntu Wiki page at: https://wiki.ubuntu.com/DashAsBinSh
2.3 Install ADB, Fastboot, and USB host interface
The Fastboot tool communicates with the RB3 bootloader and allows you to flash images onto
the board. This section provides instructions for installing ADB, Fastboot, and USB drivers on
your host machine.
Qualcomm® Robotics RB3 Platform Linux User Guide Set Up the Development Environment
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 8
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
2.3.1 On the Windows host machine
Install ADB and Fastboot
Google currently does not offer a standalone Windows Installer for Fastboot. Instead Fastboot is
part of the full Android Studio integrated development environment (IDE) installation.
1. Go to http://developer.android.com/sdk/installing/
2. Follow the instructions to install the standalone SDK Tools. During the installation, Fastboot
and ADB drivers are installed
NOTE: If you want to install Fastboot without the full Android Studio installation you can find third
party installers on the web.
Install the USB drivers
1. Add the system environment path for ADB and Fastboot.
2. Install the Windows drivers. Windows will usually update the drivers automatically from the
server.
2.3.2 On the Linux (Ubuntu) host
Install ADB and Fastboot
To install ADB and Fastboot, execute the following command:
sudo apt-get install android-tools-adb
sudo apt-get install android-tools-fastboot
Install and configure the USB driver
Setup the udev rules on your Linux PC as follows:
1. Login as root or sudo and navigate to the directory /etc/udev/rules.d/
2. Add the following rules in file 99-android.rules:
# fastboot for Dragonboard 845c
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODrmmodE="0777", GROUP="adm"
# adb for Dragonboard 845c
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0777", GROUP="adm"
3. Restart the udev service:
$ build@ubuntu$ sudo chmod a+r /etc/udev/rules.d/99-android.rules
$ build@ubuntu$ sudo service udev restart
4. Reconnect RB3 to PC with USB cable.
5. Connect the power adapter.
Qualcomm® Robotics RB3 Platform Linux User Guide Set Up the Development Environment
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 9
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
6. Press Power and the system will start.
Server@: ~$ adb devices
List of devices attached
7a7d0e08 device
2.4 Required build environment
Recommendation: Use Ubuntu 14.04 along with gcc/g++ version 4.8.
1. Run following commands to ensure gcc/g++ 4.8 is installed:
$ gcc --version
$ g++ --version
2. If your host machine has an older version, complete the following steps to upgrade to 4.8:
a. Run the following commands:
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-4.8-multilib g++-4.8-multilib
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-
4.8 100
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-
4.8 100
b. Select 4.8 in the prompt shown and run the following command:
$ sudo update-alternatives --config gcc
c. Select 4.8 in the prompt as shown:
$ sudo update-alternatives --config g++
Type C
Power
Power
adapter
Qualcomm® Robotics RB3 Platform Linux User Guide Set Up the Development Environment
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 10
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
3. To install the dependency library, run the following commands:
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-
multilib build-essential chrpath libsdl1.2 -dev xterm openssl libssh-
dev libssl-dev
$ sudo cpan install XML::Simple
4. Check that the bash shell is in use:
$ sudo rm /bin/sh
$ sudo ln -sf /bin/bash /bin/sh
NOTE: To run the build command, the following packages must be installed: diffstat, makeinfo, and
chrpath.
For build environment dependencies, go to the Yocto Project Active Release Documentation page
at https://www.yoctoproject.org/docs/, select YP Core Rocko 2.4.4, and view the Yocto Project
Quick Start Guide.
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 11
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
3 Program the Firmware
The following method is the recommended procedure for downloading your experimental version
of self-compiled OS on RB3. A host PC is needed to program the board.
The procedure for both Windows and Linux host systems is described.
3.1 Program system images using Fastboot
NOTE: Ensure you have installed the required ADB and Fastboot drivers. Your board must be detected
on your host machine.
To install Linux from a host PC complete the following steps:
1. Download the Linux images package from the Thundercomm website and unzip to the
${SDA845-ROBOT-IMAGE}”:
https://thundercomm.s3-ap-northeast-
1.amazonaws.com/shop/doc/1544580412842651/5c471969b1c340c7bbc20b02148762ce-
1352331417
2. Remove all connected USB cables (if any from RB3) and plug in the power.
Qualcomm® Robotics RB3 Platform Linux User Guide Program the Firmware
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 12
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
3. Press and hold VOL - then press Power.
4. After about 5 seconds, release VOL -. The device will enter Fastboot mode.
5. Plug the USB cable into the Device Type C port.
6. Confirm that Fastboot is active as follows:
a. From the Windows command shell, run:
$fastboot devices
dae93bbb fastboot
b. From Linux, run:
$ sudo fastboot devices
dae93bbb fastboot
7. Flash each binary selectively through the following fastboot command options
$ cd SDA845-ROBOT-IMAGE
$ fastboot flash abl_a <path to abl.elf>
$ fastboot flash boot_a <path to sda845-boot.img>
$ fastboot flash system_a <path to sda845-sysfs.ext4>
$ fastboot flash systemrw <path to sda845-systemrw.ext4>
$ fastboot flash cache <path to sda845-cache.ext4>
$ fastboot flash userdata <path to sda845-usrfs.ext4>
$ fastboot flash persist <path to sda845-persist.ext4>
8. Reboot the board
$ fastboot reboot
rebooting…
Type C
VOL -
Power
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 13
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4 RB3 Platform Features and Use Cases
This chapter presents RB3 Platform features and use cases.
4.1 Set up the serial port
To enable DBUG_USB:
1. Turn ON SW2 on switch DIP_SW:
2. Log in using the following account credentials:
… …
[ OK ] Started start dsp variants.
[ OK ] Reached target Multi-User System.
Starting Update UTMP about System Runlevel Changes...
[ OK ] Started Update UTMP about System Runlevel Changes.
robot 201812300250 sda845 ttyMSM0
sda845 login: root
Password: 123456
SW1
SW3
SW5
SW2
SW4
SW6
DIP_SW
DBUG_USB
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 14
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4.2 Button events
The following figure shows the button positions.
NOTE: F_DL is forced download mode (emergency download)
1. Get interrupt event:
$ adb shell
# hexdump /dev/input/event0
Press the “key -" button. The terminal displays the following information:
# hexdump /dev/input/event0
0000000 6a1d 5c2f 0000 0000 c499 000d 0000 0000
0000010 0001 0072 0001 0000 6a1d 5c2f 0000 0000
0000020 c499 000d 0000 0000 0000 0000 0000 0000
4.3 Set up the FAN control interface
The following figure shows the FAN interface position.
Key
Device node
VOL +
/dev/input/event2
VOL -
/dev/input/event0
F_DL
/dev/input/event2
ON/OFF
/dev/input/event0
VOL +
VOL -
F_DL
ON/OFF
FAN
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 15
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
1. Enable FAN: (1/2/3 indicate different speed levels: 1minimum, 3maximum):
$ adb shell
# echo 1 > /sys/kernel/fan/speed
# echo 2 > /sys/kernel/fan/speed
# echo 3 > /sys/kernel/fan/speed
2. Disable FAN:
$ adb shell
# echo 0 > /sys/kernel/fan/speed
4.4 Configure CAN interface
The following figure shows the CAN interface positions.
1. Connect CAN_L and CAN_H for loopback test.
2. Configure the CAN device:
$adb shell
#ip link set can0 down
// Disable CAN;
#ip link set can0 up type can bitrate 800000
// Enable CAN;
Perform the data loopback test.
a. Receive data:
$adb shell
#candump can0
interface = can0, family = 29, type = 3, proto = 1
b. Open another terminal, send data:
$adb shell
#cansend can0 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
CAN_H
CAN_L
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 16
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4.5 Connectivity
The following figure shows the WLAN and BT connectivity.
4.5.1 Set up Wi-Fi
1. Confirm the antenna is properly connected.
2. To verify connectivity while the device is in Station mode, use the following commands on
the HyperTerminal software connected to the debug USB port, execute the following
commands
$ adb shell
# vi /data/misc/wifi/wpa_supplicant.conf
Fill in the ssid and psk of wifi as follows.
update_config=1
eapol_version=1
ap_scan=1
fast_reauth=1
pmf=1
p2p_add_cli_chan=1
network={
ssid=”wifissid1
psk=”wifipsk1
}
Network={
ssid=”wifissid2”
psk=”wifipsk2”
}
3. Restart the device and connect to wifi.
Run the following command to confirm that the device is connected to
wifi.
The log of IP address acknowledgement proves the connection is
successful:
$ adb shell
WLAN
BT
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 17
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
#ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:0A:F5:83:66:EF
inet addr:192.168.43.92 Bcast:192.168.43.255
Mask:255.255.255.0
inet6 addr: fe80::20a:f5ff:fe83:66ef%1736140884/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:1864 (1.8 KiB) TX bytes:1828 (1.7 KiB)
#ping www.qualcomm.com
PING www.qualcomm.com (23.59.93.51): 56 data bytes
64 bytes from 23.59.93.51: seq=0 ttl=48 time=171.722 ms
64 bytes from 23.59.93.51: seq=1 ttl=48 time=163.070 ms
64 bytes from 23.59.93.51: seq=2 ttl=48 time=244.932 ms
64 bytes from 23.59.93.51: seq=3 ttl=48 time=166.135 ms
Note: If ping does not work, check the firewall and try to ping outside
the firewall.
Run the throughput test:
# Add throughput example here
4.5.2 Bluetooth Generic Access Profile (GAP)
1. Before running btapp, run the btproperty in the background (run only once at the beginning):
$adb shell
#btproperty &
# btapp
2. After running btapp, type gap_menu and press Enter.
gap_menu
***************** Menu *******************
enable
disable
inquiry
cancel_inquiry
pair<space><bt_address> eg. pair 00:11:22:33:44:55
unpair<space><bt_address> eg. unpair 00:11:22:33:44:55
inquiry_list
bonded_list
get_state
get_bt_name
get_bt_address
set_bt_name<space><bt name> eg. set_bt_name MDM_Fluoride
set_le_bt_name<space><bt name> eg. set_le_bt_name
MDM_LE_Fluoride
main_menu
******************************************
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 18
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4.5.3 Enable Bluetooth
To enable the Bluetooth service, enter the following command:
$ adb shell
#btproperty & // ignore if this is already running
# btapp
After running btapp, input “enable” and press “Enter”enable
killall: wcnssfilter: no process killed
killall: btsnoop: no process killed
killall: qcbtdaemon: no process killed
/bin/sh: qcbtdaemon: not found
BtHfpAgMsgHandler event = 1028
ACDB -> No .acdb files found in /etc/acdbdata/!
ACDB -> found 0 form factor & soundcard independant files
… …
ACDB -> MBHC ACDB_PID_GENERAL_CONFIG
ACDB -> MBHC ACDB_PID_PLUG_REMOVAL_DETECTION
ACDB -> MBHC ACDB_PID_PLUG_TYPE_DETECTION
ACDB -> MBHC ACDB_PID_BUTTON_PRESS_DETECTION
ACDB -> MBHC ACDB_PID_IMPEDANCE_DETECTION
send vbat data
ACDB -> VBAT ACDB_PID_ADC_CAL
ACDB -> VBAT ACDB_PID_GAIN_PROC
send vbat data, calling convert_vbat_data
Vbat Registers Size: 17
copied vbat cal size =72
BT State is ON
4.5.4 Start inquiry
After running enable, type inquiry and press Enter to start inquiry.
inquiry
Inquiry Started
Device Found details:
Found device Addr: 28:11:a5:01:00:a2
Found device Name: LE-Bose SoundSport
Device class is: 7936
Device Found details:
Found device Addr: e4:ba:d9:10:00:c9
Found device Name: 360FLY4K_00C8
Device class is: 7936
Device Found details:
Found device Addr: 28:11:a5:24:01:05
Found device Name: LE-reserved_N
Device class is: 7936
Device Found details:
Found device Addr: 10:02:b5:2d:84:98
Found device Name: USER-PC
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 19
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Device class is: 8257804
Inquiry Stopped automatically
NOTE: To cancel inquiry, issue the following command while the inquiry in progress: cancel_inquiry
4.5.5 Check the inquiry list
After running inquiry, type inquiry_list and press Enter to check the list.
inquiry_list
**************************** Inquiry List*******************************
LE-Bose SoundSport 28:11:a5:01:00:a2
360FLY4K_00C8 e4:ba:d9:10:00:c9
LE-reserved_N 28:11:a5:24:01:05
**************************** End of List *******************************
4.5.6 Pair outgoing SSP
Use the following command to pair outgoing SSP:
pair <bd_address>
To accept or reject the outgoing pairing for the following example (pair e4:ba:d9:10:00:c9),
type Yes or No and press Enter.
pair e4:ba:d9:10:00:c9
*************************************************
BT pairing request::Device iPhone::Pairing Code:: 281155
*************************************************
** Please enter yes / no **
yes
*************************************************
Pairing state for 360FLY4K_00C8 is BONDED
*************************************************
4.5.7 Check the bonded list
1. Use the following command to get the bonded device list:
$ adb shell
# btapp
2. After running btapp, type bonded_list and press Enter:
bonded_list
**************************** Bonded Device List
***************************
360FLY4K_00C8 a4:f1:e8:c6:2f:b4
******************************* End of List
*********************************
3. To exit from btapp, navigate to the main menu and enter the following command:
exit
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 20
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4.6 Ethernet
The following figure shows the LAN port.
Connect the LAN cable to the LAN port.
$ adb shell
# ifconfig
enp1s0u3 Link encap:Ethernet HWaddr 00:0E:C6:81:79:01
inet addr:192.168.7.196 Bcast:192.168.7.255
Mask:255.255.255.0
inet6 addr: fe80::20e:c6ff:fe81:7901%1819682900/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:319 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:34988 (34.1 KiB) TX bytes:1774 (1.7 KiB)
# ping www.qualcomm.com
PING www.qualcomm.com (140.205.16.110): 56 data bytes
64 bytes from 140.205.16.110: seq=0 ttl=40 time=38.816 ms
64 bytes from 140.205.16.110: seq=1 ttl=40 time=42.177 ms
64 bytes from 140.205.16.110: seq=2 ttl=40 time=38.260 ms
^C
--- www.qualcomm.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 38.260/39.751/42.177 ms
Note: If ping does not work, check the firewall and try to ping outside
the firewall.
4.7 Digital microphone
LAN
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 21
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
The following figure shows the digital microphone (DMIC) positions:
1. The board has four DMICs. Use dmic-ctl to perform separate DMIC enable, disable, and
record operations.
$adb shell
# dmic-ctl
/usr/bin/dmic-ctl <MDIC_NUMBER> <SWITCH>
DMIC_NUMBER: [0, 1, 2, 3]
SWITCH: enable, disables
2. In the following example DMIC1 is used.
a. To enable DMIC1:
$ adb shell
# dmic-ctl 0 enable
b. To start recording, enter arecord and press Enter:
# arecord /data/dmic0_test.wav -f S16_LE -c 1 -r 48000 -d 10
c. The command parameter setting only records for 10 seconds. After 10 seconds, the
recording stops.
d. Move the recording file to the PC for playback verification or use a tool like Audacity to
view the waveform.
$ adb pull /data/dmic0_test.wav .
e. To disable DMIC1:
$ adb shell
#dmic-ctl 1 disables
4.8 Audio
1. To verify the audio decoding functionality download the test files from:
https://thundercomm.s3-ap-northeast-
1.amazonaws.com/shop/doc/1544580412842651/1b61950baae5470c86f96cd229b2bc01-
645602035
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 22
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
2. Unzip to extract the contents of the file:
Audio_Decode_WAV_Stereo_48KHz_16Bit.wav;
Audio_Decode_AAC-LC_adts_32KHz_stereo.aac;
Audio_Decode_HE-AAC V1_stereo_32KHz.aac;
Audio_Decode_HE-AAC V2_stereo_44.1KHz.m4a;
Audio_Decode_MP3v1_32KHz_cbr_stereo.mp3;
4.8.1 Playback WAV using amixer + aplay
$ adb push Audio_Decode_WAV_Stereo_48KHz_16Bit.wav /data/
1. To enable speaker:
$ adb shell
# spk-ctl enable
2. To play:
$ adb shell
# aplay /data/Audio_Decode_WAV_Stereo_48KHz_16Bit.wav
3. To disable speaker:
$ adb shell
# spk-ctl disables
4.8.2 Playback AAC_LC using hal_play_test_64bit
$ adb push Audio_Decode_AAC-LC_adts_32KHz_stereo.aac /data/
# hal_play_test_64bit -f /data/Audio_Decode_AAC-LC_adts_32KHz_stereo.aac -t
4 -d 2 -v 0.3 -r 32000 -c 2 -a 1
4.8.3 HE-AAC-V1 using hal_play_test_64bit
$ adb push Audio_Decode_HE-AAC V1_stereo_32KHz.aac /data/
# hal_play_test_64bit -f /data/Audio_Decode_HE-AAC\ V1_stereo_32KHz.aac -t
4 -d 2 -v 0.3 -r 16000 -c 2 -a 2
4.8.4 HE-AAC-V2 using hal_play_test_64bit
$ adb push Audio_Decode_HE-AAC V2_stereo_44.1KHz.m4a /data/
# hal_play_test_64bit -f /data/Audio_Decode_HE-AAC\ V2_stereo_44.1KHz.m4a -
t 3 -d 2 -v 0.3 -r 22050 -c 2 -a 3
4.8.5 Mp3 using hal_play_test_64bit
$ adb push Audio_Decode_MP3v1_32KHz_cbr_stereo.mp3 /data/
# hal_play_test_64bit -f /data/Audio_Decode_MP3v1_32KHz_cbr_stereo.mp3 -t 2
-d 2 -v 0.3 -r 32000 -c 2 -a 1
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 23
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4.9 Sensors
The device supports five sensor types: accelerometer, gyroscope, magnetometer, proximity, and
light. The sensors are situated in two groups.
The following table shows the sensor modules enabled using the SW_5 switch.
SW_5
Sensor
Sensor_name
Sensor type ID
ON
Accelerometer
bst_bma2x2 Accelerometer Wakeup
1
Gyroscope
BMG160 Gyroscope Wakeup
4
Magnetometer
bosch_bmm150 Magnetometer Wakeup
2
Magnetometer
ak0991x Magnetometer Wakeup
2
Pressure
icp101xx Pressure Sensor Wakeup
6
OFF
Accelerometer
icm4x6xx Accelerometer Wakeup
1
Gyroscope
icm4x6xx Gyroscope Wakeup
4
Proximity
ltr559 Proximity Sensor Wakeup
8
Light
ltr559 Ambient Light Sensor Wakeup
5
NOTE: Whenever the SW_5 switch is toggled, the device must be rebooted.
4.9.1 Get sensor data via sns_hal_batch
To get sensor data via sns_hal_batch:
$ adb shell
# sns_hal_batch --help
Usage: sns_hal_batch [OPTIONS]...
-h --help Print this message
-l --listsensors List all available sensors and their
attributes
-o --output the output file to write the sensor values to
default: /data/local/sns_hal_batch.out
SW_5
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 24
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Providing no parameter options runs the interactive command line
interface
Providing 1 or more parameters to sns_hal_batch will run the following
sequence:
- set batching parameters for the sensor: (sampling rate, report
rate)
- activate the sensor
- wait for the specified duration
- deactivate the sensor
The parameters, as well as their default values, are as follows:
-s --sensor the android sensor type enumeration
value
default: 1 for
android.sensor.accelerometer
-w --wakeup flag for wakeup or non-wakeup sensor
w for wakeup
n for non-wakeup
d for don't care or default
default: d
-sr --samplingrate the sampling rate (in Hz)
default: 5 Hz
-rr --reportrate the report rate (in Hz)
use 0 for no batching
(report events as available)
default: 0
-d --duration the duration (in seconds) to run the
sensor for
default: 10 seconds
4.9.2 Get accelerometer data
To get accelerometer data, set SW_5 to ON position:
NOTE: whenever SW_5 switch is toggled, device has to be rebooted
# sns_hal_batch -s 1 -sr 10 -rr 10 -d 30
HAL open
HAL module_api_version: 0x1
HAL hal_api_version : 0x256
HAL hal_id : sensors
HAL hal_name : QTI Sensors HAL Module
HAL hal_author : Qualcomm Technologies, Inc.
get_sensors_list took 3359783957 nanoseconds
batch success
activate success
Activated sensor [Type: 1] bst_bma2x2 Accelerometer Wakeup (d) for 30
seconds, sampling at 10.000000 Hz and reporting at 10.000000 Hz
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 25
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
[Type: 1] android.sensor.accelerometer (wakeup)
Name:bst_bma2x2 Accelerometer Wakeup Vendor:Bosch
Version:16843296 Handle:21
maxRange: 769.773376 resolution: 0.002393 power: 0.130000 mA
minDelay: 4000 us maxDelay: 1000000 us
fifoReservedEventCount: 3000 fifoMaxEventCount: 10000
requiredPermission:
Sleeping for 30 seconds before deactivating and exiting
801676.639328, android.sensor.accelerometer/bst_bma2x2 Accelerometer
Wakeup, 1546110350081.201416, 0.229966, -0.675981, 9.965191, 0.000000, -
4671062810670957519, latency(ms): 16900634525304.989528
801774.951150, android.sensor.accelerometer/bst_bma2x2 Accelerometer
Wakeup, 1546110350181.201416, 0.229966, -0.651570, 9.965191, 0.000000, -
4672821831706903503, latency(ms): 16900634525303.301350
4.9.3 Get gyroscope data
To get gyroscope data, set SW_5 to ON position:
NOTE: whenever SW_5 switch is toggled, device has to be rebooted
# sns_hal_batch -s 4 -sr 10 -rr 10 -d 30
HAL open
HAL module_api_version: 0x1
HAL hal_api_version : 0x256
HAL hal_id : sensors
HAL hal_name : QTI Sensors HAL Module
HAL hal_author : Qualcomm Technologies, Inc.
get_sensors_list took 3348546614 nanoseconds
batch success
activate success
Activated sensor [Type: 4] BMG160 Gyroscope Wakeup (d) for 30 seconds,
sampling at 10.000000 Hz and reporting at 10.000000 Hz
[Type: 4] android.sensor.gyroscope (wakeup)
Name:BMG160 Gyroscope Wakeup Vendor:BOSCH Version:16843020
Handle:15
maxRange: 34.905556 resolution: 0.018592 power: 0.250000 mA
minDelay: 1000 us maxDelay: 1000000 us
fifoReservedEventCount: 0 fifoMaxEventCount: 10000
requiredPermission:
Sleeping for 30 seconds before deactivating and exiting
940962.967347, android.sensor.gyroscope/BMG160 Gyroscope Wakeup,
1546110489356.736937, -0.000000, -0.001598, -0.002131, 0.000000, -
4985078755554964275, latency(ms): 16900634525315.782026
941062.849431, android.sensor.gyroscope/BMG160 Gyroscope Wakeup,
1546110489454.736937, -0.000213, -0.001704, -0.001065, 0.000000, -
4981148563932223546, latency(ms): 16900634525317.664110
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 26
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4.9.4 Get magnetometer data
To get data from the magnetometer, set SW_5 to ON position:
NOTE: whenever SW_5 switch is toggled, device has to be rebooted
# sns_hal_batch -s 2 -sr 10 -rr 10 -d 30
HAL open
HAL module_api_version: 0x1
HAL hal_api_version : 0x256
HAL hal_id : sensors
HAL hal_name : QTI Sensors HAL Module
HAL hal_author : Qualcomm Technologies, Inc.
get_sensors_list took 3376610572 nanoseconds
batch success
activate success
Activated sensor [Type: 2] bosch_bmm150 Magnetometer Wakeup (d) for 30
seconds, sampling at 10.000000 Hz and reporting at 10.000000 Hz
[Type: 2] android.sensor.magnetic_field (wakeup)
Name:bosch_bmm150 Magnetometer Wakeup Vendor:Bosch Version:8454
Handle:35
maxRange: 2500.000000 resolution: 0.100000 power: 0.500000 mA
minDelay: 10000 us maxDelay: 1000000 us
fifoReservedEventCount: 600 fifoMaxEventCount: 10000
requiredPermission:
Sleeping for 30 seconds before deactivating and exiting
1055972.352303, android.sensor.magnetic_field/bosch_bmm150 Magnetometer
Wakeup, 1546110604391.238615, 23.922522, -5.980630, -85.005112,
0.000000, -4557817287662411437, latency(ms): 16900634525290.665304
1056075.248866, android.sensor.magnetic_field/bosch_bmm150 Magnetometer
Wakeup, 1546110604491.267521, 23.175407, -5.606953, -84.604294,
0.000000, -4561183073144051908, latency(ms): 16900634525293.532961
4.9.5 Get pressure sensor data
To get data from the pressure sensor, set SW_5 to ON position.
NOTE: whenever SW_5 switch is toggled, device has to be rebooted
# sns_hal_batch -s 6 -sr 10 -rr 10 -d 30
HAL open
HAL module_api_version: 0x1
HAL hal_api_version : 0x256
HAL hal_id : sensors
HAL hal_name : QTI Sensors HAL Module
HAL hal_author : Qualcomm Technologies, Inc.
get_sensors_list took 9613565153 nanoseconds
batch success
activate success
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 27
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Activated sensor [Type: 6] icp101xx Pressure Sensor Wakeup (d) for 30
seconds, sampling at 10.000000 Hz and reporting at 10.000000 Hz
[Type: 6] android.sensor.pressure (wakeup)
Name:icp101xx Pressure Sensor Wakeup Vendor:TDK-Invensense Version:65544
Handle:41
maxRange: 1150.000000 resolution: 0.000100 power: 0.010000 mA
minDelay: 40000 us maxDelay: 1000000 us
fifoReservedEventCount: 300 fifoMaxEventCount: 10000
requiredPermission:
Sleeping for 30 seconds before deactivating and exiting
182936428.889120, android.sensor.pressure/icp101xx Pressure Sensor
Wakeup, 1547642389965.965156, 1012.952209, 0.000000, 0.000000, 0.000000,
1149058289, latency(ms): 16899284620172.475580
182936528.848286, android.sensor.pressure/icp101xx Pressure Sensor
Wakeup, 1547642390065.965729, 1012.957520, 0.000000, 0.000000, 0.000000,
1149058376, latency(ms): 16899284620172.434173
182936628.178390, android.sensor.pressure/icp101xx Pressure Sensor
Wakeup, 1547642390165.970573, 1012.956543, 0.000000, 0.000000, 0.000000,
1149058360, latency(ms): 16899284620171.759433
4.9.6 Get light sensor data
To get data from the light sensor, set SW_5 to OFF position.
NOTE: whenever SW_5 switch is toggled, device has to be rebooted
Whenever SW_5 switch is toggled, device has to be rebooted
# sns_hal_batch -s 5 -sr 10 -rr 10 -d 30
HAL open
HAL module_api_version: 0x1
HAL hal_api_version : 0x256
HAL hal_id : sensors
HAL hal_name : QTI Sensors HAL Module
HAL hal_author : Qualcomm Technologies, Inc.
get_sensors_list took 3367598176 nanoseconds
batch success
activate success
Activated sensor [Type: 5] ltr559 Ambient Light Sensor Wakeup (d) for 30
seconds, sampling at 10.000000 Hz and reporting at 10.000000 Hz
[Type: 5] android.sensor.light (wakeup)
Name:ltr559 Ambient Light Sensor Wakeup Vendor:Lite-On
Version:256 Handle:25
maxRange: 1.000000 resolution: 0.100000 power: 0.110000 mA
minDelay: 0 us maxDelay: 0 us
fifoReservedEventCount: 0 fifoMaxEventCount: 10000
requiredPermission:
Sleeping for 30 seconds before deactivating and exiting
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 28
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
1123650.618788, android.sensor.light/ltr559 Ambient Light Sensor Wakeup,
1546110672090.233843, 0.000000, 0.000000, 0.000000, 0.000000, 0,
latency(ms): 16900634525269.936561
4.9.7 Get proximity sensor data
To get data from the proximity sensor, set SW_5 to OFF position:
NOTE: whenever SW_5 switch is toggled, device has to be rebooted
Whenever SW_5 switch is toggled, device has to be rebooted
# sns_hal_batch -s 8 -sr 10 -rr 10 -d 30
HAL open
HAL module_api_version: 0x1
HAL hal_api_version : 0x256
HAL hal_id : sensors
HAL hal_name : QTI Sensors HAL Module
HAL hal_author : Qualcomm Technologies, Inc.
get_sensors_list took 9779863069 nanoseconds
batch success
activate success
Activated sensor [Type: 8] ltr559 Proximity Sensor Wakeup (d) for 30
seconds, sampling at 10.000000 Hz and reporting at 10.000000 Hz
[Type: 8] android.sensor.proximity (wakeup)
Name:ltr559 Proximity Sensor Wakeup Vendor:Lite-On Version:256 Handle:27
maxRange: 1.000000 resolution: 0.100000 power: 0.150000 mA
minDelay: 0 us maxDelay: 0 us
fifoReservedEventCount: 300 fifoMaxEventCount: 10000
requiredPermission:
Sleeping for 30 seconds before deactivating and exiting
237290.761418, android.sensor.proximity/ltr559 Proximity Sensor Wakeup,
1547459690500.729312, 1.000000, 0.000000, 0.000000, 0.000000,
1065353216, latency(ms): 16899284620499.583722
242050.179333, android.sensor.proximity/ltr559 Proximity Sensor Wakeup,
1547459695247.851604, 0.000000, 0.000000, 0.000000, 0.000000, 0,
latency(ms): 16899284620511.879345
4.10 Camera
The device supports four camera interfaces as shown in the following figure:
Tracking
ToF
OV885
6
Stereo
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 29
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
The sensor ID changes depending on the number of camera sensors connected simultaneously.
Use the following matrix to calculate the ID for the camera devices attached in various
combinations:
For example:
Sr.No 1.4: Here we are connecting only one of the supported sensors. “cameraID = 0” will
select “Tracking”
Sr.No 2.3: Here we are connecting stereo camera along with tracking( 2 camera sensor
scenario). In this case, “cameraID=1” will select “Tracking” while “cameraID=0” will select
“Stereo”
The hal3_test application is available to capture image streams provided by the cameras. This
application is written using the HAL3 API.
To run the hal3_test application, log in to the device as a root (using serial or adb shell).
$ adb shell
# hal3_test -h
Enter Camera Testing
================== Camera Test Version ==================
CAMTEST_SHA1 : 0aea4e256a34e2eaa014d251c2a794b684c70e00
CAMTEST_BUILD_TS: 10/24/2018 12:6:35
CAMTESTHOSTNAME : ecbld-bd116-lnx.qualcomm.com
CAMBUILD_IP : 10.225.16.179/23
===========================================================
opt:h
usage: hal3_test [-h] [-f command.txt]
-h show usage
-f using commands in file
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 30
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
command in program:
<order>:[Params]
Orders:
A: ADD a camera device for test
>>A:id=0,psize=1920x1080,pformat=yuv420,ssize=1920x1080,sformat=jpeg
U: Update meta setting
>>U:manualaemode=1
D: Delete current camera device
>>D
S: trigger Snapshot and dump preview/video
>>Ss:2 num take num(1,2,..) picture(s), eg. s:1
s: trigger Snapshot
>> s:num take num(1,2,..) picture(s), eg. S:2 S:2
v: triger video that switch from preview
>>v:id=0,psize=1920x1080,pformat=yuv420,vsize=1920x1080,ssize=1920x1080,
sformat=jpeg
p: trigger dump Preview
>> p:num dump num(1,2,..) preview frame(s), eg. p:3 p:2
M: set Metadata dump tag
>>M:expvalue=1,scenemode=0
Q: Quit
4.10.1 Main Camera (OV8856)
NOTE: The default directory where hal3_test saves files is: /data/misc/camera/.
Start the camera with preview mode (size:1920x1080, format:YUV420)
pszie: set preview size.
pformat: set preview format and support format: yuv420, yuv_ubwc, raw10,raw8,raw16.
P:1, dump one preview frame.
$ adb shell
# hal3_test
CAM0>> A:id=2,psize=1920x1080,pformat=yuv420
CAM0>> P:1
CAM0>> D
CAM0>> Q
# exit
$ adb pull /data/misc/camera/”filename” .
Set the camera auto awb mode.
manualawbmode: set manual abw mode(0:off 1:auto)
file=ALOGE, tag=MyTest: enable monitor abw status, using ALOG to output log with
MyTest tag.
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 31
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
$ adb shell
# hal3_test
CAM0>> A:id=2,psize=1920x1080,pformat=yuv420
CAM0>> M:awbmode=1,file=ALOGE,tag=MyTest
CAM0>> U:manualawbmode=1
CAM0>> P:1
CAM0>> D
CAM0>> Q
# exit
$ adb pull /data/misc/camera/”filename” .
Start preview with manual ae mode on.
manualaemode: set manual aemode(0:off, 1:on)
$ adb shell
# hal3_test
CAM0>> A:id=2,psize=1920x1080,pformat=yuv420
CAM0>> M:aemode=1,file=ALOGE,tag=MyTest
CAM0>> U:manualaemode=1
//Test under Lowlight
CAM0>> P:5
//switch to Brightlight
CAM0>> P:5
CAM0>> D
CAM0>> Q
# exit
$ adb pull /data/misc/camera/”filename” .
Start preview with snapshot (size:3264x2448,format:jpeg)
sszie: set snap shot size.
sformat: set snap shot format, support format: yuv420, jpeg, raw10,raw16.
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,ssize=3264x2448,sformat=jpeg
CAM0>> P:1
CAM0>> s:1
CAM0>> D
CAM0>> Q
# exit
$ adb pull /data/misc/camera/”filename” .
Snapshot with auto awb mode.
$ adb shell
# hal3_test
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 32
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
CAM0>> A:id=2,psize=1920x1080,pformat=yuv420,ssize=3264x2448
,sformat=jpeg
CAM0>> M:awbmode=1,file=ALOGE,tag=MyTest
CAM0>> U:manualawbmode=1
CAM0>> P:1
CAM0>> s:1
CAM0>> D
CAM0>> Q
# exit
$ adb pull /data/misc/camera/”filename” .
Snapshot_Camera_Auto Flicker Detection
manualantimode: set manual antimode(0:off,1:50HZ,2:60HZ,3:auto)
zslmode: en/disable zsl mode(0:disalbe,1:enable)
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,ssize=3264x2448,sformat=jpeg
CAM0>> M:zslmode=1,ae_antimode=1,file=ALOGE,tag=MyTest
CAM0>> U:manualantimode=3,manualzslmode=1
CAM0>> s:1
CAM0>> U:manualantimode=2,manualzslmode=1
CAM0>> s:1
CAM0>> U:manualantimode=1,manualzslmode=1
CAM0>> s:1
CAM0>> U:manualantimode=0,manualzslmode=1
CAM0>> s:1
CAM0>> D
CAM0>> Q
# exit
$ adb pull /data/misc/camera/”filename” .
Snapshot_ Camera_Digital Zoom
manualcropregion: set zoom parameters(leftxtopxwidthxheight),
e.g., 1306x979x653x490(crop region left:1306, top:979,width:653,height:490)
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,ssize=3264x2448,sformat=jpeg
CAM0>> M:zslmode=1,zoomvalue=1,file=ALOGE,tag=MyTest
CAM0>> U:manualzslmode=1,manualcropregion=0x0x3264x2448
CAM0>> P:1
CAM0>> s:1
CAM0>> U:manualzslmode=1,manualcropregion=1306x979x653x490
CAM0>> P:1
CAM0>> s:1
CAM0>> U:manualzslmode=1,manualcropregion=1428x1071x408x306
CAM0>> P:1
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 33
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
CAM0>> s:1
CAM0>> D
CAM0>> Q
# exit
$ adb pull /data/misc/camera/”filename” .
Snapshot_Camera_MFNR
Turn on MFNR:
$ adb root
$ adb remount
$ adb shell mount -o rw,remount /
$ adb shell echo "overrideEnableMFNR=TRUE" >
/vendor/etc/camera/camxoverridesettings.txt
$ adb shell echo "advanceFeatureMask=0x02" >>
/vendor/etc/camera/camxoverridesettings.txt
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,ssize=3264x2448,sformat=jpeg
CAM0>> M:zslmode=1,file=ALOGE,tag=MyTest
CAM0>> U:manualzslmode=1
CAM0>> P:1
CAM0>> s:1
CAM0>> D
CAM0>> Q
# exit
$ adb pull /data/misc/camera/”filename” .
Turn off MFNR:
$ adb shell "echo "overrideEnableMFNR=False" >
/vendor/etc/camera/camxoverridesettings.txt"
$ adb shell "echo "advanceFeatureMask=0x01" >>
/vendor/etc/camera/camxoverridesettings.txt"
$ adb reboot
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,ssize=3264*2448,sformat=jpeg
CAM0>> M:zslmode=1,file=ALOGE,tag=MyTest
CAM0>> U:manualzslmode=1
CAM0>> P:1
CAM0>> s:1
CAM0>> D
CAM0>> Q
# exit
$ adb pull /data/misc/camera/”filename” .
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 34
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Camera video recording with fps:30,encoder:h264, size:1920x1080,bitrate:16Mbit.
vsize: set video size.
codectype: select encoder(0:H264/avc, 1:H265/hevc)
fpsrange: set sensor fps. If you want a variable fps mode, you can use format like this
fpsrange=min-max.
bitrate: set encoder output bitrate(Mb)
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,vsize=1920x1080,ssize=3264x2448
,sformat=jpeg,fpsrange=30-30,codectype=0,bitrate=16
CAM0>> D
CAM0>> Q
Camera video recording with fps:30,encoder:h265, size:1920x1080,bitrate:8Mbit
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,vsize=1920x1080,ssize=3264x2448,sf
ormat=jpeg,fpsrange=30-30,codectype=1,bitrate=8
CAM0>> D
CAM0>> Q
Camera video recording with MCTF on,
The video file is saved on /data/misc/camera/ path and can get this file by adb pull cmd, this
video can be play with various video player on PC that support H264 decoding.
$ adb root
$ adb remount
$ adb shell mount -o rw,remount /
$ adb shell "echo "advanceFeatureMask=0x01">
vendor/etc/camera/camxoverridesettings.txt"
$ adb shell "echo logVerboseMask=0xFFFFFFFF>>
/vendor/etc/camera/camxoverridesettings.txt"
$ adb shell "echo enableMCTF=TRUE>>
/vendor/etc/camera/camxoverridesettings.txt"
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,vsize=1920x1080,ssize=3264x2448,sf
ormat=jpeg,fpsrange=30-30,codectype=0
CAM0>> P:1
CAM0>> D
CAM0>> Q
Turn off MCTF:
$ adb shell "echo "advanceFeatureMask=0x01">
/vendor/etc/camera/camxoverridesettings.txt"
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 35
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
$ adb shell "echo logVerboseMask=0xFFFFFFFF>>
/vendor/etc/camera/camxoverridesettings.txt"
$ adb shell "echo "enableMCTF=False">>
/vendor/etc/camera/camxoverridesettings.txt"
$ adb reboot
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,vsize=1920x1080,ssize=3264x2448,sf
ormat=jpeg,fpsrange=30-30,codectype=0
CAM0>> P:1
CAM0>> D
CAM0>> Q
Camera video recording and live shot.
$ adb shell
# hal3_test
CAM0>>
A:id=2,psize=1920x1080,pformat=yuv420,ssize=3264x2448,sformat=jpeg,vsize
=1920x1080,codectype=0,fpsrange=30-30
CAM0>> P:1
CAM0>> s:1
CAM0>> D
CAM0>> Q
4.10.2 Tracking (OV7251)
Preview_Camera_640*480 dump raw
$ adb shell
# hal3_test
CAM0>> a:id=3,psize=640x480,pformat=raw10
CAM0>> P:1
CAM0>> D
CAM0>> Q
#exit
$ adb pull /data/misc/camera/”filename” .
Check raw picture with Chromatix software or using imageJ
(https://imagej.nih.gov/ij/)”tools
4.10.3 Stereo camera
Depth Camera_Preview_720P_ Dump RAW:
$ adb shell setprop persist.al.miniisp.camx.stop 1
$ adb shell setprop persist.al.camera.depth.dump 1
$ adb shell setprop persist.al.dump.count 5
$ adb shell setprop persist.al.scid 4
# hal3_test
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 36
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
CAM0>>
A:id=0,psize=1280x720,pformat=yuv420,ssize=1280x720,sformat=jpeg,altek=1
CAM0>> Quit
# exit
$ adb pull /data/misc/camera/”filename” .
1. Use AltekImageViewer.exe tool to check raw files.
Get AltekImageViewer.exe at:
https://thundercomm.s3-ap-northeast-
1.amazonaws.com/shop/doc/1544580412842651/dcb966535a9949c2bcbed32939264678-
1604404334
2. Run the executable.
3. After installing, launch the application.
4. From the File menu, select Open. With the default configuration, an image similar to the
following will be displayed:
4.10.4 ToF Dump RAW
ToF camera 640x480 dump raw 2vc iRGB+depth:
$ adb shell
# testapp
# 0 //Select mode, 0:near 1: far
# 2 //press 2 will dump 10 frames to the path: “/output/”. and
exit.
# ls /output/
bg_0001.raw bg_0007.raw depth_0003.raw depth_0009.raw ir_0005.raw
bg_0002.raw bg_0008.raw depth_0004.raw depth_0010.raw ir_0006.raw
bg_0003.raw bg_0009.raw depth_0005.raw ir_0001.raw ir_0007.raw
bg_0004.raw bg_0010.raw depth_0006.raw ir_0002.raw ir_0008.raw
bg_0005.raw depth_0001.raw depth_0007.raw ir_0003.raw
ir_0009.raw
bg_0006.raw depth_0002.raw depth_0008.raw ir_0004.raw
ir_0010.raw
$ adb pull /output/ .
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 37
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Use imageJ tool to check raw files.
Get imageJ at:
https://imagej.nih.gov/ij/
Guide of imageJ:
1. From the File menu, select Open.
2. Use the following configuration.
depth : 640 x 480.
ir or bg : 320 x 240.
image type : 16-bits unsigned.
3. An image similar to the following will be displayed(ir + bg + depth):
TOF camera temperature feature:
$ adb shell
# testapp
# 0 //Select mode, 0:near 1: far
# 1 //Display the current temperature of the TOF camera, as
shown below.
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 38
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4.10.5 Three camera concurrency mode
Connect the camera sensors in the following table before running the test app. To enable each
camera, see the camera ID shown:
Camera module name
Stereo
ToF
OV8856
Tracking
Camera ID
0
1
2
3
Whether Depend on ISP
Yes
No
Yes
No
There are only two ISP interfaces on Robotics DK. As soon as ToF is enabled both the ISPs are
automatically selected for ToF consumption. During the concurrency mode, enable other camera
sensors before enabling ToF/Tracking. This prevents the ToF camera from occupying the ISP
interface on the Robot DK.
Enable preview of Main+Tracking+ToF:
adb shell
# hal3_test
A:id=2,psize=1920x1080,pformat=yuv420
P:1
A:id=3,psize=640x480,pformat=raw10
P:1
A:id=1,psize=640x480,pformat=raw16,dsize=640x480,dformat=raw16
P:1
D
Q
Enable preview of Main+Stereo (depth)+ToF:
adb shell
#hal3_test
A:id=2,psize=1920x1080,pformat=yuv420
P:1
A:id=0,psize=1280x720,pformat=yuv420,ssize=1280x720,sformat=jpeg,altek=1
A:id=1,psize=640x480,pformat=raw16,dsize=640x480,dformat=raw16
P:1
D
Q
Enable preview of Tracking+Stereo (depth)+ToF:
adb shell
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 39
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
#hal3_test
A:id=3,psize=640x480,pformat=raw10
P:1
A:id=0,psize=1280x720,pformat=yuv420,ssize=1280x720,sformat=jpeg,altek=1
A:id=1,psize=640x480,pformat=raw16,dsize=640x480,dformat=raw16
P:1
D
Q
NOTE: Choose only one resolution for each camera for example. More resolution for each camera please
check the spec of camera module.
4.11 Video
Download the test file from:
https://thundercomm.s3-ap-northeast-
1.amazonaws.com/shop/doc/1544580412842651/1b61950baae5470c86f96cd229b2bc01-
645602035
H264_1920_1080_60fps;
1920_1080_60fps.mp4;
1920_1080.yuv
4.11.1 OMX
Configure the macro environment, mainly used to set the input and output video path.
MasterConfig.xml:
<xml>
<InputFileRoot>/data/input/</InputFileRoot>
<OutputFileRoot>/data/output/</OutputFileRoot>
</xml>
SampleDecode.xml:
<xml>
<DecodeSession>
<TestCaseID>1920_1080</TestCaseID>
<CompressionFormat>VIDEO_CodingAVC</CompressionFormat>
<InputFile>H264_1920_10803840_2160_60fps</InputFile>
<session_mode>dec</session_mode>
<SinkType>FILE</SinkType>
<PlaybackMode>1</PlaybackMode>
<SourceHeight>1080</SourceHeight>
<SourceWidth>1920</SourceWidth>
<OutputHeight>1080</OutputHeight>
<OutputWidth>1920</OutputWidth>
</DecodeSession>
</xml>
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 40
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Decode command:
$ adb shell mkdir /data/input /data/output
$ adb push MasterConfg.xml /data/
$ adb push H264_3840_2160_60fps /data/input/
$ adb push SampleDecode.xml /data/
$ adb shell
# mm-vidc-omx-test /data/ /data/ SampleDecode.xml
Frame Num= 299 file_offset=0x0 frame_size=0x40f0 pBuffer=0xebac1000
fileoffset:0x4b909b status:0x0
Frame Num= 300 file_offset=0x0 frame_size=0x40f0 pBuffer=0xeb401000
fileoffset:0x4bd18b status:0x0
VT_CONSOLE RunTest::69 Test passed
# ls -al /data/output/
-rw-rw-rw- 1 root root 940032000 Dec 29 20:10 1920_1080.yuv
Decode video check. With the YUV player, the format is set to NV12.
H264 resolution setting:
Height: H/16 == 0 ? H ; (H/16 +1)*16
Width: W/16 == 0 ? W ; (W/16 +1)*16
HEVC resolution setting:
Height: H/32 == 0 ? H ; (H/23 +1)*32
Width: W/32 == 0 ? W ; (W/32 +1)*32
Examples:
1920*1080 H264 decode output YUV file
Format: NV12
H: 1920
W: 1088
1280*720 HEVC decode output YUV file
Format: NV12
H: 1280
W: 736
4.11.2 GST
Environmental configuration:
$ adb shell
# export GST_REGISTRY=/data/gstreamer-1.0/registry.$(uname -m).bin
# export GST_REGISTRY_UPDATE=no
# gst-inspect-1.0 > /dev/null
Decoder/Encoder
Decoder:SW (Software Decoder):
# gst-launch-1.0 -e filesrc location=/data/input/1920_1080_60fps.mp4
! qtdemux name=demux demux. ! queue ! h264parse ! avdec_h264 !
filesink location=/data/output/1920_1080_60.yuv
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 41
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:08.570580309
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Decoder:HW (Hardware Decoder):
# gst-launch-1.0 -e filesrc location=/data/input/1920_1080_60fps.mp4
! qtdemux name=demux demux. ! queue ! h264parse ! omxh264dec !
filesink location=/data/output/1920_1080_60hw.yuv
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:08.476530986
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 42
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Encoder:HW (Hardware Encoder):
# gst-launch-1.0 -e filesrc location=/data/input/1920_1080.yuv !
videoparse width=1920 height=1080 format=nv12 framerate=60 !
omxh264enc target-bitrate= 800000000 quant-p-frames=59 quant-b-
frames=0 control-rate=variable ! 'video/x-
h264,streamformat=(string)byte-stream,profile=high' ! h264parse !
filesink location=/data/output/1920_1080_60.h264
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:10.204220673
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
4.12 OpenGL ES
1. Get the test file from:
https://thundercomm.s3-ap-northeast-
1.amazonaws.com/shop/doc/1544580412842651/29c53bd1bc674e6ebd176e47565cb75f-
1645658038
2. Extract the downloaded file:
$ unzip Robotics-opengles-testbin.zip
$ tree Robotics-opengles-testbin/
Robotics-opengles-testbin/
└── es11
├── es11_32
│ ├── conform_cl
│ ├── conform_cm
│ ├── covegl
│ ├── covgl_cl
│ ├── covgl_cm
│ ├── primtest_cl
│ └── primtest_cm
├── es11_64
│ ├── conform_cl
│ ├── conform_cm
│ ├── covegl
│ ├── covgl_cl
│ ├── covgl_cm
│ ├── primtest_cl
│ └── primtest_cm
└── push.sh
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 43
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Upload test commands to the device:
$ adb root
$ adb remount
$ adb shell mount -o remount rw /
$ adb shell mount -o remount rw /data
$ adb shell mkdir p /data/testApp/es11
$ adb push es11_64 /data/testApp/es11
$ adb shell chmod 777 /data/testApp/es11/*
OpenGL ES conformance test:
$ adb shell
# cd /data/testApp/es11
# ./conform_cl -h
Options:
-1 <test> Single test using "test" id.
-c <id> Use config id.
-C [1-1] Use predefined config.
-f <file> Use test set in "file".
-g <file> Generate test set in "file".
-h Print this help screen.
-l <file> Generate logfile.
-p [1-4] Set path level.
-r <seed> Set random seed.
-s Skip state check.
-v [0-2] Verbose level.
-x Force fail for config tests.
Execute the example as follows (testing process can take up to five hours):
# ./conform_cl -r 32555 -1 mustpass.log
OpenGL ES Conformance Test
Version CONFORM_VERSION (CONFORM_DATE)
Setup Report.
Verbose level = 1.
Random number seed = 32555.
Path inactive.
Config Report.
Config ID = 1.
RGBA (5, 6, 5, 0).
Default State test passed.
Must Pass test passed.
… …
Config Report.
Config ID = 63.
RGBA (8, 8, 8, 8).
Stencil (8).
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 44
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Depth (24).
Config is identified as NON_CONFORMANT.
It may be rendered to using an OpenGL ES context.
******************** SUMMARY OF 'conform' RESULTS ********************
SUMMARY: NO tests failed at any path level.
SUMMARY: 48 conformant configs, 12 non-conformant configs.
****************** END SUMMARY OF 'conform' RESULTS ******************
4.13 LTE Module
Note: This section explains the how to validate the Serria LTE module on Qualcomm® cellular
mezzanine board.
Please look at the picture,it shows the Serria LTE module,SIM1 Slot,SIM2 Slot.
Select active SIM interface
Before using SIM interface,you need to select it.
For selecting first SIM interface:
# echo -e "AT!UIMS=0?\r\n" > /dev/ttyUSB2
# cat /dev/ttyUSB2
AT!UIMS=0?
OK
For selecting second SIM interface:
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 45
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
# echo -e "AT!UIMS=1?\r\n" > /dev/ttyUSB2
# cat /dev/ttyUSB2
AT!UIMS=1?
OK
Check if the SIM card exists
The following is the case of success.
# echo -e "AT+CPIN?\r\n" > /dev/ttyUSB2
# cat /dev/ttyUSB2
+CME ERROR: SIM not inserted
Or
The following is the case of failure.
# echo -e "AT+CPIN?\r\n" > /dev/ttyUSB2
# cat /dev/ttyUSB2
AT+CPIN?
+CPIN: READY
OK
4.14 Software tools and libraries
4.14.1 ROS
ROS configuration :
# adb shell
# cd /opt/ros/indigo/
/opt/ros/indigo # bash
bash-4.4#source ./ros-env.sh
bash-4.4# roscore &
[1] 4065
bash-4.4# ... logging to /home/root/.ros/log/7ce256f6-2def-11e9-8312-
4962d813cee8/roslaunch-sda845-4065.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://localhost:46837/
ros_comm version 1.11.21
SUMMARY
========
PARAMETERS
* /rosdistro: indigo
* /rosversion: 1.11.21
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 46
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
NODES
auto-starting new master
process[master]: started with pid [4077]
ROS_MASTER_URI=http://localhost:11311/
setting /run_id to 7ce256f6-2def-11e9-8312-4962d813cee8
process[rosout-1]: started with pid [4090]
started core service [/rosout]
Run hello_world:
bash-4.4# cd bin/
bash-4.4# ./hello_world
[ INFO] [1549016659.810443307]: hello_world
[ INFO] [1549016660.813989869]: hello_world
[ INFO] [1549016661.811489139]: hello_world
[ INFO] [1549016662.810563462]: hello_world
[ INFO] [1549016663.814270649]: hello_world
[ INFO] [1549016664.813896326]: hello_world
[ INFO] [1549016665.810701117]: hello_world
[ INFO] [1549016666.811449241]: hello_world
[ INFO] [1549016667.814292783]: hello_world
[ INFO] [1549016668.811408459]: hello_world
[ INFO] [1549016669.811502782]: hello_world
[ INFO] [1549016670.814295125]: hello_world
Log painting "[ INFO] [TimeTag]: hello_world" and there should be no
failure to return.
4.14.2 Qualcomm® Hexagon™ Vector eXtensions (HVX)
Hexagon DSP SDK supports the RB3 Platform. For details see:
https://developer.qualcomm.com/software/hexagon-dsp-sdk
This section provides a step-by-step guide to build, load, and execute the calculator example on
Robotics in an Ubuntu environment.
4.14.2.1 Hexagon SDK environment construction
1. Hexagon SDK download:
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 47
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
https://developer.qualcomm.com/software/hexagon-dsp-sdk/tools
a. The installer takes care of downloading and installing all Hexagon SDK dependencies.
b. To get started with the Hexagon SDK, open a new terminal and run
setup_sdk_env.source.
This script configures the local environment. These changes are not persistent in the
terminal instance, so you must run setup_sdk_env.source on each terminal you want to
develop in.
$ cd < Hexagon SDK root directory, default is:
~/Qualcomm/Hexagon_SDK/<version> >
$ source setup_sdk_env.source
2. Hexagon tool (Hexagon.LLVM_linux_installer_8.1.05.bin) needs to go to the website below
to apply. https://developer.qualcomm.com/software/hexagon-dsp-sdk/tool-request
When Qualcomm approves your application, you will receive an email with a download link.
Download the tool and install it.
3. Linux cross-compilation tool
This version of Hexagon SDK supports Android and certain versions of Linux distributions
(Yocto and Linaro). Android is supported by variants starting with Android (e.g.,
Android_Debug). Linux is supported by variants starting with Ubuntu (e.g., Ubuntu_Debug).
The binaries (executables and libs) are provided for both HLOS.
The cross compilation tools for Linux are not provided with the Hexagon SDK. You need to
download these separately and install them under <SDK_ROOT>/tools/linaro. If you do this,
then you will be able to build Ubuntu variants for the examples. The examples are tested with
gcc-linaro-4.9.
Steps to build 64 bit ubuntu binaries on Linux:
a. Download gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu.tar.xz from:
http://releases.linaro.org/archive/14.11/components/toolchain/binaries/aarch64-linux-gnu
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 48
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
b. Extract the tar file and copy folder gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu to
<Hexagon_SDK_ROOT>/tools/ folder.
c. Rename gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu folder to linaro and try
building with make tree V=UbuntuARM_Debug_aarch64.
Steps to build 32 bit ubuntu binaries on Linuxs:
a. Download gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabi.tar.xz from:
http://releases.linaro.org/archive/14.11/components/toolchain/binaries/arm-linux-gnueabi
b. Extract the tar file and copy folder gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabi to
<Hexagon_SDK_ROOT>/tools/ folder.
c. Rename gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabi folder to linaro and try
building with make tree V=UbuntuARM_Debug.
4.14.2.2 Building
When building the calculator example, both the stub and skeleton must be compiled and linked.
This can be done by compiling both for the variant desired on the DSP as well as the application
processor.
For example, to create a stub/skel pair for Linux and Hexagon, the following commands must be
executed:
$ cd ~/Qualcomm/Hexagon_SDK/3.4.1
$ source setup_sdk_env.source
$ cd examples/common/calculator
$ make tree V=hexagon_Debug_dynamic_toolv81_v65 CDSP_FLAG=1
$ make tree V=UbuntuARM_Debug_aarch64 CDSP_FLAG=1
Compiled file:
$ tree UbuntuARM_Debug_aarch64/ship/
UbuntuARM_Debug_aarch64/ship/
├── calculator
├── calculator_test.so
└── libcalculator.so
$ tree hexagon_Debug_dynamic_toolv81_v65/ship/
hexagon_Debug_dynamic_toolv81_v65/ship/
├── libcalculator_skel.a
└── libcalculator_skel.so
4.14.2.3 On-target testing
To execute the calculator test on Robotics perform the following steps:
$ cd ~/Qualcomm/Hexagon_SDK/3.4.1/examples/common/calculator
$ adb push hexagon_Debug_dynamic_toolv81_v65/ship/libcalculator_skel.so
/usr/lib/rfsa/adsp/
$ adb push UbuntuARM_Debug_aarch64/ship/libcalculator.so /usr/lib64/
$ adb push UbuntuARM_Debug_aarch64/ship/calculator /usr/bin/
To install the TestSig on device:
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 49
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
1. First discover the device serial number. The following steps print out the device serial
number.
$ cd ~/Qualcomm/Hexagon_SDK/3.4.1
$ adb push
tools/elfsigner/getserial/UbuntuARM_Release_aarch64/getserial
/usr/bin/
$ adb shell /usr/bin/getserial
/usr/bin/getserial: /usr/lib64/libadsprpc.so: no version information
available (required by /usr/bin/getserial)
###################Serial number (see below)#########################
Serial Num : 0x2f5800d6
###################Serial number (see above)#########################
Next generate a test signature based on that serial number and push it to the device. The
test signature is discovered on boot so a reboot is required.
$ cd ~/Qualcomm/Hexagon_SDK/3.4.1
$ source setup_sdk_env.source
$ python tools/elfsigner/elfsigner.py -t 0x2f5800d6
Logging to ~/Qualcomm/Hexagon_SDK/3.4.1/output/Elfsigner_log.txt
Attention:
Use of this tool is conditioned upon your compliance with
Qualcomm Technologies'(and its affiliates') license terms and
conditions; including, without limitations, such terms and
conditions addressing the use of such tools with open source
software.
Agree? [y/n]:
y
Signing a file may take up to 3 minutes due to network connectivity.
Please wait patiently.
------------------------------------------------------------
Signing complete! Output saved at
/home/lizc/Qualcomm/Hexagon_SDK/3.4.1/output/testsig-0x2f5800d6.so
$ adb push output/testsig-0x2f5800d6.so /usr/lib/rfsa/adsp/
$ adb reboot
Execute the example as follows:
$ adb shell
# calculator 1 1000 // Run Calculator Example Locally on CPU
- starting calculator test
- allocate 4000 bytes from ION heap
- creating sequence of numbers from 0 to 999
- compute sum locally
- sum = 499500
- success
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 50
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
# calculator 0 1000 //Run Calculator Example on DSP
- starting calculator test
- allocate 4000 bytes from ION heap
- creating sequence of numbers from 0 to 999
- compute sum on the DSP
- sum = 499500
- success
4.14.3 FastCV
FastCV is designed for efficiency on all ARM-based processors, but is tuned to take advantage of
the Qualcomm® Snapdragon™ processor (S2 and above). This gives you the most widely used,
computationally intensive vision processing APIs, with hardware acceleration and better
performance on mobile devices.
1. Download “fastcv_test_data” test resources from:
https://www.thundercomm.com/
Push the test resource to the device:
$ adb push fastcv_test_data /data/
The test commands are divided into 64bit and 32bit. The following is introduced with 64bit:
$ adb shell
# lib64_fastcv_test
USAGE: lib64_fastcv_test test_data_directory [-l loops] [-m module_name]
[-p power_level][-E] [-S resolution#] [-f func_name] [-t target] [-M
operation_mode] [-OPT] [-s see] [-nbp] [-o] [-U] [-P]
OPTIONS
----------------------------------------------------------------
-nbp
Uses mallocs instead of internal buffer pool for
scratch/temporary buffers.
-psb nPreAllocBytes
Enable Preallocate Scratch Buffers
nPreAllocBytes is the number of bytes for the pre-allocated
buffer.
-l +integer
0 = [default] do not profile
+integer = loops to use when profiling.
-m string
String name of module to limit to. Valid strings in order are:
HW, MEM, DEPTH, DOT, SSD, IIMG, IIMGYUV, IDIFF, TRNS, WARP,
3CHANNELWARP,COLORYUVRGB, COLORYUV, COLORRGB, SCALE, BLUR, EDGES,
SCHARR, SAD, FAST10, DESCRIPTOR,, THRESH, COPY, VEC, KMEANS, AFFINEEVAL,
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 51
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
AFFINEFIT, HOMOGRAPHYEVAL, HOMOGRAPHYFIT, POSEEVAL, POSEREFINE,
3POINTPOSEEST, KDTREE, LINEARSEARCH, BITCNT, BITWISEOP, OFBM, BOUNDRECT,
UPSAMPLE, IPP, IPPTRANSFORM, CONTOUR, SOLVE, PERSPTRANSFORM, SET,
ADAPTTHRESH, SFGMASK, ABSDIFF, QUAD, AVERAGE, SHIFT, FLOODFILL, MOTION,
SVD, POLYGON, BGCODEBOOK, DRAWCONTOUR, HOUGHCIRCLE, HOUGHLINE,
CALIBRATE, REMAP, PYRAMID, IMGSEGMENTATION, LBP, FFT, CORNERSUBPIX,
CHANNEL, STATS, NCC, FIR, FAST, IMGINTENSITY, EDGE, KLT, MINMAX,
KMEANSTREESEARCH, SMOOTH, ARITHM, SVM, HARRIS, MSER
-f string
String name of function to limit to. Make sure to specify
corresponding module using -m. Valid strings are:
fcvNCCPatchOnCircle8x8u8, fcvNCCPatchOnSquare8x8u8,
fcvCornerFast9u8, fcvCornerFast9Scoreu8,
fcvCornerFast9Scoreu8_v2,
… …
fcvSubtractu8, fcvSubtracts16, fcvSubtractu8s16,
fcvAddWeightedu8, fcvAddSquaredu8u16,
fcvGLBPu8, fcvFFTu8, fcvIFFTf32, fcvCornerRefineSubPixu8
Note: Not all modules have function limit functionality yet.
Please use this option with module limit option to limit to
a particular function.
-e string
String name of exhaustive test data directory.
-p integer
Power mode to run QDSP in. Valid values are:
0 = minimum power mode
1 = normal power mode
2 = [default] maximum power mode
-t integer
Integer value indicating target. Valid values are:
FASTCV_ALL_TARGETS = 0; FASTCV_UNIT_ARM = 2; FASTCV_UNIT_VENUM =
4;
FASTCV_UNIT_QDSP = 8; FASTCV_UNIT_FPGA = 16; FASTCV_UNIT_GPU = 32
FASTCV_UNIT_C2D = 64; FASTCV_UNIT_VFP = 128; FASTCV_UNIT_ARMv7 =
256
FASTCV_UNIT_DMA = 512; FASTCV_UNIT_QDSP_TEST = 1024;
-M integer
Integer value indicating operation mode. Valid values are:
Skip operation mode test = 0
FASTCV_OP_LOW_POWER = 1; FASTCV_OP_PERFORMANCE = 2;
FASTCV_OP_CPU_OFFLOAD = 4
Combination FASTCV_OP_LOW_POWER & FASTCV_OP_PERFORMANCE = 3
Combination FASTCV_OP_LOW_POWER & FASTCV_OP_CPU_OFFLOAD = 5
Combination FASTCV_OP_PERFORMANCE & FASTCV_OP_CPU_OFFLOAD = 6
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 52
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
All Combination FASTCV_OP_LOW_POWER & FASTCV_OP_PERFORMANCE &
FASTCV_OP_CPU_OFFLOAD = 7
-OPT
Use this option with [-M operation_mode] to skip unit testing on
individual processing units and test only operation tables
-s seed
Seed for random number generator.
-o
FLAG to enable opencv benchmark profiling Results
-L +integer
Tells the number of iterations for profiling a function on QDSP
with only single remoting overhead
-U
Enables only the Unit Tests while disabling the Performance
Tests
-P
Enables only profiling while disabling the unit Tests
-DF
Disables fuzzing check
-E
Enables exhaustive testing to validate profiling vectors
-S Resolution#
Resolution for profiling.. Deafult is VGA
-H
Enables QDSP test vectors to be allocated on ARM Heap instead of
ION
-AC
Bump up ARM clocks
-AL
ION allocation buffers are aligned to no more than element size.
No effect on heap allocated buffers.
-TWOp
Test a couple fastcv API without calling any fcvSetOperationMode
to run default C reference code.
Qualcomm® Robotics RB3 Platform Linux User Guide RB3 Platform Features and Use Cases
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 53
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
NOTE: Fast running functions will automatically have a loop
multiplier and the results will be normalized accordingly.
Execute the example as follows:
$ adb shell
# lib64_fastcv_test /data/fastcv_test_data/ -t 0 -l 1 -L 1 -m HW
FASTCV_PROFILE, CLOCKS: ARM cpu0: 1228800, cpu1: 1516800, cpu2: 1766400,
cpu3: 1766400
FASTCV_PROFILE, cpu4: 825600, cpu5: 825600, cpu6: 825600,
cpu7: 825600
FASTCV_PROFILE, QDSP clk : 939205026, bimc_clk: 0, snoc_clk: 0
FASTCV_PROFILE, PROFILING ORDER : REF, Venum, QDSP, QDSPw/oRem, GPU,
LowPower, Performance, CPUOffload, CPUPerformance,
FASTCV_PROFILE, FIT:(FeatureName=>FASTCV, Overall=>PASS)
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 54
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
5 Develop an application
To compile the C code to a binary file, install the Application SDK:
1. Download the Application SDK:
https://thundercomm.s3-ap-northeast-
1.amazonaws.com/shop/doc/1544580412842651/c442d6970fde481d9f9c9622596f72d0-
1350025057
2. Change to the sdk directory:
$ cd ROBOTICS-SDA845-LE-APP-SDK
$ ls
oecore-x86_64-aarch64-toolchain-nodistro.0.host.manifest
oecore-x86_64-aarch64-toolchain-nodistro.0.sh
oecore-x86_64-aarch64-toolchain-nodistro.0.target.manifest
oecore-x86_64-aarch64-toolchain-nodistro.0.testdata.json
3. Execute the oecore-x86_64-aarch64-toolchain-nodistro.0.sh command:
$ ./oecore-x86_ 64-aarch64-toolchain-nodistro.0.sh
4. To choose the default target directory, press Enter and type Y.
robot SDK installer version nodistro.0
======================================
Enter target directory for SDK (default: /usr/local/oecore-x86_64):
You are about to install the SDK to "/usr/local/oecore-x86_64".
Proceed[Y/n]? Y
Extracting SDK..................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to
source the environment setup script e.g.
$ . /usr/local/oecore-x86_64/environment-setup-aarch64-oe-linux
Qualcomm® Robotics RB3 Platform Linux User Guide Develop an application
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 55
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
$ . /usr/local/oecore-x86_64/environment-setup-armv7a-neon-oemllib32-
linux-gnueabi
Configure the system environment:
$ source /usr/local/oecore-x86_64/environment-setup-aarch64-oe-linux
Compile the command:
$ aarch64-oe-linux-gcc --sysroot=/usr/local/oecore-
x86_64/sysroots/aarch64-oe-linux -O2 -fexpensive-optimizations -frename-
registers -fomit-frame-pointer -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-
needed test.c -o test
5.1 Hello RB3
Once the Application SDK is installed, the first RB3 Hello application can be installed..
1. Create a source file and edit:
$ vi Hello.c
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf("Hello RB3 !!!\n");
return 0;
}
2. Build and transfer the application
a. Build the application:
$ aarch64-oe-linux-gcc --sysroot=/usr/local/oecore-
x86_64/sysroots/aarch64-oe-linux -O2 -fexpensive-optimizations -
frename-registers -fomit-frame-pointer -Wl,-O1 -Wl,--hash-style=gnu
-Wl,--as-needed Hello.c -o Hello
b. Connect to the PC via TYPE-C and ensure that the ADB port can be used. Transfer the
application:
$ adb push Hello /bin/
3. Execute the application:
$ adb shell
# chmod u+x /bin/Hello
# Hello
4. The terminal outputs the expected print information:
/ # Hello
Hello RB3!!!
Qualcomm® Robotics RB3 Platform Linux User Guide Develop an application
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 56
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
5.2 Sensors
As mentioned in Section 4.8.4, the device supports five sensor types: accelerometer, gyroscope,
magnetometer, proximity, and light.
5.2.1 Accelerometer example
The following example code illustrates how to integrate the accelerometer with your development
environment. It demonstrates how to obtain sensor data and link library files at compile time.
1. Create a source file and edit:
$ vi get_accel_data.c
1 #include <sensors.h>
2 #include <dlfcn.h>
3 #include <stdbool.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <string.h>
7 #include <time.h>
8 #include <unistd.h>
9 #include <getopt.h>
10 #include <inttypes.h>
11 #include <cutils/log.h>
12
13 #define HZ_TO_NSEC(hz) (1000000000LL/(hz))
14
15 extern struct sensors_module_t HAL_MODULE_INFO_SYM;
16
17 int find_sensor_by_name(char* sensor_name, struct sensor_t const*
list, const struct sensor_t **ret)
18 {
19 const struct sensor_t *list_p = list;
20
21 while( list_p->type) {
22 if(0 == strcmp( list_p->name,sensor_name)){
23 break;
24 }
25 list_p++;
26 }
27
28 //fprintf(stderr,"find_sensor_by_name %s \n",list_p->name);
29 *ret = list_p;
30
31 if ( list_p->type) {
32 return 0;
33 } else {
34 return -1;
35 }
36 }
Qualcomm® Robotics RB3 Platform Linux User Guide Develop an application
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 57
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
37
38
39 int main( int argc, char * const argv[] )
40 {
41 char command;
42 struct sensors_event_t data[100];
43 int count,i,error,times = 100,sensor_count;
44 const struct sensor_t *sensor_to_use;
45
46 struct sensors_poll_device_1 *dev;
47 struct sensors_poll_device_t *dev_old;
48 struct sensor_t *list = NULL;
49
50 double sampling_rate_hz = 10;
51 int64_t sampling_rate_nsecs = sampling_rate_hz == 0 ? 0 :
(uint64_t) HZ_TO_NSEC(sampling_rate_hz);
52 double report_rate_hz = 10;
53 int64_t report_rate_nsecs = report_rate_hz == 0 ? 0 :
(uint64_t) HZ_TO_NSEC(report_rate_hz);
54 char* sensor_name = "bst_bma2x2 Accelerometer Wakeup";
55
56 //Open sensor hal module
57 if(0 != HAL_MODULE_INFO_SYM.common.methods->open( NULL,
SENSORS_HARDWARE_POLL, (hw_device_t**)&dev ))
58 {
59 fprintf(stderr,"Hal open failure\n");
60 exit(1);
61 }
62
63 dev_old = (struct sensors_poll_device_t*) dev;
64
65 // Get the sensors_list
66 sensor_count = HAL_MODULE_INFO_SYM.get_sensors_list( NULL,
((struct sensor_t const**)&list) );
67 if ( sensor_count == 0 )
68 {
69 fprintf(stderr,"ERROR: No sensors in the list");
70 dev->common.close( (hw_device_t*)dev );
71 exit(1);
72 }
73
74 //Find the sensor to use
75 error = find_sensor_by_name(sensor_name, list,
&sensor_to_use);
76 if ( error ) {
77 fprintf(stderr, "ERROR: sensor not found!");
78 exit(1);
79 }
Qualcomm® Robotics RB3 Platform Linux User Guide Develop an application
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 58
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
80
81 //Batch the sensor
82 error = dev->batch( dev, sensor_to_use->handle, 0,
sampling_rate_nsecs, report_rate_nsecs );
83 if( error ) {
84 fprintf(stderr,"Error %d in batch\n", error );
85 exit(1);
86 }
87
88 //Active the sensor
89 error = dev->activate( dev_old, sensor_to_use->handle, true
);
90 if( error ) {
91 fprintf(stderr,"Error %d activating sensor\n", error
);
92 exit(1);
93 }
94
95 //Get and parse sensor data
96 while(times--){
97 count = 0;
98 memset(data,0,sizeof(data));
99 count = dev->poll( dev_old, data, 100 );
100
101 for( i = 0; i < count ; i++ ) {
102 printf("%s, %f, %f, %f, %f\n",
103 list[data[i].sensor-1].name,
104 data[i].data[0], data[i].data[1],
data[i].data[2], data[i].data[3]);
105 }
106 fflush(stdout);
107 }
108
109 fprintf(stderr, "Exiting...\n");
110
111 //DEACTIVATE the sensor
112 error = dev->activate( dev_old, sensor_to_use->handle, false
);
113 if( error ) {
114 fprintf(stderr,"Error %d deactivating sensor\n",
error );
115 exit(1);
116 }
117 //Close sensor hal module
118 dev->common.close( (hw_device_t*)dev_old );
119 return 0;
120 }
Qualcomm® Robotics RB3 Platform Linux User Guide Develop an application
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 59
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
For details about the HAL sensor module, see:/usr/local/oecore-
x86_64/sysroots/aarch64-oe-linux/usr/include/sensors_hal.h
2. Build and transfer the application.
a. Edit the Makefile:
OS.exec = uname -s
OS ?= $(shell $(OS.exec))$(OS.exec:sh)
OS := $(OS)
PROG = get_accel_data
CFLAGS ?= -O2 -fexpensive-optimizations -frename-registers -fomit-
frame-pointer
CFLAGS += -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed
CFLAGS += -D SNS_LE_QCS605
# Common library includes
LDLIBS = -lsensors.ssc
$(PROG): $(PROG).o
$(PROG).o: $(PROG).c $(HDR)
clean:
$(RM) $(PROG).o $(PROG)
sparse: $(PROG).c
$(SPARSE) $(CPPFLAGS) $(CFLAGS) $(SPARSEFLAGS) $^
.PHONY: clean
b. Build the application:
$ make
c. Connect the board to the host PC via Type C and ensure that the ADB port can be used.
Transfer the application:
$ adb push get_accel_data /bin/
Execute the application(Please make sure that SW5 of DIP_SW is
already open).
$ adb shell
# chmod u+x /bin/get_accel_data
# get_accel_data
3. Execute the application (ensure that SW5 of DIP_SW is open):
$ adb shell
# chmod u+x /bin/get_accel_data
# get_accel_data
Qualcomm® Robotics RB3 Platform Linux User Guide Develop an application
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 60
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4. The sensor data displays as shown:
bst_bma2x2 Accelerometer Wakeup, -0.459932, 0.382457, 10.080173
bst_bma2x2 Accelerometer Wakeup, -0.459932, 0.369618, 10.080173
bst_bma2x2 Accelerometer Wakeup, -0.459932, 0.373085, 10.080173
bst_bma2x2 Accelerometer Wakeup, -0.459932, 0.378987, 10.080173
bst_bma2x2 Accelerometer Wakeup, -0.459932, 0.383277, 10.080173
5.2.2 Other sensors
For other sensors, get the corresponding sensor data by modifying the variable sensor_name in
get_accel_data.c.
The name of sensor can be found using the sns_hal_batch -l command.
The correspondence table is as follows:
SW5
Sensor
Sensor_name
ON
Accelerometer
bst_bma2x2 Accelerometer Wakeup
Gyroscope
BMG160 Gyroscope Wakeup
Magnetometer
bosch_bmm150 Magnetometer Wakeup
Magnetometer
ak0991x Magnetometer Wakeup
Pressure
icp101xx Pressure Sensor Wakeup
OFF
Accelerometer
icm4x6xx Accelerometer Wakeup
Gyroscope
icm4x6xx Gyroscope Wakeup
Proximity
ltr559 Proximity Sensor Wakeup
Light
ltr559 Ambient Light Sensor Wakeup
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 61
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
6 Set Up the System SDK
The SDK in this chapter is used to compile the system image. The compiled image can be used
for the firmware update in Chapter 3.
1. Download the system SDK at:
https://thundercomm.s3-ap-northeast-
1.amazonaws.com/shop/doc/1544580412842651/2d2154597cc14cae894076b1d7d06e55-
1372688432
build@ubuntu$ unzip ROBOTICS-SDA845-LE-SDK.zip
build@ubuntu$ cd ROBOTICS-SDA845-LE-SDK
build@ubuntu$ ./sync_and_build.sh
2. Generate the ROBOTICS-SDA845_CAFBUILDID_VXX directory after the script is
completed to confirm successful SDK installation and configuration:
build@ubuntu$ ls ROBOTICS-SDA845_CAFBUILDID_VXX/poky/build/tmp-
glibc/deploy/images/sda845-robot
sda845-cache.ext4
sda845-sysfs.ext4
sda845-usrfs.ext4
sda845-boot.img
sda845-persist.ext4
sda845-systemrw.ext4
vmlinux
6.1 Build the SDK
6.1.1 Build images
Build all images with following commands:
$ cd <metabuild_root>/apps_proc/poky
$ source build/conf/set_bb_env.sh
$ build-sda845-robot-image
6.1.2 Build kernel image
1. Before compiling, go to the poky directory. In the poky directory, execute the following
commands to configure the environment:
build@ubuntu$ source build/conf/set_bb_env.sh
2. After executing the command, the directory automatically becomes poky/build. Execute the
following commands to configure some environment variables:
build@ubuntu$ export MACHINE=sda845
build@ubuntu$ export DISTRO=robot
Qualcomm® Robotics RB3 Platform Linux User Guide Set Up the System SDK
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 62
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
3. Ensure that the present work directory is poky/build. Compile the kernel image by executing
the following commands:
build@ubuntu$ bitbake -c cleansstate linux-msm
build@ubuntu$ bitbake linux-msm
The first command cleans the temporary compiling area. The second command compiles the
kernel image.
4. After compiling, the kernel image is located at:
$ poky/build/tmp-glibc/deploy/images/
6.1.3 Build rootfs image
1. Before compiling, go to the poky directory. In the poky directory, execute the following
commands to configure the environment:
build@ubuntu$ source build/conf/set_bb_env.sh
2. After executing the command, the directory automatically becomes poky/build. Execute the
following commands to configure some environment variables:
build@ubuntu$ export MACHINE=sda845
build@ubuntu$ export DISTRO=robot
3. Ensure that the present work directory is poky/build. Compile rootfs image by executing the
following commands:
build@ubuntu$ bitbake -c cleansstate machine-image
build@ubuntu$ bitbake machine-image
The first command cleans the temporary compiling area. The second command compiles the
rootfs image.
4. After compiling, the rootfs image is located at:
$ poky/build/tmp-glibc/deploy/images/
6.1.4 Add new module
Use clinfo to find out how to add an application to the file system.
1. Create a source file and edit:
$ cd apps_proc/poky/meta-qti-bsp/recipes-devtools/
$ mkdir clinfo
$ vi clinfo/clinfo_git.bb
SRC_URI = "https://github.com/Oblomov/clinfo/archive/2.2.18.04.06.zip"
SRC_URI[md5sum] = "863e4542a48d192203e47c7db34b9759"
SRC_URI[sha256sum] =
"9f438d3835f7a23049cc7d47df227c240ce65736c40b68f70eaf7cdd0114b7c2"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=fd8857f774dfb0eefe1e80c8f9240a7e"
DEPENDS = "adreno glib-2.0 system-core"
PR = "r0"
Qualcomm® Robotics RB3 Platform Linux User Guide Set Up the System SDK
Rev. A Confidential and Proprietary Qualcomm Technologies, Inc. 63
MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
PV = "2.2.18.04.06"
CPPFLAGS += " -I${RECIPE_SYSROOT}/usr/include"
CPPFLAGS += " -DLE_ENABLE"
LDFLAGS += " -L${RECIPE_SYSROOT}/usr/lib64"
LDFLAGS += " -lOpenCL"
do_install(){
install -d ${D}${bindir}/
install -m 0755 ${S}/clinfo ${D}${bindir}/
}
FILES_${PN} = "${bindir}/clinfo"
2. Build and transfer the application.
a. Build the application:
$ source build/conf/set_bb_env.sh
$ export MACHINE=sda845
$ export DISTRO=robot
$ bitbake -c cleanall clinfo
$ bitbake clinfo
b. Connect board to the host PC via Type C and ensure that the ADB port can be used.
Transfer the application:
$ adb push apps_proc/poky/build/tmp-glibc/work/aarch64-oe-
linux/clinfo/2.2.18.04.06-r0/image/usr/bin/clinfo /usr/bin
3. Execute the application:
$ adb shell
# chmod u+x /usr/bin/clinfo
# clinfo
4. The sensor data displays as shown:
Number of platforms 1
Platform Name QUALCOMM
Snapdragon(TM)
Platform Vendor QUALCOMM
Platform Version OpenCL 2.0 QUALCOMM
build: commit #f437276 changeid # Date: 10/24/18 Wed Local Branch:
Remote Branch:
Platform Profile FULL_PROFILE
Platform Extensions
Platform Name QUALCOMM
Snapdragon(TM)
Number of devices 1
Device Name QUALCOMM Adreno(TM)
Device Vendor QUALCOMM
Device Vendor ID 0xbf4d3c4b

Navigation menu