Commit Graph

19 Commits

Author SHA1 Message Date
Armando Montanez
1ee925c8ed pw_toolchain: ARM clang toolchain
Initial work to get clang building ARM firmware.

Current state:
 - Does not work on Windows; no clang toolchain yet.
 - Almost all tests pass.
 - FreeListHeap tests that don't zero-initilize the buffer fail in qemu
   and crash on STM32F429I-DISC1. (pwbug/315)

Change-Id: I39559511f19571c26930a868406d6ee1b514c412
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13144
Commit-Queue: Armando Montanez <amontanez@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
2021-02-05 18:38:51 +00:00
Wyatt Hepler
1b3da3a983 pw_status: Replace Status::Ok() with OkStatus()
- Mark Status::Ok() and StatusWithSize::Ok() as deprecated.
- Replace Status::Ok() with OkStatus().
- Replace StatusWithSize::Ok() with StatusWithSize().

Change-Id: If7192282446bf6d7f90990bb0b4f1b1b89a9228a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/29003
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-01-11 20:28:12 +00:00
Keir Mierle
6909f18e6b pw_sys_io: Add TryReadByte(byte* dest) function
This adds a non-blocking version of ReadByte() that enables writing, for
example, a superloop that combines custom processing simultaneously with
byte input handling for the RPC subsystem.

Change-Id: I9cb1e6ae8c944ca7cdff6d4bff101ac52e80b53a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/23980
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Keir Mierle <keir@google.com>
2020-11-07 01:17:28 +00:00
Wyatt Hepler
d49f8fe3f3 BUILD.gn files: Improve import formatting
The "# gn-format disable" comments are no longer necessary. Delete these
comments and reformat with a Vim macro and gn format.

Change-Id: Ia62c40ad73eef91187d0d443d6e3b0fa723e5aa9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21380
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-15 18:12:55 +00:00
Wyatt Hepler
f9fb90f299 docs: Make labels consistent; remove boilerplate
- Update labels so they use consistent naming. Instead of the
  copy-and-pasted `chapter` prefix, name labels with a prefix consistent
  with what they point to:
  - "module-" for module
  - "target-" for targets
  - "docs-" for general documentation
- Remove the unnecessary highlight and default-domain directives.
  Neither is necessary since the Pigweed docs always specify the
  language in code snippets and other directives.

Change-Id: I55c34e9ec919f6f4670e5d3d008e0edf5fecf05b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19328
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-10-01 21:47:35 +00:00
Wyatt Hepler
d78f7c6b75 pw_status: Update Status::CODE to Status::Code()
- Update Status::CODE style to Status::Code() using
  pw_status/update_style.py.
- Make minor adjustments to the pw_assert tests to get them passing.

Change-Id: Ie54c3c605178fd1e42c7cedbcff324115f3ed279
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19165
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-09-30 18:09:44 +00:00
Ewout van Bekkum
0f82b333c1 targets: move early_boot.c to boot.cc
Alters the existing targets to use a boot.cc file instead of the
existing early_boot.c.

The name was updated to reflect the fact that it now contains a
pw_boot_PostMain() hook which is after early boot.

C++ was selected over C to give more language flexibility.

Change-Id: I18ca0b8720bf083d4f644f1ca994e8fd7adc89b6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16702
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-08-26 03:24:30 +00:00
Ewout van Bekkum
712cbfb017 lm3s6965evb-qemu: move early_boot into targets/*
Updates targets/lm3s6965evb-qemu/* and its sys_io counterpart to
match targets/stm32f429i-disc1/* by moving the early boot and
vector tables out of sys_io.

Change-Id: If1f82d5bd242807d9c4914d207b7f332291de8cf
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16700
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-08-25 21:07:13 +00:00
Armando Montanez
0d61101823 pw_sys_io: Fix stm32f429i ReadByte()
If you make an infinite loop without a break or return, it is infinite.
Probably not intended behavior. :) Present me is disappointed in past me.

Change-Id: I03c7dffaa08f2ca64552433552888916ac7af6a6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16000
Reviewed-by: Shane Gomindes <shaneajg@google.com>
Commit-Queue: Armando Montanez <amontanez@google.com>
2020-08-13 22:34:40 +00:00
Chenghan Zhou
6e9924a77d stm32f429i target: early_boot.c refactor
Change-Id: Id7c03621a1bfe1fd3fdb6b6e8bfbd71703edbabd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/14261
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Chenghan Zhou <chenghanzh@google.com>
2020-07-23 15:40:00 +00:00
Chenghan Zhou
d4f44d2c50 pw_allocator: replacing malloc()
Add pw_malloc module to replace libc malloc with self defined methods.

Add pw_malloc_freelist backend to provide wrapper functions for freelist
malloc.

Change-Id: I7b645206655068d6c08063d7a520aca62d955052
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12601
Commit-Queue: Chenghan Zhou <chenghanzh@google.com>
Reviewed-by: Chenghan Zhou <chenghanzh@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
2020-07-17 18:14:27 +00:00
Ian Tessier
15610b5bcd pw_sys_io: Fix trailing newline to be \r\n
Change-Id: I8a8a3ddd76cdae1b05f07299d60d5bc18405e5b6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13361
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Ian Tessier <itessier@google.com>
2020-07-07 19:35:25 +00:00
Wyatt Hepler
e2cbadfa0c pw_span: Switch from pw::span to std::span
Replace pw::span with std::span and "pw_span/span.h" with <span>
throughout the codebase.

Change-Id: Ib1fa873168b6093794e861611d750fcad6285d6c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12801
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-07-01 01:37:27 +00:00
Alexei Frolov
258fc1b8bf Define docs target as a toolchain
This change creates a toolchain that configures the docs target and adds
it to the default build.

Change-Id: Ib2a8387253eef809f94411780174377e0d23e1a9
2020-06-16 09:50:59 -07:00
Armando Montanez
fb3d3fba79 Don't declare pigweed variables as globals
Require targets to explicitly import pigweed variable definitions. This
moves out some necessary logic from the BUILDCONFIG.gn file.

Change-Id: If9c9fe5a680cc9d897a0e8a55889873be618ed84
2020-06-16 09:50:59 -07:00
Alexei Frolov
edd2f148be pw_build: Switch to pw_* target types
This change replaces the implicit overrides of the default GN target
types in BUILDCONFIG.gn with explicit pw_* versions. This is done to
allow Pigweed to build within larger GN projects without modifying their
BUILDCONFIG files.

Change-Id: I1d1e41d5e9bde8fe076f7031f3c2b98b9630ff70
2020-06-16 09:50:59 -07:00
Armando Montanez
ec9dd67691 pw_boot_armv7m: Add pw_PreStaticConstructorInit()
Adds pw_PreStaticConstructorInit() to allow ARMv7-M targets that use
pw_boot to perform initialization before C++ static constructors are
run. Updates stm32f429i-disc1 to enable FPU before static constructors
so static constructors can safely perform FPU operations if necessary.

Change-Id: I66cfa82096719f59c42c84e4bafd0e1740002e09
2020-06-08 18:59:59 +00:00
Armando Montanez
0054a9be70 Docs: Add missing RST docs
Adds dcos.rst files for all modules lacking documentation.

Change-Id: Ief5594831d31fcb876381a4a3886382fab7d595e
2020-03-17 00:13:35 +00:00
Armando Montanez
f7a5a742ab Rename pw_dumb_io to pw_sys_io
Rename pw_dumb_io facade and backends to use the more deliberate name
pw_sys_io moving forward.

Change-Id: I968480715967ab8de491856afa1b7692b973ed7e
2020-03-03 18:19:17 +00:00