Friday, 8 December 2017

BeagleBone Black Linux setup for development

After my wandboard starting behaving weirdly due to some RAM problems I decided to experiment Android and Linux on my BeagleBone Black.

BeagleBone Black is a really nice and capable SBC. I will document my Linux experiments similar to Wandboard here. We will first start with the Linux setup and installation.

I am going to the use Robert C Nelson (hereafter RCN) trees for building my kernel.

We have the BB Kernel tree here:

We do a git clone and git checkout 4.14-rc8-bone3. We can just call the which will build the kernel automatically. We can reuse the .config for our customization.

We can also use the bleeding edge tree:

In the above tree we can build the image manually. The baremetal toolchains arm-none-eabi- from the Ubuntu repository and the arm-eabi- from the ARM/Linaro toolchain will cause errors in the build. After observing the BB Kernel tree build messages I see that the toolchain used is arm-linux-gnueabihf-. So we do the build as follows:

ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make bb.org_defconfig
LOADADDR=0x80008000 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j10 uImage zImage dtbs modules

This will create the uImage, zImage and dtbs files.
We use the debian rootfs: debian-9.2-minimal-armhf-2017-10-10.tar.xz
I create two SD card partitions. I do the following after the extraction of the above rootfs assuming the /dev/<partno> is mounted at /mnt/devmnt

sudo tar xfvp rootfs.tar -C /mnt/devmnt
sudo chown root:root /mnt/devmnt
sudo chown 755 /mnt/devmnt

To load the file we do:
fatload mmc 0:1 0x80008000 uImage
fatload mmc 0:1 0x8C008000 am335x-boneblack.dtb

After the above loading we do the following:
setenv bootargs console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
bootm 0x80008000 - 0x8C008000

The BeagleBone Black should start booting. Use the username as debian and password as temppwd to login.

The above will cause a fault after mounting of the filesystem and running in if you use the Ubuntu tool chain as it. Use the Linaro tool chain which gets downloaded in the dl folder in the tree when is called.

No comments:

Post a Comment