• Home
Name Date Size #Lines LOC

..--

build_overrides/03-May-2024-2118

docker/03-May-2024-11496

docs/03-May-2024-3,0522,332

pw_allocator/03-May-2024-2,5651,609

pw_arduino_build/03-May-2024-3,8382,707

pw_assert/03-May-2024-2,7761,818

pw_assert_basic/03-May-2024-600418

pw_assert_log/03-May-2024-277184

pw_base64/03-May-2024-978695

pw_bloat/03-May-2024-1,4371,003

pw_blob_store/03-May-2024-2,4881,587

pw_boot_armv7m/03-May-2024-790487

pw_build/03-May-2024-6,7275,295

pw_bytes/03-May-2024-2,4791,758

pw_checksum/03-May-2024-797498

pw_chrono/03-May-2024-902490

pw_chrono_embos/03-May-2024-356204

pw_chrono_freertos/03-May-2024-337200

pw_chrono_stl/03-May-2024-253150

pw_chrono_threadx/03-May-2024-356211

pw_cli/03-May-2024-2,3201,556

pw_containers/03-May-2024-2,5931,806

pw_cpu_exception/03-May-2024-458262

pw_cpu_exception_cortex_m/03-May-2024-2,4681,635

pw_docgen/03-May-2024-537405

pw_doctor/03-May-2024-496360

pw_env_setup/03-May-2024-4,5933,250

pw_fuzzer/03-May-2024-731512

pw_hdlc/03-May-2024-3,6202,466

pw_hex_dump/03-May-2024-1,056703

pw_i2c/03-May-2024-482244

pw_interrupt/03-May-2024-13796

pw_interrupt_cortex_m/03-May-2024-206144

pw_kvs/03-May-2024-12,0708,196

pw_log/03-May-2024-1,327861

pw_log_basic/03-May-2024-494307

pw_log_multisink/03-May-2024-649434

pw_log_null/03-May-2024-321205

pw_log_rpc/03-May-2024-370238

pw_log_sink/03-May-2024-608371

pw_log_tokenized/03-May-2024-741470

pw_malloc/03-May-2024-178138

pw_malloc_freelist/03-May-2024-304209

pw_metric/03-May-2024-2,7011,756

pw_minimal_cpp_stdlib/03-May-2024-3,3902,362

pw_module/03-May-2024-478307

pw_multisink/03-May-2024-566312

pw_package/03-May-2024-708467

pw_persistent_ram/03-May-2024-1,337872

pw_polyfill/03-May-2024-1,282851

pw_preprocessor/03-May-2024-1,594925

pw_presubmit/03-May-2024-3,5132,439

pw_protobuf/03-May-2024-5,3303,551

pw_protobuf_compiler/03-May-2024-2,6242,009

pw_random/03-May-2024-459308

pw_result/03-May-2024-761520

pw_ring_buffer/03-May-2024-1,8091,182

pw_router/03-May-2024-858546

pw_rpc/03-May-2024-14,2629,655

pw_span/03-May-2024-2,3321,739

pw_status/03-May-2024-1,8011,229

pw_stream/03-May-2024-1,266812

pw_string/03-May-2024-3,9062,626

pw_sync/03-May-2024-3,5322,203

pw_sync_baremetal/03-May-2024-216130

pw_sync_embos/03-May-2024-1,046584

pw_sync_freertos/03-May-2024-1,173690

pw_sync_stl/03-May-2024-893493

pw_sync_threadx/03-May-2024-1,136653

pw_sys_io/03-May-2024-343195

pw_sys_io_arduino/03-May-2024-200127

pw_sys_io_baremetal_lm3s6965evb/03-May-2024-233145

pw_sys_io_baremetal_stm32f429/03-May-2024-380235

pw_sys_io_stdio/03-May-2024-183134

pw_target_runner/03-May-2024-1,187813

pw_thread/03-May-2024-1,486818

pw_thread_embos/03-May-2024-463275

pw_thread_freertos/03-May-2024-1,412834

pw_thread_stl/03-May-2024-622328

pw_thread_threadx/03-May-2024-1,362768

pw_tokenizer/03-May-2024-18,50813,734

pw_tool/03-May-2024-234155

pw_toolchain/03-May-2024-2,0121,696

pw_trace/03-May-2024-2,9011,827

