"... and no one shall work for money, and no one shall work for fame; But each for the joy of the working, and each, in his separate star, shall draw the thing as he sees it, for the god of things as they are"

-Kipling

 

Installing a Debian Linux Armhf O/S on the Beaglebone Black

Summary

Updated Nov. 2018

The Beaglebone Black, as shipped, runs an armel Linux package with a v3.8 Kernel. This page describes how to download the Debian 9.5 2018-10-07 armhf distribution and how to format a MicroSD Card so that the Beaglebone Black will boot from it.

This page is part of a series of web pages which describe how to install C# and Mono on the Beaglebone Black and also how to setup a useful remote compilation and debugging toolchain for it. This page is a pre-requisite for a following page which describes the procedure for installing Mono on the Beaglebone Black and the contents of this page are oriented towards that end result. A previous page in this series describes the hardware setup.

What is Armhf?

For ARM CPU's, such as the one used on the Beaglebone Black, there are two methods of handling floating point operations (armel and armhf) and both are officially supported by Debian. Armel handles floating point operations in a software compatibility mode and low level software is thought to be much more easily ported in from other architectures. The armhf architecture handles floating point operations in hardware (the "hf" means Hard Float) and is reputedly much faster. It would appear that Debian's position is that the armel architecture will eventually be obsoleted.

Which Armhf do I need?

In the early days, the only real option was to use the armhf Ubuntu distribution available from the armhf.com website. It should be noted that Mono has been observed to install on this release and so, once you get it installed on the SD card, the subsequent pages in this series should be applicable with no changes. However, none of the Beaglebone Black specific Cape Manager and Device Tree Overlay code is supported in that version so you will not have access to that functionality and will have to edit the Device Tree the old fashioned way (i.e. manually) in order to enable and disable various Beaglebone Black I/O systems.

Things are progressing quite rapidly in the Beaglebone Black world and there have been Debian armhf builds available as an upgrade for some time now. You can download versions specifically tailored for the Beaglebone Black from the Latest Images page. The latest version available (as of the time this page was written) is Debian 9.5 2018-10-07 4GB SD LXQT and the discussion below is solely related to this Debian distribution.

Why do you need Armhf?

Well mostly you don't - unless you want to install and run C# and hence Mono. I could never get C# Mono compiler to install on an armel package of any flavor. Maybe it is possible but I could not get it to work and I sure tried. However, on an armhf based operating system, the C# Mono compiler installs very easily.

Installing Armhf

A full discussion of the installation procedure is given on the Beagleboard main site. A summary is as follows:

  1. Download the Debian 9.5 2018-10-07 4GB SD LXQT armhf package to a PC (it is about 850 Mb in size).
  2. Insert your SD card into the slot on the PC.
  3. Run freeware disk imaging software to write the image to the SD Card. It can read the compressed distribution you just downloaded so there is no need to unzip it.
  4. Eject the SD card from the PC slot.
  5. Insert the SD card into the Beaglebone Black.
  6. Boot the Beaglebone Black off the MicroSD card rather than the eMMC memory.
  7. Finish the installation and get the latest packages

Downloading Armhf

Downloading is simple and the Beaglebone Black latest images web page contains the download links and a lot of other information. To download go to the download page and download the Debian 9.5 2018-10-07 4GB SD LXQT file - or later version (if available).

Install Armhf on a MicroSD Card

The armhf distribution will be installed on a MicroSD card. This will enable the Beaglebone Black to boot off of it. One might wonder, why not just download and install it right into the eMMC memory? Well that is certainly possible - however the instructions on the Beaglebone Black website are all focused on installing to the SD card and, initially, I decided not to take the time to figure out how to get it installed in the eMMC memory. This turned out to be quite a fortunate decision for a couple of reasons. While experimenting I made, on several occasions, changes to the Device Tree file which effectively prevented the Beaglebone Black from booting. Prevented, as in bricked. Since the entire O/S was on an SD card I just booted from the eMMC memory (it does not get erased when you boot from the SD card), mounted the SD card, and used a text editor to revert the changes. I could never have done that if the Beaglebone Black was booting out of eMMC memory - in that case a full re-installation would be required. The other reasons I will probably never move my Debian installation into eMMC memory are that if the eMMC memory is not used, I can disable it to get more GPIO pins and there is insufficient eMMC memory for the operating system and C#/Mono unless you use the version without the GUI interface.

In short, booting off the MicroSD card is just as fast and a lot more functional and I strongly feel there is no point in copying the O/S into the eMMC memory. Using the eMMC memory has very little upside and quite a bit of downside.

NOTE: The installation instructions on the Beaglebone Black upgrade page are pretty clear and I will not reproduce them here. They only require the use of open source software and the installation can be performed from most Windows, Linux or Max O/S boxes. I strongly recommend using a Windows PC to do this though as subsequent pages on this website will detail how to set up a tool chain with a nice IDE and the ability remote debug of your C# code on the Beaglebone Black right out of Visual Studio 2017. An older set of instructions are available for a Linux box - but these are now mostly of historical interest.

You should use an SD Card of 16 Gb in size or greater. A 8 Gb card will work but it is a bit small for all of the Mono and C# files which will be required later and you might find yourself a bit constrained for space once you start to work wit it.

The installation instructions are on the Beaglebone Black website. Follow them exactly and you will have no trouble. Take care to read every line and do exactly what it says.

