Skip to content

Commit ec0ded9

Browse files
committed
Updated styling + added obc build instructions
1 parent 14ec529 commit ec0ded9

File tree

14 files changed

+1008
-18
lines changed

14 files changed

+1008
-18
lines changed

docs/astro.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ export default defineConfig({
88
base: 'OBC-firmware',
99
integrations: [
1010
starlight({
11+
customCss: [
12+
'./src/styles/custom.css',
13+
],
14+
expressiveCode: {
15+
themes: ['github-light-high-contrast', 'tokyo-night'],
16+
removeUnusedThemes: true,
17+
},
1118
title: 'UW Orbital',
1219
social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/UWOrbital/OBC-firmware' }],
1320
sidebar: [

docs/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
"astro": "^5.6.1",
1515
"sharp": "^0.34.2"
1616
}
17-
}
17+
}
210 KB
Loading
452 KB
Loading

docs/src/assets/houston.webp

-96.2 KB
Binary file not shown.

docs/src/assets/icon.png

158 KB
Loading
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: Building for the OBC
3+
description: On how to build for the board
4+
---
5+
The following is a simple guide for building the app for the OBC and flashing.
6+
7+
## Compiling for the OBC
8+
1. From the root directory you can run the following commands
9+
```shell
10+
mkdir -p build_arm && cd build_arm
11+
cmake .. -DCMAKE_BUILD_TYPE=OBC
12+
cmake --build .
13+
```
14+
15+
:::tip[Tip: Reducing Build Time]{icon="setting"}
16+
The `cmake --build .` takes some time to run since it is using a single thread to compile. To speed up the process we can use one of the following commands
17+
1. `make -j 16` (Recommended for most systems)
18+
2. `make -j 32` (This is faster but depends on if your system can handle 32 parallel jobs)
19+
:::
20+
2. There are also plenty of extra options that you can use besides `-DCMAKE_BUILD_TYPE` by appending them to the `cmake ..` command. Take a look at the [CMake Options Guide](/OBC-firmware/getting-started/cmake-options/).
21+
22+
:::caution
23+
Make sure to specify the `-DBOARD_TYPE=` option to avoid any unwanted behavior
24+
:::
25+
26+
## Flashing to the OBC
27+
There are two main ways to flash to the OBC: **using the bootloader** or **using UniFlash**. UniFlash is the more common way so let's go over that first.
28+
29+
### Flashing Via UniFlash
30+
1. When you open UniFlash you should be greeted with the following screen...
31+
32+
![UniFlash on startup](../../../assets/docs_images/uniflash.png)
33+
2. For the chip select `RM46L852` if you are using OBC Revision 1 or OBC Revision 2. If you are using the Launchpad, seletc `LAUNCHXL2-RM46`.
34+
3. Then for the connection, choose `Texas Instruments XDS110 USB Debug Probe`
35+
4. Now press `Start` and you should see the following screen.
36+
37+
![UniFlash on flash](../../../assets/docs_images/uniflash2.png)
38+
5. Browse for the file you would like to flash and then press `Load Image`.
39+
:::note
40+
UniFlash may get stuck sometimes and throw errors. In such cases, navigate to session on the top red bar and start a new session. You will have to reconfigure UniFlash but it should get working again.
41+
:::
42+
### Flashing Via the Bootloader (WIP)
43+
1. Use UniFlash to flash the `OBC-bl.out` file, ensuring you have built it for the correct board.
44+
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: CMake Options Guide
3+
description: Some useful options and options that we have defined
4+
---
5+
The following is a list of options along with their brief description. The guide is divided into most used and extra for convenience. You can go to the end of this page for examples on how to chain these options together.
6+
7+
:::note
8+
**Options suffixed with an equal sign should have an argument passed into them.** Options without an equal sign suffix just need to be specified, no arguments needed.
9+
10+
If an argument is marked as **Default**, it will be the default argument that is used if the option is not specified. If there are no arguments marked as default then nothing will happen.
11+
:::
12+
13+
## Most Used Options
14+
These are options that you will frequently be using while compiling. **Unless otherwise specified these options are to be use within the `build_arm` directory of the project**
15+
16+
### `-DCMAKE_BUILD_TYPE=` (Can be used in directories other than `build_arm`)
17+
This specifies what the current build directory is for. You can pass either of the **four** arguments into this command...
18+
* `OBC`: Used to build for the board (use in the `build_arm` directory)
19+
* `GS`: Used to build code for the ground station (use in the `build_gs` directory)
20+
* `Test`: Used to build the testing directory for the interfaces (use in the `build` folder)
21+
* `Examples`: Used to build examples which are barebone binaries to test certain functionality on the board (use in the `build_examples` directory)
22+
23+
### `-DBOARD_TYPE=`
24+
This option specifies the board that the binary is being built for since different board files will require different HAL (Hardware Abstraction Layer) files to be sourced. You can pass either of the **three** arguments...
25+
* **Default** `RM46_LAUNCHPAD`: Build the files for the launchpad board
26+
* `OBC_REVISION_1`: Build the files for the first revision of the OBC
27+
* `OBC_REVISION_2`: Build the files for the second revision of the OBC
28+
29+
30+
## Extra Options
31+
32+
### `-DDEBUG`
33+
If specified, this removes all optimization flags to debug. Sometimes optimizations can interfere with critical code but, first check your code's logic before using this option.
34+
35+
### `-DLOG_DEFAULT_LEVEL=`
36+
Specifies the default level for logs. You can pass any enum in the `obc_logging.h` file to this option.
37+
38+
### `-DENABLE_BL_BYPASS=`
39+
A boolean (takes a 0 or a 1) that specifies whether the app should bypass the bootloader (when you want to flash without the bootloader) to load the app. The boolean values define the following functionality...
40+
* `0`: The app should not bypass the bootloader and write to the `0x0` address (this is the default address the board looks for to load a program).
41+
* **Default** `1`: The app should bypass the bootloader and write to `0x0`
42+
43+
### `-DCOMMS_PHY=`
44+
:::tip[Warning]{icon="seti:html"}
45+
This option is not fully implemented yet. It's for when comms is complete.
46+
:::
47+
48+
### `-DOBC_UART_BAUD_RATE=`
49+
This option helps set the baud rate for the board.
50+
:::caution
51+
When using this option, you have to change the baud rate in the HAL using **`HALCOGen`**
52+
:::
53+
You can pass any **valid integer baud rate** into this option.
54+
55+
### `-DENABLE_TASK_STATS_COLLECTOR`
56+
This option enables or disables the task stats collector (statistics on how much memory/cpu each task is using sent via logs). This is a boolean option with each argument defining the functionality...
57+
* `0`: The app should not send task statistics via logs
58+
* **Default** `1`: The app should send task statistics via logs
59+
60+
### `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`
61+
This is a useful option for IDEs like `neovim` that use Language Servers that require a `compile_commands.json` file. If specified this command will generate a `compile_commands.json` file, else it will not.
62+
:::tip
63+
By default cmake will generate this file in the directory you use the `cmake ..` command in. You may have to create a symbolic link to a `compile_commands.json` file in your root directory.
64+
:::
65+
66+
## Examples
67+
The following are some examples that might be useful in understanding how to define these options.
68+
69+
1. Say you wanted to build for the 1st revision of the obc and wanted to use the bootloader.
70+
```shell
71+
cmake .. -DCMAKE_BUILD_TYPE=OBC -DBOARD_TYPE=OBC_REVISION_1 -DENABLE_BL_BYPASS=0
72+
```
73+
74+
2. Say you wanted to build for the 2nd revision of the obc and wanted to output compile commands as well.
75+
```shell
76+
cmake .. -DCMAKE_BUILD_TYPE=OBC -DBOARD_TYPE=OBC_REVISION_2 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
77+
```

docs/src/content/docs/getting-started/obc-build.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)