- Table of contents
- BeagleBone Black
Various links to important BeagleBone Black resources should go here.
A good cross compiler¶Version 14.08 of the linaroo toolchain, targeted for x86-64 host and arm-linux-gnueabihf destination, runs great on our Scientific Linux 6 hosts (e.g., mu2edcs01), and produces code that runs on the BBB.
- The precompiled binary can be downloaded from https://releases.linaro.org/14.08/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.08_linux.tar.bz2
- On mu2edcsXX, the compiler is already downloaded and unpacked to
/home/gahs/gcc-linaro-arm-linux-gnueabihf-4.9-2014.08_linux. The epics v3_15_2_mu2e_1 UPS product assumes that GCC_ARM_FQ_DIR points to this directory. (It should be made into a UPS product and put in /mue2/ups.)
BeagleBone Black: booting from SD by default¶
(Shamelessly stolen from https://www.erdahl.io/2016/12/beaglebone-black-booting-from-sd-by.html )
Option 1: leave eMMC intact
Note: this procedure will not work if you booted from eMMC, you must boot from an SD card, or some other means.
Step 1: Determine volume name
Use the 'lsblk' command to list all the block devices on the system:
root@am335x-evm:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT mmcblk1boot0 179:32 0 1M 1 disk mmcblk1boot1 179:48 0 1M 1 disk mmcblk0 179:0 0 7.4G 0 disk |-mmcblk0p1 179:1 0 70.6M 0 part /run/media/mmcblk0p1 `-mmcblk0p2 179:2 0 7.3G 0 part / mmcblk1 179:16 0 1.8G 0 disk |-mmcblk1p1 179:17 0 96M 0 part /run/media/mmcblk1p1 `-mmcblk1p2 179:18 0 1.7G 0 part /run/media/mmcblk1p2
Based on my knowledge of the size of my SD card, and eMMC, I know mmcblk1 is the volume name associated with eMMC on my system. Depending on your boot medium, it could be different on your system.
Step 2: disable bootable status
The eMMC is marked as bootable, and is the first boot device attempted by the boot ROM, which is based on the SYSBOOT configuration that is set by installed resistors on the BeagleBone. Removing the boot flag will force the ROM to look for a different boot device, and skip the eMMC always.
Note: if you attempt to do this procedure on the active boot device, the partition table will not be updated, and the system will still boot from eMMC.
Use the 'fdisk' command:
root@am335x-evm:~# fdisk /dev/mmcblk1 Welcome to fdisk (util-linux 2.27.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): m Help: DOS (MBR) a toggle a bootable flag <snip> Command (m for help): a Partition number (1,2, default 2): 1 The bootable flag on partition 1 is disabled now. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Re-reading the partition table failed.: Device or resource busy The kernel still uses the old table. The new table will be used at the next reb.
Step 3: reboot
root@am335x-evm:~# sync root@am335x-evm:~# reboot
Refreshing the eMMC¶
I found that the above configuration only booted from the sd consistently if the board remained powered up. I looked around for other ways to insist the board boot from the SD card, and in the end decided to flash the eMMC. From https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Flashing_eMMC here are the instructions.
To set up the standalone microSD image to automatically flash the eMMC on powerup. Login as debian (on the sd card) and edit /boot/uEnv.txt with nano (sudo nano /boot/uEnv.txt) or your preferred editor. I think if you edit this file on the eMMC, you will flash the sd card with what is on the eMMC.
##enable BBB: eMMC Flasher: #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
##enable BBB: eMMC Flasher: cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
I did not do the following, but in principle you can also update the Flasher Scripts:
cd /opt/scripts/ git pull and reboot the system, it'll flash the eMMC on the next bootup. (make sure to remove the microSD after flashing is complete, otherwise it'll just keep on re-flashing the eMMC)
You'll see the LEDs "rolling" for a while during the flash, then all four LEDs light up, then power is turned off. Next remove the SD card (or you'll wind up flashing again) and power
up. You have now reflashed the eMMC.