Skip to content

Commit aa3ebf9

Browse files
committed
Completed usbipd guide + updated terminal styles
1 parent 8a3e568 commit aa3ebf9

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

docs/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default defineConfig({
2222
terminalTitlebarBackground: ['#414868', 'lightGray'],
2323
terminalTitlebarBorderBottomColor: ['gray', 'black'],
2424
terminalTitlebarDotsOpacity: '0.5',
25+
terminalTitlebarForeground: ['white', 'black']
2526
}
2627
},
2728
},

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ There are two main ways to flash to the OBC: **using the bootloader** or **using
3737
![UniFlash on flash](../../../assets/docs_images/uniflash2.png)
3838
5. Browse for the file with a `.out` suffix that you would like to flash and then press `Load Image`. Usually you will flash one of the following files...
3939
* `OBC-firmware.out` in the `build_arm` directory >> This contains the main app to run on the OBC.
40-
* `OBC-bl.out` in the `build_arm` directory >> This contains the bootloader for the OBC.
40+
* `OBC-bl.out` in the `build_arm` directory >> This contains the bootloader for the OBC.
4141
* An OBC example file from the `build_examples` directory >> This is for when you want to test specific functionality on the OBC (assuming you have written a test file for it and added it to the build script. See [Building Examples](/OBC-firmware/getting-started/build-examples/))
4242
:::note
4343
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 start working again.
@@ -46,7 +46,7 @@ There are two main ways to flash to the OBC: **using the bootloader** or **using
4646
### Accessing UART
4747
This is an important skill everyone should know just for debugging. We will go through the process for Windows and Linux.
4848
49-
#### Pre-requisites
49+
#### Base setup
5050
Both Linux and Windows have a program called `puTTY` available to download. `puTTY` is a great program to detect serial activity on ports so make sure you download this before proceeding!
5151
5252
1. Download and open `puTTY`. You should be greeted with the following screen...
@@ -60,14 +60,14 @@ Both Linux and Windows have a program called `puTTY` available to download. `puT
6060
4. If you know how to detect what USB port is connected to UART you can type that USB port into the `Serial line` field in `puTTY`. If you need help, read through the following sections!
6161
5. You can then press the `Open` button and there should be a black screen that starts printing out text sent by the board!
6262
63-
#### Finding USB port on Linux
63+
#### Finding USB port on Linux
6464
On Linux the port name will be in the form of `/dev/tty*`. For example the port could be named `/dev/ttyACM0` or `/dev/ttyUSB0`. To find the port connected to the board do the following...
6565
1. Open up a terminal without the board connected and type in the following command that will list out all file paths starting with `/dev/tty`
6666
```shell
6767
ls /dev/tty*
6868
```
6969
2. Now connect the board and repeat the same command.
70-
3. Look for differences in outputs between running the command before and after connecting the board. The `/dev/tty` file path that gets added the second time around is the port that your board is connected on!
70+
3. Look for differences in outputs between running the command before and after connecting the board. The `/dev/tty` file path that gets added the second time around is the port that your board is connected on!
7171
4. You can type the name of the port you have determined to be going to the board in the `Serial line` field in `puTTY`. If you are using JTAG and have to connect two USBs to your Linux system, you will have to experiment and see which port outputs logs on puTTY.
7272
7373
#### Finding USB port on Windows
@@ -76,9 +76,33 @@ On Windows the port name will be in the form of `COMXX` with `XX` denoting numbe
7676
![Device Manager Windows](../../../assets/docs_images/device-manager.webp)
7777
2. Under `Ports` try to find the COM port labelled with `UART` somewhere in it's name. Once you have found it that is the COM port you will be using in `puTTY`.
7878

79-
### Working with USB on WSL (WIP)
79+
### Working with USB on WSL (`usbipd`)
80+
Unfortunately Windows does not pass-through USB ports by default to WSL. Thus, we have to use a utility called `usbipd` to handle USB device pass-through in WSL. The following are the steps needed to attach/detach USB devices from WSL.
8081

81-
### Flashing via the bootloader (WIP)
82+
1. Open a `PowerShell` window. Within the window type the following command to find the bus-id of the USB device that you want to attach.
83+
84+
```shell title="PowerShell"
85+
usbipd list
86+
```
87+
You need to locate the device that has UART in it's name and make note of the busid that will show in the left most column of the command's output.
88+
2. If the device's `STATE` shows up as `shared`, you may skip this step else execute the command. The example is using the busid of `1-1` for demonstration purposes
89+
90+
```shell title="PowerShell"
91+
usbipd bind --busid 1-1
92+
```
93+
3. If the device's `STATE` shows up as `attached`, you may skip this step else execute the command. Again this example uses a busid of `1-1` for demonstration purposes.
94+
```shell title="PowerShell"
95+
96+
usbipd attach --wsl --busid 1-1
97+
```
98+
4. If you ever need to detach the USB port (to use `puTTY` for example) then you can run the following command. Again this example uses a busid of `1-1` for demonstration purposes.
99+
100+
```shell title="PowerShell"
101+
usbipd detach --busid 1-1
102+
```
103+
104+
105+
### Flashing via the bootloader
82106
1. Use UniFlash to flash the `OBC-bl.out` file, ensuring you have built it for the correct board using the right argument for the `-DBOARD_TYPE=` option.
83107
2. From the root directory activate the python virtual environment with the following command
84108

0 commit comments

Comments
 (0)