Beaglebone Black + SGX = New Hope!

June 03, 2015

Prologue

Last year, I spent a good amount of time trying to get OpenGL running on the Beaglebone Black (BBB). I finally got it working by borrowing heavily from someone else’s work on a bootable BBB image.

But since last year, a lot has changed in the ARM Linux Kernel world. A lot has also changed in my understanding of OpenGL as well as the required build systems for complex OpenGL projects.

So, I’m going to try again from the ground up!

Notes on digging myself out of the grave from last year

Over the past few days, I’ve dug out all of my BBB projects to get ready for this years art car for Burning Man. Basically, this consisted of a 4GB version of the Beaglebone Black and a 7” LCD Touchscreen from 4D mounted in a laser cut case, as well as an USB FTDI breakout board and a decently large 5 volt power supply in an orange, plastic ammo case.

Digging back through my various micro-SD cards, I found a few images I had no memory of. To grab the file list of the initrd.img files, I was able to use this command:

cat initrd.img|cpio -tiv

Using that, I was able to figure out what kernel version was on each image.

Ignore Angstrom, go straight to Debian

Previously, Angstrom was the default BBB distro. Now it’s Debian. Officially, it is still stuck on 3.8. The SGX drivers and userland tools need to be run on at least 3.14.

So here are the steps to get SGX running:

  1. Decide if you want to overwrite the current OS install on the BBB’s eMMC.

    1. Get latest non-eMMC Flasher image:

      1. 4GB: http://beagleboard.org/latest-images
      2. 2GB/Other: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Debian_Releases
    2. Get latest eMMC Flasher image:

      1. 4GB: ? ### 2GB:?
  2. Check the download’s hash, extract it, and flash it to a decent sized SD card using “Pi Filler.app”, dd, or whatever

  3. Hold down the button near the SD card and plug in the BBB to boot off of the SD card.

Now, once it’s booted, get to a console. The first thing to check is the kernel version. This will tell you if you need to mess with installing a new kernel or not. If you can’t get the image to boot, you’ll have to hook up a serial port and go from there…

  1. Check the kernel version with uname -a
  2. Update the packages list: sudo apt-get update
  3. List the latest minor revisions of the 3.14 kernel that apt knows about: sudo apt-cache search 3.14
  4. Install the latest image: sudo apt-get install linux-image-3.14.43-ti-r66
  5. Cross fingers
  6. Reboot
  7. Recheck the kernel version: uname -a
  8. Install the sgx modules that match your kernel version: sudo apt-get install ti-sgx-es9-modules-3.14.43-ti-r66
  9. Cross fingers and reboot
  10. NO idea how to check this quite yet…. I guess maybe: dmesg | grep -i sgx

So, that should get a kernel with SGX support built into it. But I’m not entirely positive.

Compiling the TI SGX SDK

Now you’re going to need a x86/x86_64 LINUX machine for the next part.

  1. Go make an account with TI
  2. Download the latest SGX SDK using that account. It will be a large .bin file.
  3. Get that .bin file on to your x86 based Linux machine
  4. chmod +x the .bin file and run it.

This will ask you a bunch of questions. Answer them sanely. Don’t take many risks and it should dump a bunch of files on your desktop. This process is defined here: http://processors.wiki.ti.com/index.php/Graphics_SDK_Quick_installation_and_user_guide#Build_and_install_instructions

Now that you have the SGX SDK files, you’re going to need to build a bunch of stuff. The kernel modules will come along with this but we shouldn’t need to compile them… (??? not sure if this is true…)

So now we get to compile the SDK. Again, do this on your x86 Linux machine.

  1. cd into the SDK directory that the bin plopped on your disk. It should be something like:

  2. type make help to see some examples of what you can do.

  3. Set some environment variables:

    1. SDK_INSTALL_DIR=/home/user/
    2. LINUX_DEVKIT_PATH= < toolchain path >
    3. CROSS_COMPILE= <(ex arm-arago-linux-gnueabi- )>
    4. LINUXKERNEL_INSTALL_DIR= < $(SDK_INSTALL_DIR)/linux-kernel >
    5. DESTDIR= < $(SDK_INSTALL_DIR)/targetfs >
  4. BUILD IT: make BUILD=release OMAPES=8.x FBDEV=yes SUPPORT_XORG=1 EGLIMAGE=1 all

Hopefully that builds. Not sure if it will as I haven’t quite done so yet.

A note on the X11 support: apparently you need to run xserver 1.12 (http://processors.wiki.ti.com/index.php/RN_4_08_00_02#Features_in_this_release) and you need to load the xserver driver included in the .bin file from TI.

asdf:

asdf


James Hagerman

Written by James Hagerman

© 2026