wiki:Boards/Beagle Board
Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

Version 2 (modified by Chris Johns, on 10/03/17 at 04:20:41) (diff)

Minor edits.

Beagle Board Support

The page details how to run RTEMS on a Beagle Board family of boards. The Beagle Boards are supported by U-Boot and U-Boot can boot RTEMS. Please refer to the U-Boot documentation and the internet for documentation and example on using U-Boot.

This page provide details on updating a Beaglebone Black board. Please update and support for other Beagle Boards.

Consoles

RTEMS uses the console for a booting and as the primary interface. These are UARTs on the Beagle Boards. We recommend you have a working console and the default Linux images from the Beagle Board project use the UART consoles when booting and initialising.

Beagleboard-MX Console

The Beagleboard-MX has a standard female DB9 RS-232 connector. You will need an RS-232 to USB converter.

Beagle Bone Console

The Beaglebone Black supports the standard 6pin inline UART TTL connector. You can purchase a TTL to USB cable that plugs onto this header. Please refer to the board's user manual for the details of the cable and how to connect it.

Boot Loader

U-Boot is the boot loader for the Beagle Board family. The following is for each board in the family.

Beaglebone Black

The Beaglebone Black has a TI Sitara AM3358BZCZ100 processor and it configured to boot from eMMC memory. The factory ships the board with U-Boot, Linux kernel, and a full file system in the eMMC memory. You need to update the eMMC image to latest for the best results.

To control the boot we need a recent U-Boot and a suitable uEnv.txt file on the SD card. The following procedure will create a suitable SD card image with a current U-Boot and uEnv.txt file.

To boot using TFTP the uEnv.txt contents is:

bootfile=bbb/rtems.img
loadaddr=0x82000000
uenvcmd=echo Booting RTEMS BBB from net; set autoload no; dhcp; set serverip 10.10.5.2; tftpboot bbb/rtems.img; bootm; reset;

The server IP address is the host machine running the rtems-test command.

Updating the eMMC

We recommend you upgrade this software to the latest found at https://rcn-ee.net/rootfs/bb.org/testing/2017-09-24/stretch-lxqt-2gb/. At the time of writing this the latest 2G image is 2G Beaglebone Black Debian 9.1 2017-09-24. Make sure you get a 2G image as this is the size of the eMMC on the a RevB Beaglebone Black. You need to use a 2G or great SD card.

$ xz -d bone-debian-9.1-lxqt-2gb-armhf-2017-09-24-2gb.img.xz
$ dd if=bone-debian-9.1-lxqt-2gb-armhf-2017-09-24-2gb.img of=/dev/da0 bs=1m
1700+0 records in
1700+0 records out
1782579200 bytes transferred in 180.028664 secs (9901641 bytes/sec)

Place the SD card into the Beaglebone Black board and hold the Boot switch and turn the power on. The Boot switch is S2 and is located at the same end of the board as the SD card, HDMI and USB master connectors. Hold the Boot button on until the leds all turn on. This takes a few seconds. If booting from the SD card the console will start showing something like:

U-Boot SPL 2017.09-00003-g11d92ba68a (Sep 21 2017 - 10:40:17)
Trying to boot from MMC1


U-Boot 2017.09-00003-g11d92ba68a (Sep 21 2017 - 10:40:17 -0500), Build: jenkins-github_Bootloader-Builder-602

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Board: BeagleBone Black

Once the system has booted you will have a Beagebone Black login:

Debian GNU/Linux 9 beaglebone ttyS0

BeagleBoard.org Debian Image 2017-09-24

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

beaglebone login:

Login as the default user using the provided password and then change to the /boot directory and open as root using sudo the u-Boot's user environment file (uEnv.txt) to edit, in this case using vi:

debian@beaglebone:~$ cd /boot
debian@beaglebone:/boot$ sudo vi uEnv.txt

At the end of the file is the Generic eMMC Flasher support. Uncomment the line to have:

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

Save the file and shutdown:

debian@beaglebone:/boot$ sudo shutdown -h now
[  529.915200] reboot: Power down

Remove the power from the board and again apply power while pressing the Boot switch as you did before. This time the console will show the eMMC flasher procedure:

************************************************************
==> Loaded

----------------------------------------

================================================================================
Writing bootloader to [/dev/mmcblk1]
----------------------------------------
==> Figuring out options for SPL U-Boot copy ...
===> Will use : count=1 seek=1 conv=notrunc bs=128k
==> Figuring out options for U-Boot copy ...
===> Will use : count=2 seek=1 conv=notrunc bs=384k
==> Copying SPL U-Boot with dd if=/opt/backup/uboot/MLO of=/dev/mmcblk1 count=1 seek=1 conv=notrunc bs=128k
------------------------------------------------------------
0+1 records in
0+1 records out
75080 bytes (75 kB, 73 KiB) copied, 0.0239506 s, 3.1 MB/s
------------------------------------------------------------
==> Copying U-Boot with dd if=/opt/backup/uboot/u-boot.img of=/dev/mmcblk1 count=2 seek=1 conv=notrunc bs=384k
------------------------------------------------------------
1+1 records in
1+1 records out
397640 bytes (398 kB, 388 KiB) copied, 0.188179 s, 2.1 MB/s
------------------------------------------------------------
Writing bootloader completed
================================================================================

================================================================================
Partitionning /dev/mmcblk1
----------------------------------------
sfdisk: [2.26.x or greater]
==> sfdisk parameters:
sfdisk: [sfdisk from util-linux 2.29.2]
sfdisk: [sfdisk --force /dev/mmcblk1]
sfdisk: [4M,,L,*]
==> Partitionning
------------------------------------------------------------
Checking that no-one is using this disk right now ... OK

Disk /dev/mmcblk1: 1.8 GiB, 1920991232 bytes, 3751936 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

>>> Created a new DOS disklabel with disk identifier 0xb759f922.
/dev/mmcblk1p1: Created a new partition 1 of type 'Linux' and of size 1.8 GiB.
/dev/mmcblk1p2: Done.

New situation:

Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk1p1 *     8192 3751935 3743744  1.8G 8[   63.419843]  mmcblk1: p1
3 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
------------------------------------------------------------

==> Partitionning Completed
==> Generated Partitions:
------------------------------------------------------------
Disk /dev/mmcblk1: 1.8 GiB, 1920991232 bytes, 3751936 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb759f922

Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk1p1 *     8192 3751935 3743744  1.8G 83 Linux
------------------------------------------------------------
================================================================================

================================================================================
Preparing future rootfs to receive files
----------------------------------------

==> Formatting rootfs with mkfs.ext4  -O ^metadata_csum,^64bit /dev/mmcblk1p1 -L rootfs
--------------------------------------------------------------------------------

mke2fs 1.43.4 (31-Jan-2017)
Discarding device blocks: done                            
Creating filesystem with 467968 4k blocks and 117120 inodes
Filesystem UUID: 1aa2f1b9-7a7c-4dbc-9d36-c7e01ce19540
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done 

--------------------------------------------------------------------------------
==> Formatting rootfs: /dev/mmcblk1p1 complete
==> Creating temporary rootfs directory (/tmp/rootfs)
==> Mounting /dev/mmcblk1p1 to /tmp/rootfs
[   77.717437] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null)

================================================================================

================================================================================
Copying: Current rootfs to /dev/mmcblk1p1
----------------------------------------
==> rsync: / -> /tmp/rootfs
----------------------------------------

The leds show activity. Once the procedure has finished remove the power and remove the SD card:

[  513.490441] reboot: Power down
[  513.493962] System will go to power_off state in approx. 1 second

Apply power and watch the board boot from the updated eMMC memory.