-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Ie251c923a3f6af401558746579d69c304f6ed343 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/267232 Pigweed-Auto-Submit: Erik Gilling <[email protected]> Reviewed-by: Alexei Frolov <[email protected]> Lint: Lint 🤖 <[email protected]> Presubmit-Verified: CQ Bot Account <[email protected]> Commit-Queue: Auto-Submit <[email protected]>
- Loading branch information
Showing
4 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
.. _module-pw_kernel-cheat-sheet: | ||
|
||
=========== | ||
Cheat Sheet | ||
=========== | ||
.. pigweed-module-subpage:: | ||
:name: pw_kernel | ||
|
||
.. _module-pw_kernel-build: | ||
|
||
------------- | ||
rust_analyzer | ||
------------- | ||
|
||
Generating rust-project.json | ||
============================ | ||
|
||
For a given ``$CONFIG`` in: | ||
|
||
* k_host | ||
* k_qemu_lm3s6965evb | ||
* k_rp2350 | ||
|
||
.. code-block:: shell | ||
bazelisk run @rules_rust//tools/rust_analyzer:gen_rust_project -- --config $CONFIG //pw_kernel/... | ||
Errors and warnings in VSCode | ||
============================= | ||
|
||
Add this to Pigweed's ``.vscode/settings.json``. Note that it only builds the | ||
kernel targets to limit the amount of time that it takes to run. Substitute | ||
``$CONFIG`` for the config chosen above. | ||
|
||
.. code-block:: json | ||
"rust-analyzer.check.overrideCommand": [ | ||
"bazelisk", | ||
"build", | ||
"--config=$CONFIG", | ||
"--@rules_rust//:error_format=json", | ||
"//pw_kernel/..." | ||
], | ||
-------------- | ||
Build and Test | ||
-------------- | ||
|
||
Host | ||
==== | ||
|
||
Test | ||
---- | ||
|
||
.. code-block:: shell | ||
bazelisk test --config k_host //pw_kernel/... | ||
QEMU | ||
==== | ||
|
||
Test | ||
---- | ||
|
||
.. code-block:: shell | ||
bazelisk test --config k_qemu_lm3s6965evb //pw_kernel/... | ||
Run | ||
--- | ||
|
||
^A-x to exit qemu | ||
|
||
.. code-block:: shell | ||
bazelisk run --config k_qemu_lm3s6965evb //pw_kernel/kernel/entry:kernel | ||
RP2350 Target Board | ||
=================== | ||
|
||
Build | ||
----- | ||
|
||
.. code-block:: shell | ||
bazelisk build --config k_rp2350 //pw_kernel/kernel/entry:kernel | ||
Flash | ||
----- | ||
|
||
.. code-block:: shell | ||
probe-rs download --chip rp2350 bazel-bin/pw_kernel/kernel/entry/kernel && probe-rs reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters