Compiling Bela projects on the board » History » Version 5
Giulio Moro, 2015-07-17 11:20 PM
1 | 1 | Giulio Moro | h1. Compiling BeagleRT projects on the board |
---|---|---|---|
2 | 1 | Giulio Moro | |
3 | 1 | 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. |
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 | 1 | Giulio Moro | $ scripts/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 | 1 | Giulio Moro | |
41 | 1 | Giulio Moro | h3. Usage: |
42 | 2 | Giulio Moro | |
43 | 1 | Giulio Moro | <pre> |
44 | 1 | Giulio Moro | build_project.sh [-nc][-b path/to/BeagleRT/on/BBB] path/to/project/files |
45 | 1 | Giulio Moro | </pre> |
46 | 1 | Giulio Moro | <pre> |
47 | 1 | Giulio Moro | $ scripts/build_project.sh projects/your_project_folder |
48 | 1 | Giulio Moro | </pre> |
49 | 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.: |
50 | 1 | Giulio Moro | <pre> |
51 | 1 | Giulio Moro | $ scripts/build_project.sh projects/your_project_folder/render.cpp projects/your_project_folder/extras/ |
52 | 1 | Giulio Moro | # will include the render.cpp file and all the files and folders in extras/ |
53 | 1 | Giulio Moro | </pre> |
54 | 1 | Giulio Moro | |
55 | 2 | Giulio Moro | |
56 | 2 | Giulio Moro | h2. @run_project.sh@ |
57 | 2 | Giulio Moro | |
58 | 4 | Giulio Moro | This script runs the most recently compiled BeagleRT project on the BBB at the given path. |
59 | 1 | Giulio Moro | |
60 | 5 | Giulio Moro | h3. Arguments: |
61 | 5 | Giulio Moro | |
62 | 1 | Giulio Moro | * *-b path* : changes the default path, which is otherwise ~/BeagleRT. |
63 | 1 | Giulio Moro | * *-c commands* : passes command-line arguments to the BeagleRT program; enclose the argument string in quotes. |
64 | 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). |
65 | 1 | Giulio Moro | |
66 | 5 | Giulio Moro | h3. Usage: |
67 | 5 | Giulio Moro | |
68 | 1 | Giulio Moro | <pre> |
69 | 1 | Giulio Moro | run_project.sh [-b path] [-c "commands"] [-f] |
70 | 1 | Giulio Moro | </pre> |
71 | 1 | Giulio Moro | |
72 | 2 | Giulio Moro | |
73 | 2 | Giulio Moro | h2. @connect_to_project.sh@ |
74 | 2 | Giulio Moro | |
75 | 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). |
76 | 1 | Giulio Moro | |
77 | 4 | Giulio Moro | h3. Usage: |
78 | 5 | Giulio Moro | |
79 | 1 | Giulio Moro | <pre> |
80 | 1 | Giulio Moro | $ scripts/connect_to_project.sh |
81 | 1 | Giulio Moro | </pre> |
82 | 1 | Giulio Moro | |
83 | 1 | Giulio Moro | |
84 | 2 | Giulio Moro | h2. @set_startup.sh@ |
85 | 1 | Giulio Moro | |
86 | 2 | Giulio Moro | 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. |
87 | 1 | Giulio Moro | |
88 | 2 | Giulio Moro | |
89 | 2 | Giulio Moro | h2. @stop_running.sh@ |
90 | 2 | Giulio Moro | |
91 | 2 | Giulio Moro | This script stops the BeagleRT program running on the BeagleBone. |
92 | 2 | Giulio Moro | |
93 | 2 | Giulio Moro | |
94 | 2 | Giulio Moro | h2. @halt_board.sh@ |
95 | 3 | Giulio Moro | |
96 | 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. |