PLATFORM_TARGET=0 to target BeagleBone Black hardware. This is the default when no TARGET is specified.
Hardware peripherals
The following memory-mapped peripherals are used on BeagleBone Black:| Peripheral | Address | Description |
|---|---|---|
| UART0 | 0x44E09000 | TL16C750-compatible serial port |
| DMTIMER2 | 0x48040000 | General-purpose timer |
| INTCPS | 0x48200000 | ARM interrupt controller |
| CM_PER | 0x44E00000 | Clock Manager (peripheral clocks) |
| WDT1 | 0x44E35000 | Hardware watchdog timer |
Memory layout
The linker scriptlinker/linker_beagle.ld places the OS and both user processes in DDR RAM above 0x82000000:
| Region | Origin | Size |
|---|---|---|
os_ram | 0x82000000 | 256K |
p1_ram | 0x82100000 | 64K |
p1_stack | 0x82110000 | 4K |
p2_ram | 0x82200000 | 64K |
p2_stack | 0x82210000 | 4K |
linker/linker_beagle.ld
__bss_end__ and the stack top is the end of os_ram (0x82040000).
Building
Build for BeagleBone Black
Run either of the following commands from the project root:or use the convenience alias:The Makefile defaults to
TARGET=beagle when no target is specified, so a bare make also works.Deploying with U-Boot
U-Boot is the typical first-stage bootloader on BeagleBone Black. Two common methods to load the OS image are shown below.- fatload (SD card)
- tftp (network)
- bootelf (ELF)
Copy
bin/program.bin to the FAT partition of your SD card, then at the U-Boot prompt:go jumps directly to the raw binary entry point. Use this when loading program.bin.The OS entry point is
_start, defined in OS/root.s. All load addresses above must match os_ram origin 0x82000000.Watchdog
BeagleBone Black’s hardware watchdog (WDT1) starts counting down at power-on by default. If the OS does not disable it, the board resets after the watchdog period expires.watchdog_disable() in OS/watchdog.c sends the two-step magic sequence to the Watchdog Write Sequence and Pending Register:
OS/watchdog.c
WWPS) must clear between each step. This function is a no-op when compiled for QEMU (PLATFORM_TARGET == 1).
DMTIMER2 clock and timer
Enabling the clock
DMTIMER2 requires its functional clock to be enabled through the Clock Manager before use. The Makefile passesCM_PER_BASE=0x44E00000, and timer.c derives:
Lib/timer.c
timer_init(), the clock is enabled first:
Lib/timer.c
Timer configuration
The timer runs at 24 MHz on BeagleBone Black. The load register value is calculated to produce approximately a 2-second overflow period:Lib/timer.c
timer_init() sequence for BeagleBone Black:
Lib/timer.c
DMTIMER2_BASE (0x48040000):
| Macro | Offset | Description |
|---|---|---|
TISR | +0x28 | Interrupt Status Register |
TIER | +0x2C | Interrupt Enable Register |
TCLR | +0x38 | Timer Control Register |
TCRR | +0x3C | Timer Counter Register |
TLDR | +0x40 | Timer Load Register |
Environment file
The.venv.beagle file defines all platform addresses loaded by the Makefile when TARGET=beagle:
OS/.venv.beagle