Post

Getting started with Black Beagle Bone

Getting started with Black Beagle Bone

Description: How to get started with BBB and load image into board, set up cross-compile.


Firstly, most BBB have a built-in 4GB SD card known as a eMMC. When the boards are made, the eMMC is “flashed” with some version of the BeagleBone OS that is usually outdated. So the blog mainly guide about how to burn image via your external micro SDcard (with 4GB minium).

Install prebuilt image

From your linux machine, install pre-built image for BBB, kernel version 4.14.108

1
host$ wget https://files.beagle.cc/file/beagleboard-public-2021/images/bone-debian-9.12-imgtec-armhf-2020-04-06-4gb.img.xz

After that, extract the image to write into micro SDcard.

1
host$ unxz bone-debian-9.12-imgtec-armhf-2020-04-06-4gb.img.xz

Write that extracted file into micro SDcard(you need to unmount the SDcard first if it was mounted into system)

1
2
3
host$ sudo umount /dev/sdX*
host$ sudo dd if=~/bone-debian-9.12-imgtec-armhf-2020-04-06-4gb.img of=/dev/sdX
host$ sync

Hola, it’s almost done. Now you can insert that sdcard into your board then insert the USB cable to power your board via computer.

When booting, you have to press and hold the boot button(S2) before you power the board then release the S2 button after 2 to 5 seconds. For further informations, you should take a look at this docs.
url: https://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/How_to_Guides/Target/How_to_Program_Beaglebone_Black_eMMC_via_SD_Card.html

Cross-compile set up

Now, we will set up the Host machine in order to cross-compile the BBB First, let’s install the packages that need to build Linux kernel.

1
host$ sudo apt-get install build-essential gcc-arm-linux-gnueabi git lzop u-boot-tools bison flex libssl-dev libncurses-dev sshfs lzma gettext libmpc-dev libncurses5-dev:amd64

then create a new directory called BBB

1
2
host$ mkdir ~/BBB
host$ cd ~/BBB

then clone the Linux kernel from Github and checkout to the kernel that BBB using.
In this post, im going to build target the linux version 4.14.108 (if you dont know the kernel version of your board, using “uname -ar”)

1
2
3
host$ git clone git://github.com/beagleboard/linux.git
host$ cd linux/
host$ git checkout 4.14.108-ti-r131

U need to match the kernel version of host machine and target machine(BBB) to cross-compile

Use default configuration

1
host$ make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- bb.org_defconfig

Run the menuconfig, here you can disable or enable any components you want!!!

1
host$ make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

Now, you need to build the linux kernel using this command. This may take about an hour. Relax :D

1
host$ make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LOADADDR=0x80000000 uImage dtbs

After that, build the modules. It took abt 40mins

1
host$ make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules

Create a new temporary directory that resides linux kernel directory. Install modules into that directory.

1
2
host$ mkdir ../tmp/
host$ make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=../tmp modules_install
This post is licensed under CC BY 4.0 by the author.