# 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_library") load("//pw_build:merge_flags.bzl", "flags_from_dict") load("//pw_kernel:flags.bzl", "KERNEL_DEVICE_COMMON_FLAGS") load("//pw_kernel/target/pw_rp2350:defs.bzl", "TARGET_COMPATIBLE_WITH") load("//pw_kernel/tooling:system_linker_script.bzl", "system_linker_script") platform( name = "pw_rp2350", constraint_values = [ ":target_pw_rp2350", "//pw_build/constraints/arm:cortex-m33", "@platforms//cpu:armv8-m", "@platforms//os:none", "//pw_build/constraints/rust:no_std", ], flags = flags_from_dict( KERNEL_DEVICE_COMMON_FLAGS | { "//pw_kernel/config:kernel_config": ":config", "//pw_kernel/subsys/console:console_backend": ":console", }, ), visibility = [":__subpackages__"], ) constraint_value( name = "target_pw_rp2350", constraint_setting = "//pw_kernel/target:target", visibility = [":__subpackages__"], ) rust_library( name = "entry", srcs = ["entry.rs"], tags = ["kernel"], target_compatible_with = TARGET_COMPATIBLE_WITH, visibility = [":__subpackages__"], deps = [ "//pw_kernel/arch/arm_cortex_m:arch_arm_cortex_m", "//pw_kernel/kernel", "@rust_crates//:cortex-m-rt", "@rust_crates//:rp235x-hal", ], ) rust_library( name = "console", srcs = ["console.rs"], crate_name = "console_backend", tags = ["kernel"], target_compatible_with = TARGET_COMPATIBLE_WITH, deps = [ "//pw_kernel/arch/arm_cortex_m:arch_arm_cortex_m", "//pw_kernel/kernel", "//pw_kernel/lib/pw_status", "@rust_crates//:embedded-io", "@rust_crates//:rp235x-hal", ], ) rust_library( name = "config", srcs = ["config.rs"], crate_name = "kernel_config", tags = ["kernel"], target_compatible_with = TARGET_COMPATIBLE_WITH, deps = [ "//pw_kernel/config:kernel_config_interface", ], ) filegroup( name = "linker_script_template", srcs = ["system.ld.tmpl"], visibility = [":__subpackages__"], ) system_linker_script( name = "linker_script", system_config = "//pw_kernel/target:system_config_file", tags = ["kernel"], template = ":linker_script_template", visibility = [":__subpackages__"], )