Compiling Bela projects on the board » History » Version 8

Andrew McPherson, 2015-07-19 05:51 PM

1 1 Giulio Moro
h1.  Compiling BeagleRT projects on the board
2 1 Giulio Moro
3 7 Giulio Moro
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. The files need to be runing from 
4 1 Giulio Moro
5 1 Giulio Moro
h2. @setup_board.sh@
6 1 Giulio Moro
7 1 Giulio Moro
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.
8 1 Giulio Moro
9 1 Giulio Moro
10 1 Giulio Moro
h3. Arguments:
11 1 Giulio Moro
12 1 Giulio Moro
* *-b path* : changes the default path, which is otherwise ~/BeagleRT
13 1 Giulio Moro
14 1 Giulio Moro
h3. Usage:
15 5 Giulio Moro
16 1 Giulio Moro
<pre>
17 1 Giulio Moro
setup_board.sh [-b path]
18 1 Giulio Moro
</pre>
19 1 Giulio Moro
Run it with
20 1 Giulio Moro
<pre>
21 7 Giulio Moro
$ ./setup_board.sh
22 1 Giulio Moro
</pre>
23 1 Giulio Moro
You will be prompted with 
24 1 Giulio Moro
<pre>
25 1 Giulio Moro
Warning: this script will DELETE any existing BeagleRT files from your BeagleBone! Continue?
26 1 Giulio Moro
</pre>
27 1 Giulio Moro
Press *y* to accept.
28 1 Giulio Moro
29 1 Giulio Moro
30 1 Giulio Moro
h2. @build_project.sh@
31 1 Giulio Moro
32 1 Giulio Moro
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.
33 1 Giulio Moro
The source directory should contain at least one .c, .cpp or .S file.
34 1 Giulio Moro
35 1 Giulio Moro
h3. Arguments:
36 5 Giulio Moro
37 1 Giulio Moro
* *-n* : the executable will not be run after compiling.
38 1 Giulio Moro
* *-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@.
39 1 Giulio Moro
* *-c* : passes command-line arguments to the BeagleRT program; enclose the argument string in quotes.
40 8 Andrew McPherson
* *-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).
41 8 Andrew McPherson
* *-F*: runs the project in the foreground of the current terminal, without using screen
42 1 Giulio Moro
43 1 Giulio Moro
h3. Usage:
44 2 Giulio Moro
45 1 Giulio Moro
<pre>
46 1 Giulio Moro
build_project.sh [-nc][-b path/to/BeagleRT/on/BBB] path/to/project/files
47 1 Giulio Moro
</pre>
48 1 Giulio Moro
<pre>
49 7 Giulio Moro
$ ./build_project.sh projects/your_project_folder
50 1 Giulio Moro
</pre>
51 1 Giulio Moro
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.:
52 1 Giulio Moro
<pre>
53 7 Giulio Moro
$ build_project.sh projects/your_project_folder/render.cpp projects/your_project_folder/extras/
54 1 Giulio Moro
# will include the render.cpp file and all the files and folders in extras/
55 1 Giulio Moro
</pre>
56 1 Giulio Moro
57 2 Giulio Moro
58 2 Giulio Moro
h2. @run_project.sh@
59 2 Giulio Moro
60 4 Giulio Moro
This script runs the most recently compiled BeagleRT project on the BBB at the given path.
61 1 Giulio Moro
62 5 Giulio Moro
h3. Arguments:
63 5 Giulio Moro
64 1 Giulio Moro
* *-b path* : changes the default path, which is otherwise ~/BeagleRT. 
65 1 Giulio Moro
* *-c commands* : passes command-line arguments to the BeagleRT program; enclose the argument string in quotes.
66 1 Giulio Moro
* *-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).
67 8 Andrew McPherson
* *-F*: runs the project in the foreground of the current terminal, without using screen
68 1 Giulio Moro
69 5 Giulio Moro
h3. Usage:
70 5 Giulio Moro
71 1 Giulio Moro
<pre>
72 1 Giulio Moro
run_project.sh [-b path] [-c "commands"] [-f]
73 1 Giulio Moro
</pre>
74 1 Giulio Moro
75 1 Giulio Moro
76 1 Giulio Moro
h2. @connect_to_project.sh@
77 1 Giulio Moro
78 1 Giulio Moro
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).
79 1 Giulio Moro
80 2 Giulio Moro
h2. @set_startup.sh@
81 1 Giulio Moro
82 6 Andrew McPherson
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.
83 1 Giulio Moro
84 2 Giulio Moro
85 2 Giulio Moro
h2. @stop_running.sh@
86 2 Giulio Moro
87 2 Giulio Moro
This script stops the BeagleRT program running on the BeagleBone.
88 2 Giulio Moro
89 2 Giulio Moro
90 2 Giulio Moro
h2. @halt_board.sh@
91 3 Giulio Moro
92 1 Giulio Moro
This script halts the BeagleBone Black. Run it and wait for the on-board LEDs to stop blinking before disconnecting the board.