commit | 4d0867a8fa68448c9906f9d3890076739b188231 | [log] [tgz] |
---|---|---|
author | pigweed-roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com> | Fri Feb 21 15:28:50 2025 -0800 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Feb 21 15:28:50 2025 -0800 |
tree | 86e3438ff512234f544120b81eccc64cbde82c77 | |
parent | 29a9e4c557f3ee31db9f0d441f62ee66e2d10c05 [diff] |
roll: pigweed 4fe911e..ea00e2a (11 commits) ea00e2a:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/269757 pw_ide: Run clean before testing 1ec3c50:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/270172 pw_span: Add IWYU private pragma to internal span impl 9a927ac:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/270152 pw_assert: Add IWYU export/private pragmas for check* 61138fd:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/264646 pw_allocator: Add multiple block implementations f432240:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/269794 pw_build: Introduce runfiles manager 14595a2:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/270292 pigweed.json: Remove combined sanitizer Bazel program 9687a0c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/269992 pw_async2: Size optimizations for PendFuncAwaitable 1bc28ab:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/268933 pw_build: Remove deprecated CMake function 62d8518:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/269993 pigweed.json: Add separate sanitizer Bazel programs 2788c69:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/264012 pw_crypto: Use pw::span_cast 0101b0e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/269194 pw_allocator: Enable size reports in Bazel Rolled-Repo: https://pigweed.googlesource.com/pigweed/pigweed Rolled-Commits: 4fe911e35994e5..ea00e2abc0adec Roll-Count: 1 Roller-URL: https://cr-buildbucket.appspot.com/build/8722282481141874257 GitWatcher: ignore CQ-Do-Not-Cancel-Tryjobs: true Change-Id: I28a69f424fa15a90520bf86c747ca60e29c83070 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/quickstart/bazel/+/270393 Bot-Commit: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com> Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Commit-Queue: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
This repository contains a minimal example of a Bazel-based Pigweed project. It is a LED-blinking service (featuring RPC control!) for the Raspberry Pi Pico. It can also be run on any computer using the included simulator.
git clone https://pigweed.googlesource.com/pigweed/quickstart/bazel pw_bazel_quickstart cd pw_bazel_quickstart
The only dependency that must be installed is Bazelisk.
Bazelisk is a launcher for the Bazel build system that allows for easy management of multiple Bazel versions.
Instructions for installing Bazelisk can be found here.
To run the simulator, type: bazelisk run //apps/blinky:simulator_blinky
Then, in a new console, connect to the simulator using: bazelisk run //apps/blinky:simulator_console
To start, connect a Raspberry Pi Pico, Pico 2, or debug probe via USB.
To run on the Raspberry Pi Pico, type: bazelisk run //apps/blinky:flash_rp2040
Then, in a new console, connect to the device using: bazelisk run //apps/blinky:rp2040_console
Once connected with a console, RPCs can be sent to control the LED. Try running:
device.set_led(True) device.set_led(False) device.toggle_led() device.blink(blink_count=3)
bazelisk test //...
will run the unit tests defined in this project, such as the ones in modules/blinky/blinky_test.cc
.
bazelisk run @pigweed//targets/rp2040/py:unit_test_server
in one console followed by bazelisk test //... --config=rp2040
will also allow running the unit tests on-device.
Try poking around the codebase for inspiration about how Pigweed projects can be organized. Most of the relevant code in this quickstart (including RPC definitions) is inside modules/blinky
, with some client-side Python code in tools/console.py
.