| Crates.io | cargo-pio |
| lib.rs | cargo-pio |
| version | 0.26.0 |
| created_at | 2021-07-17 17:13:30.259651+00 |
| updated_at | 2025-01-02 12:48:39.230615+00 |
| description | Cargo<->PlatformIO integration: a cargo subcommand |
| homepage | |
| repository | https://github.com/ivmarkov/embuild |
| max_upload_size | |
| id | 424100 |
| size | 81,447 |
Build Rust embedded projects with PlatformIO!
cargo-pio is a Cargo subcommand cargo pio, as well as a library crate.
If you are building a mixed Rust/C project, or a pure Rust project that needs to call into the Vendor SDKs for your board, cargo-pio might help you.
In this mode of operation, your embedded project would be a PlatformIO project and a Rust static library crate:
pio run -t debug or cargo pio build), and PlatformIO calls into Cargo to build the Rust library crate;cargo-pio is used as a Cargo subcommand to create the layout of the project;cargo-pio helpExample:
cargo install cargo-pio (or cargo install --git https://github.com/ivmarkov/cargo-pio.git cargo-pio)cargo pio installpiocargo pio new --board <your-board> <path-to-your-new-project>cd <path-to-your-new-project>pio run -t debug or cargo pio buildpio run -t release or cargo pio build --releasecargo-pio!Call cargo pio --help to learn more about the various commands supported by cargo-pio.
cargo-pio is used as a library crate and driven programmatically from build.rs scripts.Cargo-first builds however are less flexible. They are only suitable for building and (linking with) the "SYS" crate that represents the Vendor SDK for your board. If you depend on other C libraries, you should be using a PlatformIO-first a.k.a. 'PIO->Cargo' project.
Example: