Compiling Bela projects on the board » History » Version 10

« Previous - Version 10/11 (diff) - Next » - Current version
Giulio Moro, 2015-12-25 10:43 AM


Compiling Bela 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. This way you can, e.g.: keep using your favourite text editor and feel a bit geek on the CLI.
You have to cd into the scripts/ folder before running the scripts below.

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
$ ./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.
  • -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).
  • -F: runs the project in the foreground of the current terminal, without using screen

Usage:

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

$ ./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.:
$ 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).
  • -F: runs the project in the foreground of the current terminal, without using screen

Usage:

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

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).

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. If the -n argument is passed, auto-running at startup is disabled. Otherwise, it is enabled. Like run_project.sh, the -c argument allows command line arguments to be passed to the program. The -l argument will run the BeagleRT program in a loop, automatically restarting it if it quits or crashes.

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.