pw_trace_tokenized/03-May-2024-3,8912,678

pw_unit_test/03-May-2024-3,4072,312

pw_varint/03-May-2024-1,6821,275

pw_watch/03-May-2024-1,165807

pw_web_ui/03-May-2024-1,032699

targets/03-May-2024-3,3422,398

third_party/03-May-2024-736664

.bazelignoreD03-May-202442 54

.bazelrcD03-May-202451 11

.clang-formatD03-May-2024202 87

.dockerignoreD03-May-2024746 6556

.eslintrc.jsonD03-May-20241.1 KiB4947

.gitattributesD03-May-202467 43

.gitignoreD03-May-2024746 6556

.gnD03-May-2024618 1614

.prettierrc.jsD03-May-2024652 161

.pylintrcD03-May-202415.8 KiB516370

AUTHORSD03-May-2024296 86

BUILDD03-May-2024698 1715

BUILD.gnD03-May-20249.6 KiB314279

BUILDCONFIG.gnD03-May-20241.3 KiB2925

CMakeLists.txtD03-May-20242.8 KiB7264

CODE_OF_CONDUCT.mdD03-May-20244.4 KiB9473

CONTRIBUTING.mdD03-May-20248.6 KiB212167

LICENSED03-May-202411.1 KiB203169

METADATAD03-May-2024483 1513

MODULE_LICENSE_APACHE2D03-May-20240

NOTICED03-May-20248 21

OWNERSD03-May-2024148 98

PW_PLUGINSD03-May-2024724 1917

README.mdD03-May-20246.8 KiB143108

WORKSPACED03-May-20243.2 KiB132103

activate.batD03-May-20241.2 KiB3330

activate.shD03-May-20243.9 KiB10555

bootstrap.batD03-May-20244.5 KiB131111

bootstrap.shD03-May-20243.9 KiB10555

modules.gniD03-May-20246.2 KiB111109

package.jsonD03-May-20241.2 KiB4544

tsconfig.jsonD03-May-2024913 3432

yarn.lockD03-May-2024183.5 KiB4,3663,746

README.md

