1# Copyright 2022 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15package(default_visibility = ["//visibility:public"]) 16 17licenses(["notice"]) 18 19platform( 20 name = "rp2040", 21 constraint_values = [ 22 "@freertos//:port_ARM_CM0", 23 "@freertos//:disable_task_statics", 24 "@pico-sdk//bazel/constraint:rp2040", 25 "@pico-sdk//bazel/constraint:stdio_usb", 26 "freertos_config_cv", 27 "//pw_build/constraints/chipset:rp2040", 28 "//pw_build/constraints/rtos:freertos", 29 "//pw_interrupt_cortex_m:backend", 30 "//pw_sys_io_rp2040:backend", 31 # For toolchain selection. 32 "@platforms//cpu:armv6-m", 33 "@pw_toolchain//constraints/arm_mcpu:cortex-m0", 34 "@rust_crates//:no_std", 35 ], 36) 37 38cc_library( 39 name = "extra_platform_libs", 40 deps = [ 41 ":pre_init", 42 "//pw_tokenizer:linker_script", 43 "@pico-sdk//src/common/pico_stdlib:pico_stdlib", 44 ], 45) 46 47cc_library( 48 name = "freertos_config", 49 hdrs = [ 50 "config/FreeRTOSConfig.h", 51 ], 52 includes = ["config/"], 53 target_compatible_with = [":freertos_config_cv"], 54 deps = ["//third_party/freertos:config_assert"], 55) 56 57constraint_value( 58 name = "freertos_config_cv", 59 constraint_setting = "@freertos//:freertos_config_setting", 60) 61 62# This is just a stub to silence warnings saying that pico_logging_test_main.cc 63# is missing from the bazel build. There's no plans yet to do a Bazel build for 64# the Pi Pico. 65# 66# TODO: b/260639642 - Support Pico in the Bazel build. 67cc_library( 68 name = "pico_logging_test_main", 69 srcs = [ 70 "pico_logging_test_main.cc", 71 ], 72 tags = ["manual"], 73 deps = [ 74 "//pw_unit_test", 75 "//pw_unit_test:logging_event_handler", 76 ], 77) 78 79# This is just a stub to silence warnings saying that boot.cc and *.h files are 80# missing from the bazel build. There's no plans yet to do a Bazel build for 81# the Pi Pico. 82filegroup( 83 name = "rp2040_files", 84 srcs = [ 85 "config/pigweed_module_config.h", 86 "config/rp2040_hal_config.h", 87 "unit_test_app.cc", 88 ], 89) 90 91cc_library( 92 name = "pre_init", 93 srcs = [ 94 "boot.cc", 95 ], 96 # TODO: b/261603269 - Get this to build. 97 tags = ["manual"], 98 target_compatible_with = [":freertos_config_cv"], 99 deps = [ 100 ":freertos_config", 101 "//pw_assert", 102 "//pw_assert:backend_impl", 103 "//pw_string", 104 "//pw_system:init", 105 "//third_party/freertos:support", 106 "@freertos", 107 "@pico-sdk//src/rp2_common/pico_stdlib:pico_stdlib", 108 ], 109 alwayslink = 1, 110) 111