# Copyright 2025 The Pigweed Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under # the License. load("@rules_rust//rust:defs.bzl", "rust_binary") load("//pw_kernel/target/mps2_an505:defs.bzl", "TARGET_COMPATIBLE_WITH") load("//pw_kernel/tooling:system_image.bzl", "system_image", "system_image_test") load("//pw_kernel/tooling/panic_detector:rust_binary_no_panics_test.bzl", "rust_binary_no_panics_test") system_image( name = "kernelspace_demo", kernel = ":target", platform = "//pw_kernel/target/mps2_an505", system_config = ":system_config", tags = ["kernel"], visibility = ["//visibility:public"], ) rust_binary_no_panics_test( name = "no_panics_test", binary = ":kernelspace_demo", tags = ["kernel"], ) system_image_test( name = "kernelspace_demo_test", image = ":kernelspace_demo", target_compatible_with = TARGET_COMPATIBLE_WITH, ) filegroup( name = "system_config", srcs = ["system.json5"], ) rust_binary( name = "target", srcs = [ "target.rs", ], tags = ["kernel"], target_compatible_with = TARGET_COMPATIBLE_WITH, deps = [ "//pw_kernel/apps/kernelspace_demo:demo", "//pw_kernel/arch/arm_cortex_m:arch_arm_cortex_m", "//pw_kernel/kernel", "//pw_kernel/subsys/console:console_backend", "//pw_kernel/target:target_common", "//pw_kernel/target/mps2_an505:entry", "//pw_kernel/target/mps2_an505:linker_script", "//pw_log/rust:pw_log", "@rust_crates//:cortex-m-semihosting", ], )