| load("@rules_probe_rs//probe_rs:defs.bzl", "probe_rs") |
| load("@rules_rust//rust:defs.bzl", "rust_binary") |
| |
| platform( |
| name = "nrf52840", |
| constraint_values = [ |
| "@platforms//cpu:armv7e-m", |
| "@platforms//os:none", |
| ], |
| ) |
| |
| rust_binary( |
| name = "blinky", |
| srcs = ["src/main.rs"], |
| linker_script = ":linker.x", |
| platform = ":nrf52840", |
| rustc_env = { |
| "DEFMT_LOG": "trace", |
| }, |
| target_compatible_with = [ |
| "@platforms//cpu:armv7e-m", |
| "@platforms//os:none", |
| ], |
| deps = [ |
| "@crates//:cortex-m-rt", |
| "@crates//:defmt", |
| "@crates//:defmt-rtt", |
| "@crates//:embassy-executor", |
| "@crates//:embassy-nrf", |
| "@crates//:embassy-time", |
| "@crates//:panic-probe", |
| ], |
| ) |
| |
| probe_rs.run( |
| name = "run", |
| args = ["--no-location"], |
| chip = "nRF52840_xxAA", |
| elf = ":blinky", |
| ) |