U-Boot on Beaglebone Black

Build U-Boot

Consult the following links:

Steps:

  • sudo apt-get install gcc-arm-linux-gnueabihf
  • sudo apt install device-tree-compiler
  • wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2
  • tar -xjvf u-boot-latest.tar.bz2
  • Edit default SYS_PROMPT in file: /uboot/cmd/Kconfig
  • make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_boneblack_defconfig
  • make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4
  • Install mkimage: sudo apt install u-boot-tools

If your strategy should be used instead of another already registered strategy (ie. they support the same pattern), you can give it a higher priority:

$builder->addSearchStrategy($strategy, 50);

Important: The higher the priority is, the sooner the strategy will be returned if it supports the given pattern.

Note:A default priority of 0 is assigned to strategies if you don't specify it.

Build Kernel

Editor actually uses the CommandInvoker in its following methods:

Steps:

  • git clone -b 4.9 git://github.com/beagleboard/linux.git
  • make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bb.org_defconfig
  • make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4
  • sudo apt-get install lzop
  • make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage dtbs LOADADDR=0x80008000 -j4

Create Root Filesystem

Enable USB Passthrough in ESXI

  • Insert USB(SD-card) stick
  • Select VM, then Edit Settings
  • Add USB Device, not USB Controller
  • Start VM

Create SD Card

  • sudo fdisk /dev/sdb: d w
  • mkfs.vfat -F16 -v /dev/sdb1
  • mkfs.ext4 /dev/sdb2
  • mount /dev/sdb1 /mnt/bbone_sd1
  • cp /path/to/MLO .
  • umount bbone_sd1

Access to BBB Serial Console

Following link:

FTDI USB-Serial Converter <=> BBB J1 header:

  • J1 pin 2: VSS
  • J1 pin 3: RES
  • J1 pin 4: TX
  • J1 pin 5: RX

Connect to BBB:

  • check tty assignment: dmesg
  • sudo screen /dev/ttyUSB0 115200,cs8

Boot Locally

  • setenv bootargs "earlyprintk console=ttyO0,115200n8 root=/dev/mmcblk0p2 rootwait ro rootfstype=ext4 init=/bin/init"

Boot Remotely

  • setenv serverip 192.168.2.139
  • setenv ipaddr 192.168.2.193
  • tftpboot 0x80200000 zImage
  • tftpboot 0x80f00000 am335x-boneblack.dtb
  • setenv npath /home/jerry/rootfs
  • setenv bootargs console=ttyO0,115200 root=/dev/nfs rw nfsroot=${serverip}:${npath} ip=${ipaddr}
  • bootz 0x80200000 - 0x80f00000

After login:

  • mount -t proc proc /proc
  • fdisk -l
  • mount
  • mount /dev/mmcblk0p2 /mnt
  • cp -a /home/myrfs/* .
  • umount mnt

Reboot:

  • setenv bootargs "earlyprintk console=ttyO0,115200n8 root=/dev/mmcblk0p2 rootwait rw rootfstype=ext4"

TFTP Rootfs

Refer to Writing to SD partitions from u-boot

  • tftpboot 0x80200000 core-image-sato-beaglebone.ext4
  • mmc part
  • mmc write 0x80200000 0x20800 0x639D8

Boot over UART

Use TeraTerm terminal. Please refer to AM335x U-Boot User's Guide

Next readings

Previous readings