“Hello RB3” & Build Instructions

“Hello RB3” & Build Instructions
Skill LevelArea of FocusOperating SystemPlatform/Hardware
BeginnerEmbedded, RoboticsLinuxQualcomm Robotics RB3 Dev Kit
This project is intended to help you get familiar with the Qualcomm® Robotics RB3 development kit, which is based on the Qualcomm® SDA845 processor, and then setup the development environment. To confirm the environment setup on the Qualcomm Robotics RB3 development kit you will build a basic “Hello RB3” application.
Get started with the Qualcomm Robotics RB3 development kit and run the basic applications within the development environment.
  • Qualcomm Robotics RB3 Development Kit
  • Power adapter - 12V with 2500mA as per 96Boards specification
  • USB to Micro USB cable - For serial console interface (Minicom), ADB and Fast boot commands
  • USB to USB Type C cable - For connecting the USB3.0 Type C port and flashing images
  • Host PC OS for Qualcomm Robotics RB3 SDK build process - Host machine Operating System for SDK build

Set Up the Development Environment

This section describes how to set up the development environment on Ubuntu host machine and the steps to:

  • Compile the sample application (ex: “Hello RB3” app) using the App Toolchain SDK on a host PC.
  • Flash firmware images from host machine onto the Qualcomm Robotics RB3 development kit.

Install ADB, Fastboot, and USB host interface

This section provides instructions for installing ADB, Fastboot, and USB drivers on your host machine. The Fastboot tool communicates with the Qualcomm Robotics RB3 bootloader and allows you to flash images onto the board.

1. On the Linux (Ubuntu) host PC, install ADB and Fastboot

To install ADB and Fastboot, execute the following commands:

  • sudo apt-get install android-tools-adb
  • sudo apt-get install android-tools-fastboot
  • sudo apt-get update
  • sudo apt-get upgrade
adb installation

ADB Installation

fastboot installation

Fastbook Installation

2. Install and configure the USB driver

Setup the udev rules on your Linux Host PC as follows:

Navigate to the directory where 99-android.rules file is present

cd /etc/udev/rules.d

Path to 99-android.rules filePath to 99-android.rules file

2.1 Add the following rules in file 99-android.rules and in case the file is not present, create the file:

# fastboot for Robotics DragonBoard 845c
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0777",
GROUP="adm"

# adb for Robotics DragonBoard 845c

SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0777",
GROUP="adm"

Add attributes to 99-android.rules fileAdd attributes to 99-android.rules file

2.2 Restart the udev service using below commands:

sudo chmod a+r /etc/udev/rules.d/99-android.rules
sudo service udev restart

udev restartudev restart

2.3 Connect the Qualcomm Robotics RB3 development kit to the PC with USB C cable:

2.4 Connect the power adapter to Qualcomm Robotics RB3 development kit.

2.5 Press Power button on the board and the system will start.

2.6 To check the list of devices, give command ‘adb devices’ from terminal in host PC and the device ID will be displayed.

Command to List adb devicesCommand to List adb devices

3. Power on the Qualcomm Robotics RB3 Development Kit

Open the serial console tool on the host PC (minicom)

Note : Minicom is the serial communication tool used in this project to interact with Qualcomm Robotics RB3 development kit. It is also helpful in visualizing bootup logs and login screen of Qualcomm Robotics RB3 development kit while establishing connection and reset operations.

3.1 Download and install minicom through apt-get in Ubuntu.

sudo apt-get install minicomCommand to install minicomCommand to install minicom

3.2 Detect devices connected to host machine through USB interface, by executing the command below

$ dmesg | grep usbdmesg logsdmesg logs

3.3 You should see the details and serial number of the product in dmesg logs displayed on the terminal

3.4 The detected device can usually be accessed through device files (ex: ttyUSB0) generated as soon as a device is connected.

3.5 The following image lists ttyUSB0 for the device connected

USB device file[ttyUSB0] detectionUSB device file[ttyUSB0] detection

4. Setup the minicom serial port to ttyUSB0 through the following commands

4.1 On host PC, do the following setup for minicom serial port

$ sudo minicom -sCommand to open minicomCommand to open minicom

Go to the Serial port setup option from the list and confirm about serial device /dev/ttyUSB0) and set the Bps/Par/Bits to 115200 8N1

Serial port setupSerial port setupSerial port configurationSerial port configuration

4.2 Then choose ‘Save setup as dfl’

4.3 Don’t select “Exit from minicom” option. Choose “Exit” option ONLY to enter into minicom console

Minicom consoleMinicom console

5. Dip Switch Settings

5.1 Disconnect the power supply and turn on SW2 switch on the Dip Switch on RB3 board to enable the USB2.0 debug port. (The switch blueprint is provided in the Qualcomm Robotics RB3 Platform Linux User Guide).

5.2 Turn on SW3 switch on the Dip Switch to enable the auto power up on USB- C cable connection (along with power connector).

DIP switch on RB3DIP switch on RB3

5.3 Connect the USB cable Micro-B plug to the USB2.0 debug port on the board and connect the other end to an available USB port on the host machine.

5.4 Connect the power supply to power connector of the board.