1# Pigweed
2
3Pigweed is an open source collection of embedded-targeted libraries--or as we
4like to call them, modules. These modules are building blocks and infrastructure
5that enable faster and more reliable development on small-footprint MMU-less
632-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic
7nRF52832.
8
9Pigweed is in the early stages of development, **and should be considered
10experimental**. We’re continuing to evolve the platform and add new modules. We
11value developer feedback along the way.
12
13# Quick links
14
15 - [Getting started guide](docs/getting_started.md)
16 - [Documentation](https://pigweed.dev)
17 - [Source code](https://cs.opensource.google/pigweed/pigweed)
18 - [Code reviews](https://pigweed-review.googlesource.com/)
19 - [Issue tracker](https://bugs.pigweed.dev/)
20 - [Mailing list](https://groups.google.com/forum/#!forum/pigweed)
21 - [Chat room (Discord)](https://discord.gg/M9NSeTA)
22 - [Open Source blog post](https://opensource.googleblog.com/2020/03/pigweed-collection-of-embedded-libraries.html)
23
24Get the code: `git clone https://pigweed.googlesource.com/pigweed/pigweed` (or
25[fork us on GitHub](https://github.com/google/pigweed)).
26
27# Getting Started
28
29If you'd like to get set up with Pigweed, please visit the
30[getting started guide](docs/getting_started.md).
31
32# What does Pigweed offer?
33
34There are many modules in Pigweed, and this section only showcases a small
35selection that happen to produce visual output. For more information about the
36different Pigweed module offerings, refer to "Module Guides" section in the full
37documentation.
38
39## `pw_watch` - Build, flash, run, & test on save
40
41In the web development space, file system watchers are prevalent. These watchers
42trigger a web server reload on source change, making development much faster. In
43the embedded space, file system watchers are less prevalent; however, they are
44no less useful! The Pigweed watcher module makes it easy to instantly compile,
45flash, and run tests upon save. Combined with the GN-based build which expresses
46the full dependency tree, only the exact tests affected by a file change are run
47on saves.
48
49The demo below shows `pw_watch` building for a STMicroelectronics
50STM32F429I-DISC1 development board, flashing the board with the affected test,
51and verifying the test runs as expected. Once this is set up, you can attach
52multiple devices to run tests in a distributed manner to reduce the time it
53takes to run tests.
54
55![pw watch running on-device tests](docs/images/pw_watch_on_device_demo.gif)
56
57## `pw_presubmit` - Vacuum code lint on every commit
58
59Presubmit checks are essential tools, but they take work to set up, and projects
60don’t always get around to it. The `pw_presubmit` module provides tools for
61setting up high quality presubmit checks for any project. We use this framework
62to run Pigweed’s presubmit on our workstations and in our automated building
63tools.
64
65The `pw_presubmit` module includes `pw format` command, a tool that provides a
66unified interface for automatically formatting code in a variety of languages.
67With `pw format`, you can format C, C++, Python, GN, and Go code according to
68configurations defined by your project. `pw format` leverages existing tools
69like `clang-format`, and it’s simple to add support for new languages.
70
71![pw presubmit demo](pw_presubmit/docs/pw_presubmit_demo.gif)
72
73## `pw_env_setup` - Cross platform embedded compiler setup
74
75A classic problem in the embedded space is reducing the time from git clone to
76having a binary executing on a device. The issue is that an entire suite of
77tools is needed for non-trivial production embedded projects. For example:
78
79 - A C++ compiler for your target device, and also for your host
80 - A build system or three; for example, GN, Ninja, CMake, Bazel
81 - A code formatting program like clang-format
82 - A debugger like OpenOCD to flash and debug your embedded device
83 - A known Python version with known modules installed for scripting
84 - A Go compiler for the Go-based command line tools
85 - ... and so on
86
87In the server space, container solutions like Docker or Podman solve this;
88however, in our experience container solutions are a mixed bag for embedded
89systems development where one frequently needs access to native system resources
90like USB devices, or must operate on Windows.
91
92`pw_env_setup` is our compromise solution for this problem that works on Mac,
93Windows, and Linux. It leverages the Chrome packaging system CIPD to bootstrap a
94Python installation, which in turn inflates a virtual environment. The tooling
95is installed into your workspace, and makes no changes to your system. This
96tooling is designed to be reused by any project.
97
98![pw environment setup demo](docs/images/pw_env_setup_demo.gif)
99
100## `pw_unit_test` - Embedded testing for MCUs
101
102Unit testing is important, and Pigweed offers a portable library that’s broadly
103compatible with [Google Test](https://github.com/google/googletest). Unlike
104Google Test, `pw_unit_test` is built on top of embedded friendly primitives; for
105example, it does not use dynamic memory allocation. Additionally, it is easy to
106port to new target platforms by implementing the
107[test event handler interface](https://pigweed.googlesource.com/pigweed/pigweed/+/refs/heads/master/pw_unit_test/public/pw_unit_test/event_handler.h).
108
109Like other modules in Pigweed, `pw_unit_test` is designed for use in
110established codebases with their own build system, without the rest of Pigweed
111or the Pigweed integrated GN build. However, when combined with Pigweed's
112build, the result is a flexible and powerful setup that enables easily
113developing code on your desktop (with tests), then running the same tests
114on-device.
115
116![pw_status test run natively on host](docs/images/pw_status_test.png)
117
118## And more!
119
120See the "Module Guides" in the documentation for the complete list and
121documentation for each, but is a selection of some others:
122
123 - `pw_cpu_exception_cortex_m`: Robust low level hardware fault handler for ARM
124   Cortex-M; the handler even has unit tests written in assembly to verify
125   nested-hardware-fault handling!
126
127 - `pw_polyfill`: Similar to JavaScript “polyfill” libraries, this module
128   provides selected C++17 standard library components that are compatible with
129   C++11 and C++14.
130
131 - `pw_tokenizer`: Replace string literals from log statements with 32-bit
132   tokens, to reduce flash use, reduce logging bandwidth, and save formatting
133   cycles from log statements at runtime.
134
135 - `pw_kvs`: A key-value-store implementation for flash-backed persistent
136   storage with integrated wear levelling. This is a lightweight alternative to
137   a file system for embedded devices.
138
139 - `pw_protobuf`: An early preview of our wire-format-oriented protocol buffer
140   implementation. This protobuf compiler makes a different set of
141   implementation tradeoffs than the most popular protocol buffer library in
142   this space, nanopb.
143