Compiling Bela projects on the board » History » Version 5

« Previous - Version 5/11 (diff) - Next » - Current version
Giulio Moro, 2015-07-17 11:20 PM


Compiling BeagleRT projects on the board

A number of shell scripts are available in the scripts/ folder that allow you to edit your C++ files on the host machine, copy them over to the BBB and have your project built on the BBB without the need to install any tools on your host.

setup_board.sh

This script copies the core BeagleRT files to the BeagleBone, REMOVING any previous files found at that location. This should be done before running any of the other build scripts in this directory.

Arguments:

  • -b path : changes the default path, which is otherwise ~/BeagleRT

Usage:

setup_board.sh [-b path]

Run it with
$ scripts/setup_board.sh

You will be prompted with
Warning: this script will DELETE any existing BeagleRT files from your BeagleBone! Continue?

Press y to accept.

build_project.sh

This script copies a directory of source files to the BeagleBone, compiles and runs it. The BeagleRT core files should have first been copied over using the setup_board.sh script supplied with BeagleRT.
The source directory should contain at least one .c, .cpp or .S file.

Arguments:

  • -n : the executable will not be run after compiling.
  • -b path : will change the local path on the BeagleBone where the BeagleRT files are found (must match the one used for setup_board.ssh.
  • -c : passes command-line arguments to the BeagleRT program; enclose the argument string in quotes.

Usage:

build_project.sh [-nc][-b path/to/BeagleRT/on/BBB] path/to/project/files

$ scripts/build_project.sh projects/your_project_folder

you can list a mix of files and folders. These will be all copied to the ~/BeagleRT/source folder before compiling the project, e.g.:
$ scripts/build_project.sh projects/your_project_folder/render.cpp projects/your_project_folder/extras/
# will include the render.cpp file and all the files and folders in extras/

run_project.sh

This script runs the most recently compiled BeagleRT project on the BBB at the given path.

Arguments:

  • -b path : changes the default path, which is otherwise ~/BeagleRT.
  • -c commands : passes command-line arguments to the BeagleRT program; enclose the argument string in quotes.
  • -f : runs the project in the foreground of the current terminal, within a screen session that can be detached later (ctrl-a ctrl-d to detach from the screen session).

Usage:

run_project.sh [-b path] [-c "commands"] [-f]

connect_to_project.sh

This script brings an already running BeagleRT program to the foreground in the terminal, so it can be run interactively (e.g.: you can display the standard output).

Usage:

$ scripts/connect_to_project.sh

set_startup.sh

This script enables or disables running BeagleRT when the board starts up. Run it to make your script start automatically every time you power up the board.

stop_running.sh

This script stops the BeagleRT program running on the BeagleBone.

halt_board.sh

This script halts the BeagleBone Black. Run it and wait for the on-board LEDs to stop blinking before disconnecting the board.