5.5 Plug the power supply into a power outlet. The green power-up LED should illuminate.

5.6 Press and release the power button on the device. The yellow LED0 should illuminate.

5.7 The board will start the booting process. Login credentials will display on the host PC:

sda845 login: root
Password: 123456
Login to the RB3 through minicomLogin to the RB3 through minicom

5.8 Access control security is provided by default through Security-Enhanced Linux (SELinux) and SElinux is turned on by default, which doesn’t support login as the root user. In order to overcome this, please close SElinux per the instructions below:

   i. Connect the type C port of the Qualcomm Robotics RB3 board to the host PC using type C USB cable.

   ii. Enter the following commands:

$ adb shell
# setenforce 0
Access control security doesn’t allow to loginAccess control security doesn’t allow to loginSet ‘setenforce’ flag to ‘0’Set ‘setenforce’ flag to ‘0’

Note: Debug logs for bootup process only can be visualized through minicom. File transfer and flashing can be done using ADB commands.

6. Flash the Firmware image

The procedure to download self-compiled OS for the Qualcomm Robotics RB3 development kit is given below:

NOTE: Ensure you have installed the required ADB and Fastboot drivers. Your board must be detected on your host machine.

Program system images using Fastboot

6.1 Once the host machine is able to detect the device, download the Qualcomm Robotics RB3 fastboot images package from the Thundercomm Qualcomm Robotics RB3 Development Kit web page, under the Technical Documents tab in the “Firmware” section and unzip the file

Firmware location in ThundercommFirmware location in Thundercomm

6.2 Make sure that USB type C port is connected before flashing images on the device.To enter the fastboot mode, press and hold VOL- then press Power once to force the device to enter fastboot (or)

Run the command “adb reboot bootloader” from the command prompt to enter into fastboot.

Enter fastboot mode logsEnter fastboot mode logs

6.3 Confirm that Fastboot is active as follows:

From Linux, run: $ sudo fastboot devices

Command to list fastboot devicesCommand to list fastboot devices

6.4 Flash images:

Navigate to folder containing flash_all.sh file in the downloaded firmware and run the following command from host PC

$ ./flash_all.sh Logs during flashing image to RB3Logs during flashing image to RB3

After the script is executed, the board will reboot automatically

7. App Development and Installation

The Linux SDK for the Qualcomm Robotics RB3 development kit is built by Thundercomm. The platform is based on Yocto Rocko with Linux Kernel 4.9 and GCC 6.5.

Install the Application SDK

7.1 To run sample applications on the Qualcomm Robotics RB3 development kit, install on the Host PC the App Toolchain SDK, found on the Thundercomm Qualcomm Robotics RB3 Development Kit web page, under the Technical Documents tab in the “Tools” section

7.2 Navigate to the SDK directory:

Navigate to SDK directoryNavigate to SDK directory

7.3 Execute the oecore-x86_64-aarch64-toolchain-nodistro.0.sh command:

Execution of script file to install App toolchain SDKExecution of script file to install App toolchain SDK

7.4 Choose the default target directory, press Enter and type Y.

SDK installation processSDK installation process

7.5 Configure the system environment:

$ cd
$ source /usr/local/oecore-x86_64/environment-setup-aarch64-oe-linux
$ source /usr/local/oecore-x86_64/environment-setup-armv7a-neon-oemllib32-linux-gnueabi
System environment configurationSystem environment configuration

7.6 Compile the app

Any application that is built on the host PC can be compiled using the below commands and then pushed (file transferred) onto Qualcomm Robotics RB3 board.

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

8. Hello RB3 Application

Once the App Toolchain SDK is installed, the first ‘Hello RB3’ application can be installed.

8.1 Create a source file and edit:

Using vim editor on host PC, create a source file and edit as given:

$ vi Hello.c
#include
#include
int main(void) {
printf(“Hello RB3 !!! \n”);
return 0;
}

8.2 Build and transfer the application

i.    Build the application:

$ aarch64-oe-linus-gcc --sysroot=/usr/local/oecore-x86_64/sysroots/aarch64-oe-linux-02 -fexpensive-optimization-frename-registers -fomit-frame-pointer -Wl, -01 -Wl, -- hash-stylle=gnu -Wl, --as-needed Hello.c -o Hello

    ii. Connect the Qualcomm Robotics RB3 board to the PC via Type C cable and ensure that the ADB port can be used (using ‘adb devices’ command). Transfer the application:

$ adb push Hello /bin/adb command to push application binary to Qualcomm Robotics RB3ABD command to push application binary to Qualcomm Robotics RB3

8.3 Run the application:

$adb shell
/ # chmod u+x /bin/Hello
/ # Hello
commands to run ‘Hello RB3’ applicationcommands to run ‘Hello RB3’ application

The terminal will then output the expected print information:

Hello RB3 app OutputHello RB3 app Output
NameTitle/Company
Rakesh SankarSr, System Architect Global Edge Software Ltd
Akshay KulkarniTechnical Lead Global Edge Software Ltd
Vihari SreeramSenior Software Engineer Global Edge Software Ltd
Vengamamba PatchaSoftware Engineer Global Edge Software Ltd