Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 1 | # Getting Started |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 2 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 3 | This guide will walk you through setup and general use of Pigweed. |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 4 | We hope to make the setup process as smooth as possible. If any of this doesn't |
Armando Montanez | 3d92e81 | 2020-03-19 12:13:36 -0700 | [diff] [blame] | 5 | work, please [let us know](mailto:pigweed@googlegroups.com). |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 6 | |
Keir Mierle | 086ef1c | 2020-03-19 02:03:51 -0700 | [diff] [blame] | 7 | ## Express setup |
| 8 | |
Armando Montanez | 3d92e81 | 2020-03-19 12:13:36 -0700 | [diff] [blame] | 9 | If you'd like to skip the detailed explanations, below is the shorter version of |
| 10 | getting setup for Pigweed. If you run into trouble, look at the more in-depth |
| 11 | guide below, starting at [Prerequisites](getting_started.md#prerequisites). The |
| 12 | express setup configures Pigweed's watcher for three targets to give a taste of |
| 13 | Pigweed: |
Keir Mierle | 086ef1c | 2020-03-19 02:03:51 -0700 | [diff] [blame] | 14 | |
| 15 | 1. **Host** - Mac, Linux, or Windows. Builds and runs tests |
| 16 | 2. **Device/STM32F429** - Build only; see later in the guide to run tests on |
| 17 | device |
| 18 | 3. **Docs** - Builds the Pigweed docs |
| 19 | |
| 20 | To get setup: |
| 21 | |
| 22 | (1) Make sure you have Git and Python installed and on your path. |
| 23 | |
| 24 | (2) Clone Pigweed and bootstrap the environment (compiler setup & more). **Be |
| 25 | patient, this step downloads ~1GB of LLVM, GCC, and other tooling**. |
| 26 | |
| 27 | ```bash |
| 28 | $ cd ~ |
| 29 | $ git clone https://pigweed.googlesource.com/pigweed/pigweed |
| 30 | ... |
| 31 | $ cd pigweed |
Rob Mohr | 63304bf | 2020-03-27 10:31:40 -0700 | [diff] [blame] | 32 | $ source ./bootstrap.sh |
Keir Mierle | 086ef1c | 2020-03-19 02:03:51 -0700 | [diff] [blame] | 33 | ... |
| 34 | ``` |
| 35 | |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 36 | (3) Configure the GN build. |
Keir Mierle | 086ef1c | 2020-03-19 02:03:51 -0700 | [diff] [blame] | 37 | |
| 38 | ```bash |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 39 | $ gn gen out |
| 40 | Done. Made 1047 targets from 91 files in 114ms |
Keir Mierle | 086ef1c | 2020-03-19 02:03:51 -0700 | [diff] [blame] | 41 | ``` |
| 42 | |
| 43 | (4) Start the watcher. The watcher will invoke Ninja to build all the targets |
| 44 | |
| 45 | ```bash |
Armando Montanez | 7366d5a | 2020-06-17 15:04:43 -0700 | [diff] [blame] | 46 | $ pw watch out default stm32f429i |
Keir Mierle | 086ef1c | 2020-03-19 02:03:51 -0700 | [diff] [blame] | 47 | |
| 48 | ▒█████▄ █▓ ▄███▒ ▒█ ▒█ ░▓████▒ ░▓████▒ ▒▓████▄ |
| 49 | ▒█░ █░ ░█▒ ██▒ ▀█▒ ▒█░ █ ▒█ ▒█ ▀ ▒█ ▀ ▒█ ▀█▌ |
| 50 | ▒█▄▄▄█░ ░█▒ █▓░ ▄▄░ ▒█░ █ ▒█ ▒███ ▒███ ░█ █▌ |
| 51 | ▒█▀ ░█░ ▓█ █▓ ░█░ █ ▒█ ▒█ ▄ ▒█ ▄ ░█ ▄█▌ |
| 52 | ▒█ ░█░ ░▓███▀ ▒█▓▀▓█░ ░▓████▒ ░▓████▒ ▒▓████▀ |
| 53 | |
| 54 | 20200319 01:41:37 INF Starting Pigweed build watcher |
| 55 | 20200319 01:41:37 INF Searching for GN build dirs... |
| 56 | 20200319 01:41:37 INF Will build [1/3]: out/host |
| 57 | 20200319 01:41:37 INF Will build [2/3]: out/disco |
| 58 | 20200319 01:41:37 INF Will build [3/3]: out/docs |
| 59 | 20200319 01:41:39 INF Directory to watch: $HOME/wrk/pigweed |
| 60 | 20200319 01:41:39 INF Watching for file changes. Ctrl-C exits. |
| 61 | 20200319 01:41:39 INF Triggering initial build... |
| 62 | ... |
| 63 | ``` |
| 64 | |
| 65 | (5) **Congratulations, you're ready to go!** Now take Pigweed for a spin with |
| 66 | the below steps. |
| 67 | |
| 68 | (6) With the watcher running in a separate window, edit |
| 69 | `pw_status/status_test.cc` to make an expectation fail; for example, add |
| 70 | `EXPECT_EQ(0, 1);` in a test. |
| 71 | |
| 72 | (7) Save the file. Observe the watcher rebuild & retest, and fail. Restore the |
| 73 | test if you feel like it. |
| 74 | |
| 75 | (8) Open the generated docs in `out/docs/gen/docs/html/index.html` in your |
| 76 | browser. |
| 77 | |
| 78 | (9) Edit `docs/getting_started.md` (this file!) and make any change. Save. See |
| 79 | the watcher rebuild the docs. Reload your browser, and see the changes. |
| 80 | |
| 81 | See below for equivalent Windows commands, and for more details on what each |
| 82 | part does. |
| 83 | |
| 84 | **Note:** After running bootstrap once, use `. ./activate.sh` (or |
| 85 | `activate.bat` on Windows) to re-activate the environment without |
| 86 | re-bootstrapping. |
| 87 | |
Armando Montanez | 7b7a32f | 2020-03-18 11:02:41 -0700 | [diff] [blame] | 88 | ## Prerequisites |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 89 | |
| 90 | **Linux**<br/> |
Keir Mierle | 086ef1c | 2020-03-19 02:03:51 -0700 | [diff] [blame] | 91 | Most Linux installations should work out of box, and not require any manual |
| 92 | installation of prerequisites beyond basics like `git` and `build-essential`. |
Armando Montanez | 3d92e81 | 2020-03-19 12:13:36 -0700 | [diff] [blame] | 93 | Make sure gcc is set to gcc-8. |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 94 | |
| 95 | **macOS**<br/> |
Rob Mohr | 5808f04 | 2020-03-23 08:25:42 -0700 | [diff] [blame] | 96 | On macOS you may get SSL certificate errors with the system Python |
| 97 | installation. Run `sudo pip install certifi` to fix this. If you get SSL |
| 98 | errors with the Python from [Homebrew](https://brew.sh) try running the |
| 99 | following commands to ensure Python knows how to use OpenSSL. |
| 100 | |
| 101 | ```bash |
| 102 | brew install openssl |
| 103 | brew uninstall python |
| 104 | brew install python |
| 105 | ``` |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 106 | |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 107 | To flash firmware to a STM32 Discovery development board (and run `pw test`) |
Rob Mohr | 5808f04 | 2020-03-23 08:25:42 -0700 | [diff] [blame] | 108 | from macOS, you will need to install OpenOCD. Install |
| 109 | [Homebrew](https://brew.sh), then install OpenOCD with `brew install openocd`. |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 110 | |
| 111 | **Windows**<br/> |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 112 | To start using Pigweed on Windows, you'll need to install |
| 113 | [Git](https://git-scm.com/download/win) and |
| 114 | [Python](https://www.python.org/downloads/windows/) (2.7 or above). We recommend |
| 115 | you install Git to run from the command line and third party software. |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 116 | |
Armando Montanez | 7b7a32f | 2020-03-18 11:02:41 -0700 | [diff] [blame] | 117 | If you plan to flash devices with firmware, you'll need to install OpenOCD and |
| 118 | ensure it's on your system path. |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 119 | |
Armando Montanez | 7b7a32f | 2020-03-18 11:02:41 -0700 | [diff] [blame] | 120 | ## Bootstrap |
| 121 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 122 | Once you satisfied the prerequisites, you will be able to clone Pigweed and |
Armando Montanez | 7b7a32f | 2020-03-18 11:02:41 -0700 | [diff] [blame] | 123 | run the bootstrap that initializes the Pigweed virtual environment. The |
| 124 | bootstrap may take several minutes to complete, so please be patient. |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 125 | |
| 126 | **Linux/macOS** |
| 127 | ```bash |
Wyatt Hepler | 41f4d48 | 2020-03-18 16:03:19 -0700 | [diff] [blame] | 128 | $ git clone https://pigweed.googlesource.com/pigweed/pigweed ~/pigweed |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 129 | $ cd ~/pigweed |
Rob Mohr | 63304bf | 2020-03-27 10:31:40 -0700 | [diff] [blame] | 130 | $ source ./bootstrap.sh |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 131 | ``` |
| 132 | |
| 133 | **Windows** |
| 134 | ```batch |
| 135 | :: Run git commands from the shell you set up to use with Git during install. |
Wyatt Hepler | 41f4d48 | 2020-03-18 16:03:19 -0700 | [diff] [blame] | 136 | > git clone https://pigweed.googlesource.com/pigweed/pigweed %HOMEPATH%\pigweed |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 137 | > cd %HOMEPATH%\pigweed |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 138 | > bootstrap.bat |
| 139 | ``` |
| 140 | |
| 141 | Below is a real-time demo with roughly what you should expect to see as output: |
| 142 | |
Armando Montanez | 7b7a32f | 2020-03-18 11:02:41 -0700 | [diff] [blame] | 143 |  |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 144 | |
Armando Montanez | 7b7a32f | 2020-03-18 11:02:41 -0700 | [diff] [blame] | 145 | Congratulations, you are now set up to start using Pigweed! |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 146 | |
| 147 | ## Pigweed Environment |
| 148 | |
| 149 | After going through the initial setup process, your current terminal will be in |
| 150 | the Pigweed development environment that provides all the tools you should need |
Armando Montanez | 7b7a32f | 2020-03-18 11:02:41 -0700 | [diff] [blame] | 151 | to develop on Pigweed. If you leave that session, you can activate the |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 152 | environment in a new session with the following command: |
| 153 | |
| 154 | **Linux/macOS** |
| 155 | ```bash |
Keir Mierle | 8e75422 | 2020-03-17 13:11:33 -0700 | [diff] [blame] | 156 | $ . ./activate.sh |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 157 | ``` |
| 158 | |
| 159 | **Windows** |
| 160 | ```batch |
Wyatt Hepler | 1054369 | 2020-03-18 17:30:43 -0700 | [diff] [blame] | 161 | > activate.bat |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 162 | ``` |
| 163 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 164 | Some major changes may require triggering the bootstrap again, so if you run |
| 165 | into host tooling changes after a pull it may be worth re-running bootstrap. |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 166 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 167 | ## Build Pigweed for Host |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 168 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 169 | Pigweed's primary build system is GN/Ninja based. There are CMake and Bazel |
| 170 | builds in-development, but they are incomplete and don't have feature parity |
| 171 | with the GN build. We strongly recommend you stick to the GN build system. |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 172 | |
| 173 | GN (Generate Ninja) just does what it says on the tin; GN generates |
| 174 | [Ninja](https://ninja-build.org/) build files. |
| 175 | |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 176 | The default GN configuration generates build files that allow you to build host |
| 177 | binaries, device binaries, and upstream documentation all in one Ninja |
| 178 | invocation. |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 179 | |
| 180 | Run GN as seen below: |
| 181 | |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 182 | ```bash |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 183 | $ gn gen out |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 184 | ``` |
| 185 | |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 186 | Note that `out` is simply the directory the build files are saved to. Unless |
| 187 | this directory is deleted or you desire to do a clean build, there's no need to |
| 188 | run GN again; just rebuild using Ninja directly. |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 189 | |
| 190 | Now that we have build files, it's time to build Pigweed! |
| 191 | |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 192 | Now you *could* manually invoke the host build using `ninja -C out` every |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 193 | time you make a change, but that's tedious. Instead, let's use `pw_watch`. |
| 194 | |
| 195 | Go ahead and start `pw_watch`: |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 196 | |
| 197 | ```bash |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 198 | $ pw watch |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 199 | ``` |
| 200 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 201 | When `pw_watch` starts up, it will automatically build the directory we |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 202 | generated in `out`. Additionally, `pw_watch` watches source code files for |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 203 | changes, and triggers a Ninja build whenever it notices a file has been saved. |
| 204 | You might be surprised how much time it can save you! |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 205 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 206 | With `pw watch` running, try modifying `pw_status/public/pw_status/status.h` and |
| 207 | watch the build re-trigger when you save the file. |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 208 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 209 | See below for a demo of this in action: |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 210 | |
| 211 |  |
| 212 | |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 213 | ## Running Unit Tests |
| 214 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 215 | Fun fact, you've been running the unit tests already! Ninja builds targeting the |
| 216 | host automatically build and run the unit tests. Unit tests err on the side of |
| 217 | being quiet in the success case, and only output test results when there's a |
| 218 | failure. |
| 219 | |
| 220 | To see the a test failure, you can modify `pw_status/status_test.cc` to fail |
| 221 | by changing one of the strings in the "KnownString" test. |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 222 | |
| 223 |  |
| 224 | |
| 225 | Running tests as part of the build isn't particularly expensive because GN |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 226 | caches passing tests. Each time you build, only the tests that are affected |
| 227 | (whether directly or transitively) by the code changes since the last build will |
| 228 | be re-built and re-run. |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 229 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 230 | Try running the `pw_status` test manually: |
| 231 | ```bash |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 232 | $ ./host_[compiler]/obj/pw_status/status_test |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 233 | ``` |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 234 | |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 235 | Depending on your host OS, `[compiler]` will default to either Clang or GCC. |
| 236 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 237 | ## Building for a Device |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 238 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 239 | As mentioned previously, Pigweed builds for host by default. In the context of |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 240 | Pigweed, a Pigweed "target" is a build configuration that includes a toolchain, |
| 241 | default library configurations, and more to result in binaries that run |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 242 | natively on the target. |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 243 | |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 244 | Switch to the window running `pw_watch`, and quit using `ctrl+c`. To get |
| 245 | `pw_watch` to build the new STM32F429I-DISC1 target, re-launch by specifying |
| 246 | which Ninja targets to build: |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 247 | |
| 248 | ```bash |
Armando Montanez | 7366d5a | 2020-06-17 15:04:43 -0700 | [diff] [blame] | 249 | $ pw watch out default stm32f429i |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 250 | ``` |
| 251 | |
| 252 | This is equivalent to the following Ninja invocation: |
| 253 | |
| 254 | ```bash |
| 255 | $ ninja -C out default stm32f429i |
| 256 | ``` |
| 257 | |
| 258 | Or since the "default" target builds host and docs, |
| 259 | |
| 260 | ```bash |
| 261 | $ ninja -C out host docs stm32f429i |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 262 | ``` |
| 263 | |
| 264 | Now `pw_watch` is building for host and a device! |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 265 | |
| 266 | ## Running Tests on a Device |
| 267 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 268 | While tests run automatically on the host, it takes a few more steps to get |
| 269 | tests to run automatically on a device, too. Even though we've verified tests |
| 270 | pass on the host, it's crucial to verify the same with on-device testing. We've |
| 271 | encountered some unexpected bugs that can only be found by running the unit |
| 272 | tests directly on the device. |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 273 | |
| 274 | ### 1. Connect Device(s) |
| 275 | Connect any number of STM32F429I-DISC1 boards to your computer using the mini |
| 276 | USB port on the board (**not** the micro USB). Pigweed will automatically detect |
| 277 | the boards and distribute the tests across the devices. More boards = faster |
| 278 | tests! |
| 279 | |
Armando Montanez | bcc194b | 2020-03-10 10:23:18 -0700 | [diff] [blame] | 280 |  |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 281 | |
| 282 | ### 2. Launch Test Server |
| 283 | To allow Ninja to run tests on an arbitrary number of devices, Ninja will send |
| 284 | test requests to a server running in the background. Launch the server in |
| 285 | another window using the command below (remember, you'll need to activate the |
Armando Montanez | 3d92e81 | 2020-03-19 12:13:36 -0700 | [diff] [blame] | 286 | Pigweed environment first). |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 287 | |
| 288 | ```shell |
| 289 | $ stm32f429i_disc1_test_server |
| 290 | ``` |
| 291 | |
| 292 | **Note:** If you attach or detach any more boards to your workstation you'll |
| 293 | need to relaunch this server. |
| 294 | |
| 295 | ### 3. Configure GN |
| 296 | |
| 297 | We can tell GN to use the testing server by enabling a build arg specific to |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 298 | the stm32f429i-disc1 target. |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 299 | |
| 300 | ```shell |
| 301 | $ gn args out/disco |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 302 | # Append this line to the file that opens in your editor to tell GN to run |
| 303 | # on-device unit tests. |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 304 | pw_use_test_server = true |
| 305 | ``` |
| 306 | |
| 307 | ### Done! |
| 308 | |
| 309 | Whenever you make code changes and trigger a build, all the affected unit tests |
| 310 | will be run across the attached boards! |
| 311 | |
Armando Montanez | 4db74e1 | 2020-03-17 15:55:59 -0700 | [diff] [blame] | 312 | See the demo below for an example of what this all looks like put together: |
| 313 | |
| 314 |  |
| 315 | |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 316 | ## Building the Documentation |
| 317 | |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 318 | In addition to the markdown documentation, Pigweed has a collection of |
| 319 | information-rich RST files that are built by the default invocation of GN. You |
| 320 | will find the documents at `out/docs/gen/docs/html`. |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 321 | |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 322 | You can build the documentation manually by with the command below. |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 323 | |
Armando Montanez | a761e32 | 2020-06-15 16:30:40 -0700 | [diff] [blame] | 324 | ```shell |
| 325 | $ ninja -C out docs |
Armando Montanez | f25bc9f | 2020-03-18 11:42:59 -0700 | [diff] [blame] | 326 | ``` |
| 327 | |
Armando Montanez | 1d00120 | 2020-03-04 11:51:32 -0800 | [diff] [blame] | 328 | ## Next steps |
| 329 | |
| 330 | This concludes the introduction to developing with Pigweed. If you'd like to see |
| 331 | more of what Pigweed has to offer, feel free to dive into the per-module |
Armando Montanez | 3d92e81 | 2020-03-19 12:13:36 -0700 | [diff] [blame] | 332 | documentation. If you run into snags along the way, please [let us |
| 333 | know](mailto:pigweed@googlegroups.com)! |