Insert the MicroSD card into the Beaglebone Black and boot it

At this point you should have copied the installation image to the SD card. This SD card will now be bootable and now is the time to give it a trial run. Turn off the Beaglebone Black and insert the SD card in the MicroSD card slot. This slot is by the P8 header on the end of the Beaglebone Black which is opposite to the ethernet RJ45 jack. If you just insert the SD card and turn the power back on you will find that the SD card is ignored and you boot right back into the default O/S in the eMMC memory. To force the Beaglebone Black to boot off the SD card you need to press the tiny little black button located by the SD card slot while you turn on the power and continue to hold it down for a short while afterwards. This tells the Beaglebone Black to boot from the SD Card. You only need to do this once - it will remember this for subsequent boots until you once again boot it without the SD card inserted. In that event, you will boot right back to the default O/S you had before. The previous O/S remains in the eMMC memory and if you boot from the SD card it will just be ignored and will remain untouched. In that respect, booting off the SD card is pretty failsafe. If it all goes wrong just remove the SD card and reboot and a short while later you are back to your factory configuration.

If you have set up your system as described on the previous Hardware Setup page in this series you will see a graphical display on your monitor and you will be able to use the via the USB Keyboard/Mouse/HDMI Monitor to interact with the Beaglebone Black. The first thing you will need to do is start a shell prompt window. If you are not familiar with this - you should probably read the useful digression below.

Note: it may take up to two minutes for the boot process to complete if you do not have the ethernet connected or if you do have it connected and there is no DHCP server on your network. Basically the Beaglebone Black is configured to automatically acquire an IP address (from the DHCP server) and it will take some time for that to time out. During the boot process you should see a lot of text scrolling by on the monitor before it eventually opens up a GUI display (described below).

Digression: How to open a Shell Prompt on the Beaglebone Black LXDE Display

The LXDE GUI Once your Beaglebone Black has fully booted, you will see a window display similar to the one at left and your mouse and keyboard should work as well (click on image to see a larger version). This display is presented to you by the LXDE window manager which is automatically started when the Beaglebone Black boots.

The LXDE Accessories Menu The shell prompt can be started by clicking with the mouse on the LXDE icon in the lower left corner, choosing the accessories menu and then the LXTerminal application.

The LXDE Terminal A terminal window will pop up as shown in the image at left (click on image to see a larger version).

Essentially you have created a window with a shell prompt using the Beaglebone Black's own LXDE GUI.

Also, it should be noted that it is not necessarily a given that all Beaglebone Black Linux distributions will have a GUI interface (the Debian 9.5 2018-10-07 distribution we are discussing here does though). It may never have been configured with a windows manager (called running headless) or the HDMI video may have been disabled because the I/O lines it uses were required for other things. To be honest, the developers of the Beaglebone Black start up a Window Manager by default purely for your benefit (just like the USB filesystem and the webserver) and they all consume resources. If you were using the Beaglebone Black as part of a control system you would probably disable all of these. In that case your monitor will present a text based shell prompt and you can login from there. This is identical in usage to logging in via an SSH remote telnet connection - this is discussed on the Networking Configuration page.

You may find that when using the keyboard/monitor connection you are not prompted for a password. However, on some systems, when connecting locally you may be asked for one and certainly you always will be asked for a password when you are connecting remotely. In the Debian 9.5 2018-10-07 distribution, the default password for the root account is root and the default password for the debian account is temppwd. The reason why there are two accounts is that almost no modern Linux system will permit a direct login as root. You would have to login as debian then sudo to gain root privileges. Usually these default accounts and passwords are listed on the web page from which you downloaded the distribution.

You should change these default passwords at the earliest possible opportunity (i.e. right now)! If you do not know how to do this look up the passwd command.

If you were not prompted to login you should probably enter the command whoami at the terminal prompt in order to figure out which account you are logged in as. As discussed above, it will probably not be root – you can change over to the root account by issuing a sudo -s command. If you are unfamiliar with the sudo command, what it does and why you need to do it then you should probably look that up now.

Now that we have a shell prompt on the system we can set about discovering the IP address the Beaglebone Black has been given (if any) by the DHCP server. To find out the IP address issue the command ip addr show in the shell window. This will, in the eth0 section, tell you what the IP address is. You could then connect via ssh using that IP address. Note that you cannot connect via standard telnet - this is disabled due to all the security holes. You will probably find the IP address changes each time the Beaglebone Black reboots because the DHCP server will give it an IP address from whatever range it thinks it has free. To resolve this you need to give it a fixed IP address and this procedure is discussed on the Networking Configuration page.

Set up the Network and Upgrade the Armhf Installation

At this point the Beaglebone Black has booted. You are now ready to setup the networking properly and complete the installation by upgrading the recently installed armhf package. The network setup procedure is described on the next page in this series.

License

The contents of this web page are provided "as is" without any warranty of any kind and without any claim to accuracy. Please be aware that the information provided may be out-of-date, incomplete, erroneous or simply unsuitable for your purposes. Any use you make of the information is entirely at your discretion and any consequences of that use are entirely your responsibility. All source code is provided under the terms of the MIT License.

Acknowledgements

The Beagleboard website and the pages written by the anonymous maintainers were essential to getting this working. Thank you Beagle Developers - your work is much appreciated..