Skip to content

Radxa Rock Pro Setup

Krystian Gebis edited this page Feb 3, 2015 · 1 revision

Choosing Image

Since Radxa board can boot from two different storages, you need to pay attention to which image you download (http://radxa.com/Rock/prebuilt_images). Any image found in Radxa download section will end with *_update.zip or *_sdcard.zip.

  1. *_update.zip - This image is used when updating internal NAND Storage
  2. *_sdcard.zip - This image is used when updating external micro SD Card.

This tutorial will cover SD Card install/update

Download Latest Image

This document is based on radxa image radxa_rock_pro_ubuntu_14.04_server_140819_sdcard.zip. This image was downloaded from above link for Radxa Rock Pro version. Please pay close attantion when selecting image based on your hardware version.

Updating SD Card

Insert your SD Card to SD Card reader under Mac OSX or Linux. Next this is do determine what device is mapped to your SD Card

  1. Under Linux Open Terminal window and issue following command sudo fdisl -l or df. Please see what /dev/sd* points to your SD Card. Pay attention to size to help figure out which cad is your. If you select wrong device you next step will destroy all your data on that device. It could be your Hard Drive. For this example I will be using /dev/sdb device.

    Now copy Master-Radxa-ROS-Image-14.04.img to your $HOME folder. At this point you are ready to write your image to SD card by issuing dd of=/dev/sdb if=Master-Radxa-ROS-Image-14.04.img bs=1M. This will copy Master-Radxa-ROS-Image-14.04.img (if - input file) to /dev/sdb (output file) using block size of 1Mb. Based on speed of your SD Card and Image size this process might take few hours. There is no output on screen still finish to error. Usually SD Card Reader/Writes are equipped with LED activity indicator.

  2. Under Mac OS X Open Terminal window and issue following command diskutil list. Please see what /dev/disk* points to your SD Card. Pay attention to size to help figure out which cad is your. If you select wrong device you next step will destroy all your data on that device. It could be your Hard Drive. For this example I will be using /dev/disk2 device.

    Now copy Master-Radxa-ROS-Image-14.04.img to your $HOME folder. At this point you are ready to write your image to SD card by issuing dd of=/dev/disk2 if=Master-Radxa-ROS-Image-14.04.img bs=1M. This will copy Master-Radxa-ROS-Image-14.04.img (if - input file) to /dev/sdb (output file) using block size of 1Mb. Based on speed of your SD Card and Image size this process might take few hours. There is no output on screen still finish to error. Usually SD Card Reader/Writes are equipped with LED activity indicator.

Updating Internal NAND

If you intend to use internal NAND storage you need to download image radxa_rock_pro_ubuntu_14.04_server_140819_update.zip. To update internal NAND you need to use Radxa tool found in download section on their website. Radxa update tool comes in Linux and Windows flavor.

Booting From Image And Login

After successful storage update (SD Card/NAND) you should be able to boot. There is a Serial headed on board that you might be able to connect using Serial TTL to USB and watch boot up process for any errors.

When successfully booted you should have ssh access to Radxa board. Root login is disabled and you should use following credentials

  • User : Rock
  • Pass : Rock

Removing and Installing packages

First thing is to install few usefull utilities that come handy in everyday use.

apt-get update followed by apt-get install htop

Since Radxa image comes with mysql and apache2 services installed we ned to uninstall them since we will not have use for them. Please execute following

apt-get remove mysql followed by apt-get remove apache2

Next step is to update irqbalance (/usr/sbin/irqbalance) service since one that did come with Radxa 14.04 image is leaking memory VERY FAST. To update irqbalance you need to install few missing utilities before building latest irqbalancer source.

apt-get install autoconf libtool automake pkg-config make

Next step is to get latest irqbalance source. You can clone or download zip from https://github.com/Irqbalance/irqbalance.

After downloading zip unzip it and go to that folder. Execute following command

./autogen.sh followed by ./configure followed by make

Assuming there were no errors you should see binary file irqbalance in your folder. You can check it by issuing following command file irqbalance. Verify that this is ARM binary image.

Next step is to shutdown running irqbalance service before copying it.

service irqbalance stop

You can use htop or top or ps -ef | grep irqbalance to check is service is not running.

Before we copy new image to /usr/sbin/ safe thing to do is to make a backup.

cp /usr/sbin/irqbanance /usr/sbin/irqbalance.bak. Now we are ready to copy new image.

cp irqbanance /usr/sbin/irqbalance. Now are are ready to restart service.

service irqbalance start. Again use htop or ps -ef | grep irqbalance to check if service is running

Initial Setup

Since Radxa board does not enable swap you should edit sysctl.conf and add few items at the bottom of file.

vi /etc/sysctl.conf and add all listed lines below

vm.swappiness = 0

kernel.core_pattern = /var/cores/%e-%h-%p.core

kernel.core_uses_pid = 1

fs.suid_dumpable = 1

Now we need to create /var/cores path where out code files will be places

sudo mkdir /var/cores

sudo chown root:root /var/cores

sudo chmod 770 /var/cores

Save your changes and exit from editor. Not you can issue sudo sysctl -p /etc/sysctl.conf to reload new changes

To switch between DHCP and Static IP edit /etc/network/interfaces file You must uncommon one or the other

To setup eth0 in dhcp mode remove leading # mark

auto eth0
# iface eth0 inet dhcp

To setup eth0 in static mode remove leading # mark

auto eth0
# iface eth0 inet static
# address 192.168.1.5
# netmask 255.255.255.0
# gateway 192.168.1.254

Updating System

At this point if is a great time to update entire system from online repo.

apt-get update followed by apt-get dist-upgrade

When update finished reboot Radxa and log back in to perform cleanup.

reboot or shutdown -r now

Installing ROS

Performin final cleanup before making Master Image

At this point there might be various packages left in cache that needs to be cleanup so out final Master image will be smaller.

apt-get purge followed by apt-get autoremove followed by apt-get autocleaan

At this point we can shutdown the board. Make sure you give about 1 minute (to be safe) for board to shutdown all services before unplugging power. Removing SD Card or power prematurely will corrupt SD Card.

Now remove SD Card and place it in SD Card reader under Ubuntu.

Resizing image using gpart

Install GParted utility if missing by issuing apt-get install gpart. Not that GParted is installed and SD Card inserted to SD Card reader run gpart from Terminal window. In the right top corner selected SD Card you inserted. You should see two partitions.

  1. Windows
  2. Linux

By selecting Linux partition you can not resize it to be as small as possible. Make sure you leave some free space else you might have problem booting when restoring Master Image to other SD Cards. Also Make sure when writing Master Image to final SD Card you will need to use GParted and this time resize Linux partition to Maximum size by dragging the slider. Free space will be determined by your SD Card size.

Post-Setup (ROS Install)

  1. sudo apt-get install language-pack-en-base This will install your locale information
  2. Go to http://wiki.ros.org/indigo/Installation/UbuntuARM
  3. Follow their instructions
  4. Make sure you change the /etc/lsb-release to Ubuntu instead of Linaro before you try installing ros-indigo-navigation