blob: 27d7ec00570d0c293fad1a1cba1f17dc895f1885 [file] [log] [blame] [view]
Rob Mohrd4777482024-05-22 17:25:24 -07001# Contributing to Pigweed
2
Ted Pudlik554438e2024-08-30 23:32:44 +00003Pigweed lets anyone contribute to the project, regardless of their employer. The
4Pigweed project reviews and encourages well-tested, high-quality contributions
5from anyone who wants to contribute to Pigweed.
Rob Mohrd4777482024-05-22 17:25:24 -07006
7## Contributor License Agreement
8
9Contributions to this project must be accompanied by a Contributor License
10Agreement (CLA).
11
12To see any Contributor License Agreements on file or to sign a CLA, go to
13<https://cla.developers.google.com/>.
14
15For more information about the Google CLA, see
16[Contributor License Agreements](https://cla.developers.google.com/about).
17
18## Contributing changes and submitting code reviews
19
20All changes require review, including changes by project members.
21
Ted Pudlik554438e2024-08-30 23:32:44 +000022For detailed instructions on how to contribute changes, see
23[the Gerrit docs](https://gerrit-review.googlesource.com/Documentation/intro-user.html).
Rob Mohrd4777482024-05-22 17:25:24 -070024
25## Community guidelines
26
27This project observes the following community guidelines:
28
Ted Pudlik554438e2024-08-30 23:32:44 +000029* [Google's Open Source Community Guidelines](https://opensource.google/conduct/)
30
31## Required presumit testing
32
33We don’t have hardware-in-the-loop testing yet, so the following manual testing
34is needed before merging *any* change to this repo.
35
36### Checklist for new code
37
38- [ ] New binaries or tests?
39 - [ ] Update `//BUILD.bazel` with updated deps on
40 `:refresh_compile_commands`.
41 - [ ] Update `//.bazelrc` presubmit section with the new binaries you want
42 built in CQ after the line `build:presubmit -- \ `
43- [ ] New protos?
44 - [ ] Update `//tools/airmaranth/device.py` with the proto imports under
45 `get_all_protos()`.
46 - [ ] Add the proto deps to `:airmaranth_lib` in `//tools/BUILD.bazel`
47- [ ] Run the regression suite (below) manually
48
49### Regression testing suite: manual testing steps
50
51For now, assumes you have
52[a full setup](https://pigweed.dev/docs/showcases/sense/tutorial/flash.html#option-full-setup):
53
54* Pico RP2040
55* Enviro+ pack
56* OmniBus extender
57* Debug probe
58
59#### Host simulator
60
61##### Steps
62
Ted Pudlik688596d2024-09-12 18:16:52 +0000631. In terminal 1: Run simulator `$ bazelisk run //apps/blinky:simulator_blinky`
Ted Pudlik554438e2024-08-30 23:32:44 +0000641. In terminal 2:
65
66 * Run console `$ bazelisk run //apps/blinky:simulator_console`
67 * In the console, run: `>>>
68 device.rpcs.pw.rpc.EchoService.Echo(msg='hello')`
69
70##### Expected result
71
72Return value shown in console is: `(Status.OK, pw.rpc.EchoMessage(msg=’hello’))`
73
74#### On-device RP2040 apps
75
76##### Flashing test
77
78###### Steps
79
80In a terminal (or in VSCode by “Run target”):
81
82* `$ bazelisk run //apps/blinky:flash`
83* `$ bazelisk run //apps/blinky:rp2040_console`
84
85###### Expected result
86
871. Successful build, flash, and console loads.
881. RP2040 LED toggles @ 1Hz
891. Log panel displays: `RpcDevice BLINKY Toggling Led`
90
91##### RPC test
92
93###### Steps
94
95In the console, run: `>>> device.rpcs.pw.rpc.EchoService.Echo(msg='hello')`
96
97###### Expected result
98
99Return value shown in console is: `(Status.OK, pw.rpc.EchoMessage(msg=’hello’))`
100
101##### Toggle blinky test
102
1031. Close any active consoles. Run `$ bazelisk run
104 //apps/blinky:rp2040_toggle_blinky`. The Pico LED should *stop* blinking.
1051. Run `$ bazelisk run //apps/blinky:rp2040_toggle_blinky` again. The Pico LED
106 should *start* blinking.
107
108#### On-device RP2040 tests
109
110##### Steps
111
1121. In terminal 1: Start test runner: `$ bazelisk run \
113 @pigweed//targets/rp2040/py:unit_test_server \ -- --debug-probe-only`
1141. In terminal 2: Run tests: `$ bazelisk test --config=rp2040 //...`
115
116##### Expected result
117
118Test runner successfully connects to the device. Tests run and pass.