The current shipping kernel version of the BeagleBone Black is 3.8. However, it is fairly easy to upgrade to 3.13 with the help of Robert Nelson’s scripts. Why upgrade to 3.13? Well, mainly because the support for the OMAP hardware random number generator, OMAP crypto accelerators, and TPM support are available. The TI crypto hardware (hwrng and AES, MD5, and SHA accelerators) are enabled by default in the BeagleBoard images. To enable I2C TPM support, we need to configure the kernel. The CryptoCape, which will be soon available at SparkFun Electronics, will have the Atmel 1.2 TPM.

There are three parts to this post. The first is how to flash Debian to the eMMC. This is not technically a prerequisite, but I keep looking this information up all over the web and I finally decided to write it down. This is how I setup all of my BBBs. The second section is how to use the scripts to quickly upgrade to the 3.13. The last section shows how to customize the kernel and add TPM support.

However, know that not everything is working in 3.13. The following is status list, taken from the BBB 3.13 kernel repo:

  • I2C: working
  • SPI: working
  • MMC: mmc1 working, mmc2 working
  • USB host: working
  • USB gadget: working: usb eth, usb drive
  • HDMI: working
  • LCDC: lcd3/lcd4/lcd7/dvi: untested
  • TS: untested
  • ADC: untested
  • PWM: untested
  • PMIC: untested
  • PMIC PWM: untested
  • CPUfreq: not working
  • Capes: untested
  • AUDIO: untested

As you can see, not everything is working. Also, there is no capemgr in 3.13. Proceed at your own risk!

Section 1: Install Debian to the eMMC

I can never remember how to connect this USB to serial cable.  It's handy to attach to monitor the install progress.
I can never remember how to connect this USB to serial cable. It’s handy to attach to monitor the install progress.

Recently, BeagleBoard.org starting releasing officially supported Debian images on their latest images page. I like the eMMC flasher image which appropriately flashes this image to the eMMC. 😉 Go ahead and download that. The rest of this post assumes you are running some sort of linux. Check out Adafruit’s tutorial for Mac or Windows instructions.

  • Extract the image and copy over to your SD card. The SD card part (of) will be custom to your machine. Be very sure you are copying to your SD card and not your bootable hard drive! This took 11 minutes on my laptop.
unxz *.xz
sudo dd if=./BBB-eMMC-flasher-debian-7.4-2014-03-04-2gb.img of=/dev/mmcblk0
  • Power off the BBB and insert the microSD card.
  • While holding down the USER BOOT button, plug in the power cord for the BBB.
  • Release the USER BOOT button when all 4 LEDs are lit (this happens quickly).
  • Get some coffee. It could take up to 15 minutes for the image to copy over.
  • When all four LEDs are lit again, the procedure is complete. Remove the micro SD card and reboot.
  • The default user name is debian and the password is temppwd. The root account password is root. Hey, at least it’s not password.

Problems

As far as I know, it’s very difficult to “brick” the BBB. If you hose the eMMC, you can always boot from the micro SD with the SD card image. Then, once booted from the micro sd, perform the following1:

cd /opt/scripts/tools
git pull
sudo ./beaglebone-black-eMMC-flasher.sh

Then cycle power to the BBB.

Section 2: Upgrade to 3.13

Now that your BBB has Debian, the easiest way to upgrade to 3.13 is to use Robert Nelson’s upgrade scripts:

wget https://rcn-ee.net/deb/wheezy-armhf/v3.13.6-bone7/install-me.sh
chmod +x install-me.sh
sudo ./install-me.sh
sudo reboot

That directory is constantly updated so it’s best to check the rcn-ee.net/deb/wheezy-armhf directory for the latest version fist.

After the reboot, you’ll be running 3.13:

debian@beaglebone:~$ uname -a
Linux beaglebone 3.13.6-bone7 #1 SMP Sat Mar 8 01:11:45 UTC 2014 armv7l GNU/Linux

And now you have the the OMAP hardware random number generator support:

debian@beaglebone:~$ ls -l /dev/hwrng
crw------- 1 root root 10, 183 Jan  1  1970 /dev/hwrng

Try cating some random numbers. It’s fun.

Section 3: Customizing 3.13

Thanks again to Robert Nelson, we can use this repo to build the BBB 3.13 kernel. This will pull down the kernel’s git repository and will take some time.

git clone git@github.com:RobertCNelson/linux-dev.git
git fetch
git checkout am33x-v3.13
./build_kernel.sh

You’ll automatically enter the menuconfig. The TPM related selections are below. I choose to include them directly in the kernel vs. a module, but that choice is up to you.

<*> Device Drivers > Character devices > TPM HW Random Number Generator Support
<*> Device Drivers > Character devices > TPM Hardware Support
<*> Device Drivers > Character devices > TPM Hardware Support > TPM Interface Specification 1.2 Interface (I2C - Atmel)

Make any other changes you wish and then select exit.

Install the kernel

install your SD/microSD card and then run the script:

./tools/install_kernel.sh

Use the trick from the first section to boot from the SD card and you will boot your new kernel!

Going Further

These steps are the basics for upgrading your BBB. If you have questions the best place is to look over the official BeagleBoard forum, or checkout the #beagle channel on freenode.

In a later post, I’ll show how to actually use the TPM. But now we can rest assured that our kernel has the driver.


  1. This is essentially what the flasher image does, it just calls this script. At least, that’s my understanding of it. I somehow hosed the filesystem on the eMMC, so this recovery step does indeed work ;) 
Advertisements

7 thoughts on “Upgrade the BeagleBone Black to kernel version 3.13

  1. Thank you for this post. I altered your instructions to include the 3.14.3-bone3. Nice tutorial. Any chance you can include a tutorial on patching the kernel for wireless injection and adding extra wifi adapter / bluetooth adapter support?

    Regards,

    0e800

    1. Thanks for the comment and sorry for the delay. I don’t play around a lot with wifi and bluetooth these days, but there is a list of compatible wifi adapters here.

  2. Thanks for the post. I would like to use an existing config, change some settings, and rebuild the kernel. Can I just copy the working config from /proc/config.gz to ./linux-dev and run ./build-kernel.sh ?? Or, do I need to do anything else to keep my existing config with minor modifications when re-building the kernel using build-kernel.sh?

    1. Thanks for question and sorry for the delay. I think I understand your question, but I’m not sure how to accomplish it. However, if you post it to this group you should get a quick response (although, probably not on the weekend).

      Robert Nelson is the maintainer of that script and he will probably see your question and answer it 🙂

      1. What about using cryptodev? I tried to use your directions with the new one, and it seems to no longer work (I tried 3.15)…..

      2. Thanks for the comment, but I haven’t tried it recently. I’m not sure I’ll get to it this week; when I do I’ll update the blog. The OMAP drivers should be there, but I’m not sure if one has to configure userspace access in the kernel config. That’s what cryptodev is supposed to do…

Comments are closed.