diff --git a/.bazelignore b/.bazelignore
deleted file mode 100644
index a086fff..0000000
--- a/.bazelignore
+++ /dev/null
@@ -1,4 +0,0 @@
-# Don't accidentally pick up external CMake deps with Bazel build files.
-build
-# Don't treat submodules as part of this project.
-lib
diff --git a/.bazelrc b/.bazelrc
deleted file mode 100644
index 96b4eca..0000000
--- a/.bazelrc
+++ /dev/null
@@ -1,6 +0,0 @@
-# Silence all C/C++ warnings in external code.
-common --per_file_copt=external/.*@-w
-common --host_per_file_copt=external/.*@-w
-
-# Produce useful output when the build fails.
-common --verbose_failures
diff --git a/.bazelversion b/.bazelversion
deleted file mode 100644
index b26a34e..0000000
--- a/.bazelversion
+++ /dev/null
@@ -1 +0,0 @@
-7.2.1
diff --git a/.github/workflows/bazel_build.yml b/.github/workflows/bazel_build.yml
deleted file mode 100644
index 81b7ae5..0000000
--- a/.github/workflows/bazel_build.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-name: Bazel presubmit checks
-
-on:
- push:
- pull_request:
-
-jobs:
- bazel-build-check:
- strategy:
- matrix:
- # TODO: Windows is currently broken.
- os: [ubuntu-latest, macos-latest]
- fail-fast: false
- runs-on: ${{ matrix.os }}
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Get Bazel
- uses: bazel-contrib/setup-bazel@0.9.0
- with:
- # Avoid downloading Bazel every time.
- bazelisk-cache: true
- # Store build cache per workflow.
- disk-cache: ${{ github.workflow }}
- # Share repository cache between workflows.
- repository-cache: true
- # Only needed to drive the presbumit scripts.
- - name: Setup Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.10'
- - name: Fetch latest Picotool
- uses: actions/checkout@v4
- with:
- repository: raspberrypi/picotool
- ref: develop
- fetch-depth: 0
- path: lib/picotool
- - name: Full Bazel build with develop Picotool
- run: python3 tools/run_all_bazel_checks.py --program=build --picotool-dir=lib/picotool
- # Checks that the current BCR-requested version of Picotool builds.
- - name: Bazel Picotool backwards compatibility
- run: bazel build @picotool//:picotool
- other-bazel-checks:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Get Bazel
- uses: bazel-contrib/setup-bazel@0.9.0
- with:
- # Avoid downloading Bazel every time.
- bazelisk-cache: true
- # Store build cache per workflow.
- disk-cache: ${{ github.workflow }}
- # Share repository cache between workflows.
- repository-cache: true
- # Only needed to drive the presbumit scripts.
- - name: Setup Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.10'
- - name: Fetch latest Picotool
- uses: actions/checkout@v4
- with:
- repository: raspberrypi/picotool
- ref: develop
- fetch-depth: 0
- path: lib/picotool
- - name: Other Bazel checks
- run: python3 tools/run_all_bazel_checks.py --program=other --picotool-dir=lib/picotool
diff --git a/.github/workflows/choco_packages.config b/.github/workflows/choco_packages.config
deleted file mode 100644
index f7885c9..0000000
--- a/.github/workflows/choco_packages.config
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml
index 28ee68b..a6521e7 100644
--- a/.github/workflows/cmake.yml
+++ b/.github/workflows/cmake.yml
@@ -1,9 +1,5 @@
name: CMake
-on:
- push:
- branches-ignore:
- - 'iar/**'
- pull_request:
+on: [push, pull_request]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
@@ -11,8 +7,7 @@ env:
jobs:
build:
- # cannot specify filter for pull_request in on: above, so do it here
- if: github.repository_owner == 'raspberrypi' && (github.event_name != 'pull_request' || !startsWith(github.head_ref, 'iar/'))
+ if: github.repository_owner == 'raspberrypi'
runs-on: [self-hosted, Linux, X64]
steps:
@@ -23,7 +18,7 @@ jobs:
mkdir -p "${{ github.workspace }}"
- name: Checkout repo
- uses: actions/checkout@v4
+ uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init
@@ -38,13 +33,17 @@ jobs:
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
- # Note the current convention is to use the -S and -B options here to specify source
- # and build directories, but this is only available with CMake 3.13 and higher.
+ # Note the current convention is to use the -S and -B options here to specify source
+ # and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
- run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_SDK_TESTS_ENABLED=1
+ run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
+
+ - name: Get core count
+ id: core_count
+ run : cat /proc/cpuinfo | grep processor | wc -l
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target "
- run: cmake --build . --config $BUILD_TYPE --parallel $(nproc)
+ run: cmake --build . --config $BUILD_TYPE --parallel ${{steps.core_count.outputs.output}}
diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml
deleted file mode 100644
index 4228267..0000000
--- a/.github/workflows/macOS.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: Build on macOS
-on:
- workflow_dispatch:
- push:
- branches:
- - 'develop'
- - 'master'
- - 'test_workflow'
-
-jobs:
- build:
- runs-on: macos-latest
- steps:
- - name: Clean workspace
- run: |
- echo "Cleaning up previous run"
- rm -rf "${{ github.workspace }}"
- mkdir -p "${{ github.workspace }}"
- - name: Checkout repo
- uses: actions/checkout@v4
- - name: Checkout submodules
- run: git submodule update --init
- - name: Install dependencies
- run: |
- brew install cmake
- brew install --cask gcc-arm-embedded
-
- - name: Build Project
- # bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
- shell: bash
- run: |
- mkdir build
- cd build
- cmake .. -G "Unix Makefiles" -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_BOARD=pico_w
- cmake --build .
-
- - name: Build Native
- # bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
- shell: bash
- run: |
- mkdir build_native
- cd build_native
- cmake .. -G "Unix Makefiles" -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=host
- cmake --build .
diff --git a/.github/workflows/multi-gcc.yml b/.github/workflows/multi-gcc.yml
deleted file mode 100644
index 886109d..0000000
--- a/.github/workflows/multi-gcc.yml
+++ /dev/null
@@ -1,157 +0,0 @@
-
-name: Multi GCC
-on:
- workflow_dispatch:
- push:
- branches:
- - 'master'
- - 'test_workflow'
-
-jobs:
- build:
- if: github.repository_owner == 'raspberrypi'
- runs-on: [self-hosted, Linux, X64]
-
- steps:
- - name: Clean workspace
- run: |
- echo "Cleaning up previous run"
- rm -rf "${{ github.workspace }}"
- mkdir -p "${{ github.workspace }}"
-
- - name: Checkout repo
- uses: actions/checkout@v4
-
- - name: Checkout submodules
- run: git submodule update --init
-
- - name: GCC 6.2.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-6_2-2016q4 -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 6.2.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-6_2-2016q4 -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 6.3.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-6-2017-q2-update -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 6.3.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-6-2017-q2-update -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 7.2.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-7-2017-q4-major -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 7.2.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-7-2017-q4-major -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 7.3.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-7-2018-q2-update -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 7.3.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-7-2018-q2-update -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 8.2.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-8-2018-q4-major -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 8.2.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-8-2018-q4-major -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 8.3.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-8-2019-q3-update -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 8.3.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-8-2019-q3-update -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 9.2.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-9-2019-q4-major -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 9.2.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-9-2019-q4-major -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 9.3.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-9-2020-q2-update -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 9.3.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-9-2020-q2-update -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 10.2.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-10-2020-q4-major -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 10.2.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-10-2020-q4-major -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 10.3.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-10.3-2021.10 -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 10.3.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-10.3-2021.10 -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 11.2.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 11.2.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 11.3.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 11.3.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 12.2.1 Debug
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
- - name: GCC 12.2.1 Release
- if: always()
- shell: bash
- run: cd ${{github.workspace}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)
-
diff --git a/.github/workflows/scripts/generate_multi_gcc_workflow.py b/.github/workflows/scripts/generate_multi_gcc_workflow.py
deleted file mode 100755
index ac10b8b..0000000
--- a/.github/workflows/scripts/generate_multi_gcc_workflow.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-from collections import OrderedDict
-import subprocess
-import re
-
-toolchain_dir = "/opt/arm"
-toolchains = os.listdir(toolchain_dir)
-
-gcc_versions = OrderedDict()
-
-for toolchain in toolchains:
- fullpath = os.path.join(toolchain_dir, toolchain)
- gcc_path = os.path.join(fullpath, "bin/arm-none-eabi-gcc")
- version = subprocess.run([gcc_path, "--version"], capture_output=True)
- stdout = version.stdout.decode('utf-8')
- stderr = version.stderr.decode('utf-8')
- assert(len(stderr) == 0)
- # Version should be on first line
- version_line = stdout.split("\n")[0]
- m = re.search("(\d+\.\d+\.\d+)", version_line)
- assert(m is not None)
- version = m.group(1)
-
- if version in gcc_versions:
- raise Exception("Already have version {} in versions current path {}, this path {}".format(version, gcc_versions[version], fullpath))
-
- gcc_versions[version] = fullpath
-
-# Sort by major version
-gcc_versions_sorted = OrderedDict(sorted(gcc_versions.items(), key=lambda item: int(item[0].replace(".", ""))))
-
-
-# Create output
-output = '''
-name: Multi GCC
-on:
- workflow_dispatch:
- push:
- branches:
- - 'master'
- - 'test_workflow'
-
-jobs:
- build:
- if: github.repository_owner == 'raspberrypi'
- runs-on: [self-hosted, Linux, X64]
-
- steps:
- - name: Clean workspace
- run: |
- echo "Cleaning up previous run"
- rm -rf "${{ github.workspace }}"
- mkdir -p "${{ github.workspace }}"
-
- - name: Checkout repo
- uses: actions/checkout@v4
-
- - name: Checkout submodules
- run: git submodule update --init
-'''
-
-for gcc_version, toolchain_path in gcc_versions_sorted.items():
- for build_type in ["Debug", "Release"]:
- output += "\n"
- output += " - name: GCC {} {}\n".format(gcc_version, build_type)
- output += " if: always()\n"
- output += " shell: bash\n"
- output += " run: cd ${{{{github.workspace}}}}; mkdir -p build; rm -rf build/*; cd build; cmake ../ -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE={} -DPICO_TOOLCHAIN_PATH={} -DPICO_BOARD=pico_w; make --output-sync=target --no-builtin-rules --no-builtin-variables -j$(nproc)\n".format(build_type, toolchain_path)
-
-print(output)
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
deleted file mode 100644
index ea4394a..0000000
--- a/.github/workflows/windows.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: Build on Windows
-on:
- workflow_dispatch:
- push:
- branches:
- - 'develop'
- - 'master'
- - 'test_workflow'
-
-jobs:
- build:
- runs-on: windows-2022
- steps:
- - name: Clean workspace
- shell: bash
- run: |
- echo "Cleaning up previous run"
- rm -rf "${{ github.workspace }}/pico-sdk"
- - name: Checkout repo
- uses: actions/checkout@v4
- - name: Checkout submodules
- run: git submodule update --init
- - name: Install dependencies
- run: choco install .github/workflows/choco_packages.config
-
- - name: Build Project
- shell: pwsh
- run: |
- mkdir build
- cd build
- cmake .. -G Ninja -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_BOARD=pico_w
- cmake --build .
diff --git a/.gitignore b/.gitignore
index 8f7a3f5..a3b81f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,5 @@
.idea
.vscode
cmake-*
-.cache
.DS_Store
build
-build-*
-
-bazel-*
-
-# Ignore until https://github.com/bazelbuild/bazel/issues/20369 is fixed.
-MODULE.bazel.lock
-__pycache__/
diff --git a/.gitmodules b/.gitmodules
index 7c382da..4846c9c 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,15 +1,3 @@
[submodule "tinyusb"]
path = lib/tinyusb
url = https://github.com/hathach/tinyusb.git
-[submodule "lib/cyw43-driver"]
- path = lib/cyw43-driver
- url = https://github.com/georgerobotics/cyw43-driver.git
-[submodule "lib/lwip"]
- path = lib/lwip
- url = https://github.com/lwip-tcpip/lwip.git
-[submodule "lib/mbedtls"]
- path = lib/mbedtls
- url = https://github.com/Mbed-TLS/mbedtls.git
-[submodule "lib/btstack"]
- path = lib/btstack
- url = https://github.com/bluekitchen/btstack.git
diff --git a/BUILD.bazel b/BUILD.bazel
deleted file mode 100644
index e69de29..0000000
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2ecb515..0ab4c31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.13...3.27)
+cmake_minimum_required(VERSION 3.13)
# Note: this CMakeLists.txt can be used as a top-level CMakeLists.txt for the SDK itself. For all other uses
# it is included as a subdirectory via the pico_sdk_init() method provided by pico_sdk_init.cmake
@@ -9,19 +9,6 @@ if (NOT TARGET _pico_sdk_inclusion_marker)
project(pico_sdk C CXX ASM)
- string(REGEX MATCH "Clang" PICO_C_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
- string(REGEX MATCH "GNU" PICO_C_COMPILER_IS_GNU "${CMAKE_C_COMPILER_ID}")
- string(REGEX MATCH "IAR" PICO_C_COMPILER_IS_IAR "${CMAKE_C_COMPILER_ID}")
- pico_register_common_scope_var(PICO_C_COMPILER_IS_CLANG)
- pico_register_common_scope_var(PICO_C_COMPILER_IS_GNU)
- pico_register_common_scope_var(PICO_C_COMPILER_IS_IAR)
- pico_register_common_scope_var(PICO_SDK_VERSION_MAJOR)
- pico_register_common_scope_var(PICO_SDK_VERSION_MINOR)
- pico_register_common_scope_var(PICO_SDK_VERSION_REVISION)
- pico_register_common_scope_var(PICO_SDK_VERSION_PRE_RELEASE_ID)
- pico_register_common_scope_var(PICO_SDK_VERSION_STRING)
-
- message("Build type is ${CMAKE_BUILD_TYPE}")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
if (PICO_DEOPTIMIZED_DEBUG)
message("Using fully de-optimized debug build (set PICO_DEOPTIMIZED_DEBUG=0 to optimize)")
@@ -43,9 +30,6 @@ if (NOT TARGET _pico_sdk_inclusion_marker)
add_sub_list_dirs(PICO_SDK_PRE_LIST_DIRS)
add_sub_list_files(PICO_SDK_PRE_LIST_FILES)
- # needed by certain functions
- set(PICO_TOOLS_DIR "${CMAKE_CURRENT_LIST_DIR}/tools" CACHE INTERNAL "")
-
add_subdirectory(tools)
add_subdirectory(src)
@@ -69,3 +53,4 @@ if (NOT TARGET _pico_sdk_inclusion_marker)
pico_promote_common_scope_vars()
endif()
endif()
+
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index aa09dfa..dc69b26 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -8,7 +8,7 @@ We use GitHub to host code, track [issues](https://github.com/raspberrypi/pico-s
In order to contribute new or updated code, you must first create a GitHub account and fork the original repository to your own account. You can make changes, save them in your repository, then [make a pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) against this repository. The pull request will appear [in the repository](https://github.com/raspberrypi/pico-sdk/pulls) where it can be assessed by the maintainers, and if appropriate, merged with the official repository.
-**NOTE:** Development takes place on the `develop` branch in this repository. Please open your [pull request](https://github.com/raspberrypi/pico-sdk/pulls) (PR) against the [`develop`](https://github.com/raspberrypi/pico-sdk/tree/develop) branch, pull requests against the `master` branch will automatically CI fail checks and will not be accepted. You will be asked to rebase your PR against `develop` and if you do not do so, your PR will be closed.
+**NOTE:** Development takes place on the `develop` branch in this repository. Please open your https://github.com/raspberrypi/pico-sdk/pulls[pull request] (PR) against the [`develop`](https://github.com/raspberrypi/pico-sdk/tree/develop) branch, pull requests against the `master` branch will automatically CI fail checks and will not be accepted. You will be asked to rebase your PR against `develop` and if you do not do so, your PR will be closed.
While we are happy to take contributions, big or small, changes in the SDK may have knock-on effects in other places so it is possible that apparently benign pull requests that make seemingly small changes could be refused.
@@ -22,4 +22,4 @@ If you are contributing new or updated code please match the existing code style
### Licensing
-Code in this repository is licensed under the [BSD-3 License](LICENSE.TXT). By contributing content to this repository you are agreeing to place your contributions under this license.
+Code in this repository is lisensed under the [BSD-3 License](LICENSE.TXT). By contributing content to this repository you are agreeing to place your contributions under this licence.
diff --git a/MODULE.bazel b/MODULE.bazel
deleted file mode 100644
index 9cdcce3..0000000
--- a/MODULE.bazel
+++ /dev/null
@@ -1,150 +0,0 @@
-module(
- name = "pico-sdk",
- version = "2.1.0",
-)
-
-bazel_dep(name = "platforms", version = "0.0.9")
-bazel_dep(name = "bazel_skylib", version = "1.6.1")
-bazel_dep(name = "rules_python", version = "0.36.0")
-bazel_dep(name = "picotool", version = "2.1.0")
-bazel_dep(name = "rules_cc", version = "0.0.10")
-
-http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
-http_archive(
- name = "arm_gcc_linux-aarch64",
- build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
- sha256 = "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a",
- strip_prefix = "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi",
- url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
-)
-
-http_archive(
- name = "arm_gcc_linux-x86_64",
- build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
- sha256 = "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb",
- strip_prefix = "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi",
- url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
-)
-
-http_archive(
- name = "arm_gcc_win-x86_64",
- build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
- sha256 = "51d933f00578aa28016c5e3c84f94403274ea7915539f8e56c13e2196437d18f",
- strip_prefix = "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi",
- url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
-)
-
-http_archive(
- name = "arm_gcc_mac-x86_64",
- build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
- sha256 = "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc",
- strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi",
- url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
-)
-
-http_archive(
- name = "arm_gcc_mac-aarch64",
- build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
- sha256 = "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279",
- strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi",
- url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
-)
-
-http_archive(
- name = "clang_linux-x86_64",
- build_file = "//bazel/toolchain:clang.BUILD",
- sha256 = "6c599d1aba568236064c340d7813324849896d5a4e2f3fd8225a8c31bfcbf884",
- type = "zip",
- url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/linux-amd64/+/git_revision:2b0a708f41dd6291ee744704d43febc975e3d026",
-)
-
-http_archive(
- name = "clang_win-x86_64",
- build_file = "//bazel/toolchain:clang.BUILD",
- sha256 = "f49ba4123ee3958f2b47289d017a5b3f1ca01f82dd7a2168c45412c18101fd13",
- type = "zip",
- # Windows doesn't like `:` in the produced filename, so replace it with `%3A`.
- url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/windows-amd64/+/git_revision:2b0a708f41dd6291ee744704d43febc975e3d026".replace("git_revision:", "git_revision%3A"),
-)
-
-http_archive(
- name = "clang_mac-x86_64",
- build_file = "//bazel/toolchain:clang.BUILD",
- sha256 = "d3516f2eb4c12d17ae77ee84c9226fbea581d4fb806910ceac4717d5adfcf748",
- type = "zip",
- url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-amd64/+/git_revision:2b0a708f41dd6291ee744704d43febc975e3d026",
-)
-
-http_archive(
- name = "clang_mac-aarch64",
- build_file = "//bazel/toolchain:clang.BUILD",
- sha256 = "68e551f41c7e9473063b09819f6ab8ec6e7e53677f4078189656cb14dc52984b",
- type = "zip",
- url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-arm64/+/git_revision:2b0a708f41dd6291ee744704d43febc975e3d026",
-)
-
-new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
-
-# TODO: Provide tinyusb as a proper Bazel module.
-new_git_repository(
- name = "tinyusb",
- build_file = "//src/rp2_common/tinyusb:tinyusb.BUILD",
- commit = "5217cee5de4cd555018da90f9f1bcc87fb1c1d3a", # keep-in-sync-with-submodule: lib/tinyusb
- remote = "https://github.com/hathach/tinyusb.git",
-)
-
-# TODO: Provide btstack as a proper Bazel module.
-new_git_repository(
- name = "btstack",
- build_file = "//src/rp2_common/pico_btstack:btstack.BUILD",
- commit = "2b49e57bd1fae85ac32ac1f41cdb7c794de335f6", # keep-in-sync-with-submodule: lib/btstack
- remote = "https://github.com/bluekitchen/btstack.git",
-)
-
-# TODO: Provide cyw43-driver as a proper Bazel module.
-new_git_repository(
- name = "cyw43-driver",
- build_file = "//src/rp2_common/pico_cyw43_driver:cyw43-driver.BUILD",
- commit = "cf924bb04c8984675ca0fc2178f082e404e048c3", # keep-in-sync-with-submodule: lib/cyw43-driver
- remote = "https://github.com/georgerobotics/cyw43-driver.git",
-)
-
-# TODO: Provide lwip as a proper Bazel module.
-new_git_repository(
- name = "lwip",
- build_file = "//src/rp2_common/pico_lwip:lwip.BUILD",
- commit = "0a0452b2c39bdd91e252aef045c115f88f6ca773", # keep-in-sync-with-submodule: lib/lwip
- remote = "https://github.com/lwip-tcpip/lwip.git",
-)
-
-register_toolchains(
- "//bazel/toolchain:linux-aarch64-rp2040",
- "//bazel/toolchain:linux-aarch64-rp2350",
- "//bazel/toolchain:linux-x86_64-rp2040",
- "//bazel/toolchain:linux-x86_64-rp2350",
- "//bazel/toolchain:win-x86_64-rp2040",
- "//bazel/toolchain:win-x86_64-rp2350",
- "//bazel/toolchain:mac-x86_64-rp2040",
- "//bazel/toolchain:mac-x86_64-rp2350",
- "//bazel/toolchain:mac-aarch64-rp2040",
- "//bazel/toolchain:mac-aarch64-rp2350",
- # Require users to opt-in to the Pico SDK's toolchains.
- dev_dependency = True,
-)
-
-python = use_extension("@rules_python//python/extensions:python.bzl", "python")
-python.toolchain(
- configure_coverage_tool = True,
- python_version = "3.9",
-)
-
-use_repo(python, "pythons_hub")
-register_toolchains(
- "@pythons_hub//:all",
- dev_dependency = True,
-)
-register_toolchains(
- "@rules_python//python/runtime_env_toolchains:all",
- dev_dependency = True,
-)
diff --git a/README.md b/README.md
index 69f6c4e..db6cef6 100644
--- a/README.md
+++ b/README.md
@@ -1,31 +1,28 @@
# Raspberry Pi Pico SDK
The Raspberry Pi Pico SDK (henceforth the SDK) provides the headers, libraries and build system
-necessary to write programs for the RP-series microcontroller-based devices such as the Raspberry Pi Pico or Raspberry Pi Pico 2
+necessary to write programs for the RP2040-based devices such as the Raspberry Pi Pico
in C, C++ or assembly language.
The SDK is designed to provide an API and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
A single program runs on the device at a time and starts with a conventional `main()` method. Standard C/C++ libraries are supported along with
-C-level libraries/APIs for accessing all of the RP-series microcontroller's hardware including PIO (Programmable IO).
+C level libraries/APIs for accessing all of the RP2040's hardware include PIO (Programmable IO).
-Additionally, the SDK provides higher level libraries for dealing with timers, synchronization, Wi-Fi and Bluetooth networking, USB and multicore programming. These libraries should be comprehensive enough that your application code rarely, if at all, needs to access hardware registers directly. However, if you do need or prefer to access the raw hardware registers, you will also find complete and fully-commented register definition headers in the SDK. There's no need to look up addresses in the datasheet.
+Additionally the SDK provides higher level libraries for dealing with timers, synchronization, USB (TinyUSB) and multi-core programming
+along with various utilities.
-The SDK can be used to build anything from simple applications, fully-fledged runtime environments such as MicroPython, to low level software
-such as the RP-series microcontroller's on-chip bootrom itself.
-
-The design goal for entire SDK is to be simple but powerful.
+The SDK can be used to build anything from simple applications, to fully fledged runtime environments such as MicroPython, to low level software
+such as RP2040's on-chip bootrom itself.
Additional libraries/APIs that are not yet ready for inclusion in the SDK can be found in [pico-extras](https://github.com/raspberrypi/pico-extras).
# Documentation
-See [Getting Started with the Raspberry Pi Pico-Series](https://rptl.io/pico-get-started) for information on how to setup your
-hardware, IDE/environment and how to build and debug software for the Raspberry Pi Pico and other RP-series microcontroller based devices.
+See [Getting Started with the Raspberry Pi Pico](https://rptl.io/pico-get-started) for information on how to setup your
+hardware, IDE/environment and for how to build and debug software for the Raspberry Pi Pico
+and other RP2040-based devices.
-See [Connecting to the Internet with Raspberry Pi Pico W](https://rptl.io/picow-connect) to learn more about writing
-applications for your Raspberry Pi Pico W that connect to the internet.
-
-See [Raspberry Pi Pico-Series C/C++ SDK](https://rptl.io/pico-c-sdk) to learn more about programming using the
+See [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk) to learn more about programming using the
SDK, to explore more advanced features, and for complete PDF-based API documentation.
See [Online Raspberry Pi Pico SDK API docs](https://rptl.io/pico-doxygen) for HTML-based API documentation.
@@ -34,26 +31,14 @@ See [Online Raspberry Pi Pico SDK API docs](https://rptl.io/pico-doxygen) for HT
See [pico-examples](https://github.com/raspberrypi/pico-examples) for example code you can build.
-# Getting the latest SDK code
-
-The [master](https://github.com/raspberrypi/pico-sdk/tree/master/) branch of `pico-sdk` on GitHub contains the
-_latest stable release_ of the SDK. If you need or want to test upcoming features, you can try the
-[develop](https://github.com/raspberrypi/pico-sdk/tree/develop/) branch instead.
-
# Quick-start your own project
-## Using Visual Studio Code
-
-You can install the [Raspberry Pi Pico Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=raspberry-pi.raspberry-pi-pico) in VS Code.
-
-## Unix command line
-
These instructions are extremely terse, and Linux-based only. For detailed steps,
-instructions for other platforms, and just in general, we recommend you see [Raspberry Pi Pico-Series C/C++ SDK](https://rptl.io/pico-c-sdk)
+instructions for other platforms, and just in general, we recommend you see [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk)
-1. Install CMake (at least version 3.13), python 3, a native compiler, and a GCC cross compiler
+1. Install CMake (at least version 3.13), and GCC cross compiler
```
- sudo apt install cmake python3 build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
+ sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
```
1. Set up your project to point to use the Raspberry Pi Pico SDK
@@ -65,7 +50,7 @@ instructions for other platforms, and just in general, we recommend you see [Ras
3. Setup a `CMakeLists.txt` like:
```cmake
- cmake_minimum_required(VERSION 3.13...3.27)
+ cmake_minimum_required(VERSION 3.13)
# initialize the SDK based on PICO_SDK_PATH
# note: this must happen before project()
@@ -85,7 +70,7 @@ instructions for other platforms, and just in general, we recommend you see [Ras
1. Setup a `CMakeLists.txt` like:
```cmake
- cmake_minimum_required(VERSION 3.13...3.27)
+ cmake_minimum_required(VERSION 3.13)
# initialize pico-sdk from submodule
# note: this must happen before project()
@@ -125,25 +110,7 @@ instructions for other platforms, and just in general, we recommend you see [Ras
```
- * Or by cloning the SDK locally, but without copying `pico_sdk_import.cmake`:
- 1. `git clone` this Raspberry Pi Pico SDK repository
- 2. Setup a `CMakeLists.txt` like:
-
- ```cmake
- cmake_minimum_required(VERSION 3.13)
-
- # initialize the SDK directly
- include(/path/to/pico-sdk/pico_sdk_init.cmake)
-
- project(my_project)
-
- # initialize the Raspberry Pi Pico SDK
- pico_sdk_init()
-
- # rest of your project
-
- ```
-1. Write your code (see [pico-examples](https://github.com/raspberrypi/pico-examples) or the [Raspberry Pi Pico-Series C/C++ SDK](https://rptl.io/pico-c-sdk) documentation for more information)
+1. Write your code (see [pico-examples](https://github.com/raspberrypi/pico-examples) or the [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk) documentation for more information)
About the simplest you can do is a single source file (e.g. hello_world.c)
@@ -152,7 +119,7 @@ instructions for other platforms, and just in general, we recommend you see [Ras
#include "pico/stdlib.h"
int main() {
- stdio_init_all();
+ setup_default_uart();
printf("Hello, world!\n");
return 0;
}
@@ -174,30 +141,18 @@ instructions for other platforms, and just in general, we recommend you see [Ras
Note this example uses the default UART for _stdout_;
if you want to use the default USB see the [hello-usb](https://github.com/raspberrypi/pico-examples/tree/master/hello_world/usb) example.
+
1. Setup a CMake build directory.
For example, if not using an IDE:
```
$ mkdir build
$ cd build
$ cmake ..
- ```
-
- When building for a board other than the Raspberry Pi Pico, you should pass `-DPICO_BOARD=board_name` to the `cmake` command above, e.g. `cmake -DPICO_BOARD=pico2 ..` or `cmake -DPICO_BOARD=pico_w ..` to configure the SDK and build options accordingly for that particular board.
-
- Specifying `PICO_BOARD=` sets up various compiler defines (e.g. default pin numbers for UART and other hardware) and in certain
- cases also enables the use of additional libraries (e.g. wireless support when building for `PICO_BOARD=pico_w`) which cannot
- be built without a board which provides the requisite hardware functionality.
-
- For a list of boards defined in the SDK itself, look in [this directory](src/boards/include/boards) which has a
- header for each named board.
+ ```
1. Make your target from the build directory you created.
```sh
$ make hello_world
```
-1. You now have `hello_world.elf` to load via a debugger, or `hello_world.uf2` that can be installed and run on your Raspberry Pi Pico-series device via drag and drop.
-
-# RISC-V support on RP2350
-
-See [Raspberry Pi Pico-series C/C++ SDK](https://rptl.io/pico-c-sdk) for information on setting up a build environment for RISC-V on RP2350.
+1. You now have `hello_world.elf` to load via a debugger, or `hello_world.uf2` that can be installed and run on your Raspberry Pi Pico via drag and drop.
diff --git a/WORKSPACE b/WORKSPACE
deleted file mode 100644
index e69de29..0000000
diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel
deleted file mode 100644
index ff093d4..0000000
--- a/bazel/BUILD.bazel
+++ /dev/null
@@ -1,63 +0,0 @@
-load("@rules_python//python:defs.bzl", "py_binary")
-
-package(default_visibility = ["//visibility:public"])
-
-py_binary(
- name = "generate_version_header",
- srcs = ["generate_version_header.py"],
- visibility = ["//:__subpackages__"],
-)
-
-# This isn't actually generated, it just uses the same name
-# to make it show up easier in searches.
-#
-# Rather than generating lists of headers to match CMake, the Bazel build
-# opts to have a static header that transitively include two known headers.
-# By default, empty header files are included, and users/platforms are expected
-# to specify an appropriate `cc_library` to replace them.
-#
-# You tell bazel which `cc_library` provides the respective headers by
-# configuring these `label_flag`s:
-#
-# # Specify the library that provides "pico_config_extra_headers.h"
-# --@pico-sdk//bazel/config:PICO_CONFIG_EXTRA_HEADER=//my_proj:my_custom_headers
-#
-# # Specify the library that provides "pico_config_platform_headers.h"
-# --@pico-sdk//bazel/config:PICO_CONFIG_PLATFORM_HEADER=//my_proj:my_custom_platform_headers
-cc_library(
- name = "generate_config_header",
- hdrs = ["include/pico/config_autogen.h"],
- includes = ["include"],
- visibility = ["//:__subpackages__"],
- deps = [
- "//bazel/config:PICO_CONFIG_EXTRA_HEADER",
- "//bazel/config:PICO_CONFIG_PLATFORM_HEADER",
- ],
-)
-
-genrule(
- name = "empty_extra_headers_file",
- outs = ["generated_extra_include/pico_config_extra_headers.h"],
- cmd = "echo > $@",
- cmd_bat = "copy NUL $@",
- visibility = ["//visibility:private"],
-)
-
-cc_library(
- name = "no_extra_headers",
- hdrs = ["generated_extra_include/pico_config_extra_headers.h"],
- includes = ["generated_extra_include"],
- visibility = ["//visibility:private"],
-)
-
-# An empty stub, useful for label_flag flags that need to point to a library,
-# but for some purposes the library needs to be a no-op.
-cc_library(
- name = "empty_cc_lib",
-)
-
-# A library incompatible with everything. Use to mark an invalid configuration.
-cc_library(
- name = "incompatible_cc_lib",
- target_compatible_with = ["@platforms//:incompatible"],
-)
diff --git a/bazel/README.md b/bazel/README.md
deleted file mode 100644
index 35b2045..0000000
--- a/bazel/README.md
+++ /dev/null
@@ -1,115 +0,0 @@
-# Bazel build
-
-## Using the Pico SDK in a Bazel project.
-
-### Add pico-sdk as a dependency
-First, in your `MODULE.bazel` file, add a dependency on the Pico SDK and
-`rules_cc`:
-```python
-bazel_dep(name = "pico-sdk", version = "2.1.0")
-```
-
-### Register toolchains
-These toolchains tell Bazel how to compile for ARM cores. Add the following
-to the `MODULE.bazel` for your project:
-```python
-register_toolchains(
- "@pico-sdk//bazel/toolchain:linux-x86_64-rp2040",
- "@pico-sdk//bazel/toolchain:linux-x86_64-rp2350",
- "@pico-sdk//bazel/toolchain:win-x86_64-rp2040",
- "@pico-sdk//bazel/toolchain:win-x86_64-rp2350",
- "@pico-sdk//bazel/toolchain:mac-x86_64-rp2040",
- "@pico-sdk//bazel/toolchain:mac-x86_64-rp2350",
- "@pico-sdk//bazel/toolchain:mac-aarch64-rp2040",
- "@pico-sdk//bazel/toolchain:mac-aarch64-rp2350",
-)
-```
-
-### Ready to build!
-You're now ready to start building Pico Projects in Bazel! When building,
-don't forget to specify `--platforms` so Bazel knows you're targeting the
-Raspberry Pi Pico:
-```console
-$ bazelisk build --platforms=@pico-sdk//bazel/platform:rp2040 //...
-```
-
-## SDK configuration
-An exhaustive list of build system configuration options is available in
-`//bazel/config:BUILD.bazel`.
-
-### Selecting a different board
-A different board can be selected specifying `--@pico-sdk//bazel/config:PICO_BOARD`:
-```console
-$ bazelisk build --platforms=//bazel/platform:rp2040 --@pico-sdk//bazel/config:PICO_BOARD=pico_w //...
-```
-
-If you have a bespoke board definition, you can configure the Pico SDK to use it
-by pointing `--@pico-sdk//bazel/config:PICO_CONFIG_HEADER` to a `cc_library`
-that defines `PICO_BOARD` and either a `PICO_CONFIG_HEADER` define or a
-`pico/config_autogen.h` header. Make sure any required `includes`, `hdrs`, and
-`deps` are also provided.
-
-## Generating UF2 firmware images
-Creation of UF2 images can be done as explicit build steps on a per-binary
-rule basis, or through an aspect. Running a wildcard build with the
-`pico_uf2_aspect` enabled is the easiest way to create a UF2 for every ELF
-firmware image.
-
-```console
-$ bazelisk build --platforms=@pico-sdk//bazel/platform:rp2040 \
- --aspects @pico-sdk//tools:uf2_aspect.bzl%pico_uf2_aspect \
- --output_groups=+pico_uf2_files \
- //...
-```
-
-## Building the Pico SDK itself
-
-### First time setup
-You'll need Bazel (v7.0.0 or higher) or Bazelisk (a self-updating Bazel
-launcher) to build the Pico SDK.
-
-We strongly recommend you set up
-[Bazelisk](https://bazel.build/install/bazelisk).
-
-You will also need a working compiler configured if you wish to build Picotool
-or pioasm.
-
-* Linux: `sudo apt-get install build-essential` or similar.
-* macOS: `xcode-select --install`
-* Windows: [Install MSVC](https://visualstudio.microsoft.com/vs/features/cplusplus/)
-
-### Building
-To build all of the Pico SDK, run the following command:
-```console
-$ bazelisk build --platforms=//bazel/platform:rp2040 //...
-```
-
-## Known issues and limitations
-The Bazel build for the Pico SDK is relatively new, but most features and
-configuration options available in the CMake build are also available in Bazel.
-You are welcome and encouraged to file issues for any problems and limitations
-you encounter along the way.
-
-Currently, the following features are not supported:
-
-* Pico W wireless libraries work, but may not have complete feature parity with
- the CMake build.
-* Bazel does not yet provide RISC-V support for Pico 2/RP2350.
-* The pioasm parser cannot be built from source via Bazel.
-* Windows MSVC wildcard build (`bazel build //...`) does not work when targeting
- host.
-
-## Contributing
-When making changes to the Bazel build, please run the Bazel validation script
-to ensure all supported configurations build properly:
-
-```console
-$ ./tools/run_all_bazel_checks.py
-```
-
-If you need to check against a local version of Picotool, you can run the script
-with `--picotool-dir`:
-
-```console
-$ ./tools/run_all_bazel_checks.py --picotool-dir=/path/to/picotool
-```
diff --git a/bazel/config/BUILD.bazel b/bazel/config/BUILD.bazel
deleted file mode 100644
index 4e622af..0000000
--- a/bazel/config/BUILD.bazel
+++ /dev/null
@@ -1,290 +0,0 @@
-load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "int_flag", "string_flag")
-
-package(default_visibility = ["//visibility:public"])
-
-# PICO_BAZEL_CONFIG: PICO_TOOLCHAIN, The toolchain to use, type=string, default=gcc, group=build
-string_flag(
- name = "PICO_TOOLCHAIN",
- build_setting_default = "gcc",
- values = [
- "gcc",
- "clang",
- ],
-)
-
-# PICO_BAZEL_CONFIG: PICO_BOARD, Board name being built for, type=string, default=pico or pico2, group=build, docref=cmake-platform-board-config
-string_flag(
- name = "PICO_BOARD",
- build_setting_default = "pico",
-)
-
-# PICO_BAZEL_CONFIG: PICO_BARE_METAL, Flag to exclude anything except base headers from the build, type=bool, default=0, group=build
-bool_flag(
- name = "PICO_BARE_METAL",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_NO_GC_SECTIONS, Disable `-ffunction-sections` `-fdata-sections` and `--gc-sections`, type=bool, default=0, advanced=true, group=pico_standard_link
-bool_flag(
- name = "PICO_NO_GC_SECTIONS",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_DEFAULT_BOOT_STAGE2_FILE, Boot stage 2 file to use; this should point to a filegroup with the .S file to use, type=string, group=build
-label_flag(
- name = "PICO_DEFAULT_BOOT_STAGE2_FILE",
- build_setting_default = "//src/rp2_common:build_selected_boot2",
-)
-
-# PICO_BAZEL_CONFIG: PICO_DEFAULT_BOOT_STAGE2, Simpler alternative to specifying PICO_DEFAULT_BOOT_STAGE2_FILE where the latter is set to src/rp2_common/boot_stage2/{PICO_DEFAULT_BOOT_STAGE2}.S, type=string, default=compile_time_choice, group=build
-string_flag(
- name = "PICO_DEFAULT_BOOT_STAGE2",
- build_setting_default = "compile_time_choice",
-)
-
-# PICO_BAZEL_CONFIG: PICO_BOOT_STAGE2_LINK_IMAGE, [Bazel only] The final boot_stage2 image target to link in. Use this to fully override/replace boot_stage2, default=@pico-sdk//src/rp2_common:boot_stage2, group=build
-label_flag(
- name = "PICO_BOOT_STAGE2_LINK_IMAGE",
- build_setting_default = "//src/rp2_common:boot_stage2",
-)
-
-# PICO_BAZEL_CONFIG: PICO_CXX_ENABLE_EXCEPTIONS, Enable CXX exception handling, type=bool, default=0, group=pico_cxx_options
-bool_flag(
- name = "PICO_CXX_ENABLE_EXCEPTIONS",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_CXX_ENABLE_RTTI, Enable CXX rtti, type=bool, default=0, group=pico_cxx_options
-bool_flag(
- name = "PICO_CXX_ENABLE_RTTI",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_CXX_ENABLE_CXA_ATEXIT, Enable cxa-atexit, type=bool, default=0, group=pico_cxx_options
-bool_flag(
- name = "PICO_CXX_ENABLE_CXA_ATEXIT",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_STDIO_UART, Option to globally enable stdio UART for all targets by default, type=bool, default=1, group=pico_stdlib
-bool_flag(
- name = "PICO_STDIO_UART",
- build_setting_default = True,
-)
-
-# PICO_BAZEL_CONFIG: PICO_DEFAULT_UART_BAUD_RATE, Define the default UART baudrate, type=int, max=921600, default=115200, group=hardware_uart
-int_flag(
- name = "PICO_DEFAULT_UART_BAUD_RATE",
- build_setting_default = 115200,
-)
-
-# PICO_BAZEL_CONFIG: PICO_STDIO_USB, Option to globally enable stdio USB for all targets by default, type=bool, default=0, group=pico_stdlib
-bool_flag(
- name = "PICO_STDIO_USB",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_STDIO_SEMIHOSTING, Option to globally enable stdio semi-hosting for all targets by default, type=bool, default=0, group=pico_stdlib
-bool_flag(
- name = "PICO_STDIO_SEMIHOSTING",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_STDIO_RTT, Option to globally enable stdio RTT for all targets by default, type=bool, default=0, group=pico_stdlib
-bool_flag(
- name = "PICO_STDIO_RTT",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_MULTICORE_ENABLED, OPTION: Enable multicore handling, type=bool, default=1, group=pico_stdlib
-bool_flag(
- name = "PICO_MULTICORE_ENABLED",
- build_setting_default = True,
-)
-
-# PICO_BAZEL_CONFIG: PICO_DEFAULT_DOUBLE_IMPL, The default implementation for pico_double to link. auto selects an appropriate default for the current platform. rp2040 is only supported on the rp2040. dcp is only supported on rp2350, type=string, default=auto, group=build
-string_flag(
- name = "PICO_DEFAULT_DOUBLE_IMPL",
- build_setting_default = "auto",
- values = [
- "auto",
- "compiler",
- "dcp",
- "rp2040",
- "none",
- ],
-)
-
-# PICO_BAZEL_CONFIG: PICO_DEFAULT_FLOAT_IMPL, The default implementation for pico_float to link. auto selects an appropriate default for the current platform. rp2040 is only supported on the rp2040. vfp and dcp are only supported on rp2350, type=string, default=auto, group=build
-string_flag(
- name = "PICO_DEFAULT_FLOAT_IMPL",
- build_setting_default = "auto",
- values = [
- "auto",
- "compiler",
- "dcp",
- "rp2040",
- "vfp",
- "none",
- ],
-)
-
-# PICO_BAZEL_CONFIG: PICO_DEFAULT_DIVIDER_IMPL, The default implementation for pico_divider to link. hardware uses accelerated divide instructions while compiler allows the compiler to decide how to handle divide instructions. auto uses the platform default (hardware on RP2040 and compiler on RP2350), type=string, default=auto, group=build
-string_flag(
- name = "PICO_DEFAULT_DIVIDER_IMPL",
- build_setting_default = "auto",
- values = [
- "auto",
- "hardware",
- "compiler",
- ],
-)
-
-# PICO_BAZEL_CONFIG: PICO_DEFAULT_PRINTF_IMPL, The default implementation for pico_printf to link. compiler lets the compiler control printf behavior while pico provides a pico-specific implementation, type=string, default=double, group=build
-string_flag(
- name = "PICO_DEFAULT_PRINTF_IMPL",
- build_setting_default = "pico",
- values = [
- "pico",
- "compiler",
- "none",
- ],
-)
-
-# PICO_BAZEL_CONFIG: PICO_ASYNC_CONTEXT_IMPL, The default implementation for pico_async_context to link, type=string, default=threadsafe_background, group=build
-string_flag(
- name = "PICO_ASYNC_CONTEXT_IMPL",
- build_setting_default = "threadsafe_background",
- values = [
- "poll",
- "threadsafe_background",
- "freertos",
- ],
-)
-
-# PICO_BAZEL_CONFIG: PICO_BINARY_INFO_ENABLED, Whether to include binary info in final firmware, type=bool, default=1, group=pico_stdlib
-bool_flag(
- name = "PICO_BINARY_INFO_ENABLED",
- build_setting_default = True,
-)
-
-# PICO_BAZEL_CONFIG: PICO_CMSIS_PATH, Label of a cc_ibrary providing CMSIS core, type=string, default="included stub CORE only impl", group=build
-label_flag(
- name = "PICO_CMSIS_PATH",
- build_setting_default = "//src/rp2_common/cmsis:cmsis_core",
-)
-
-# PICO_BAZEL_CONFIG: PICO_USE_DEFAULT_MAX_PAGE_SIZE, Don't shrink linker max page to 4096, type=bool, default=0, advanced=true, group=pico_standard_link
-bool_flag(
- name = "PICO_USE_DEFAULT_MAX_PAGE_SIZE",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS, Maximum number of milliseconds to wait during initialization for a CDC connection from the host (negative means indefinite) during initialization, type=int, default=0, group=pico_stdio_usb
-int_flag(
- name = "PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS",
- build_setting_default = 0,
-)
-
-# PICO_BAZEL_CONFIG: PICO_TINYUSB_LIB, [Bazel only] The library that provides TinyUSB, default=@tinyusb//:tinyusb, group=build
-label_flag(
- name = "PICO_TINYUSB_LIB",
- build_setting_default = "@tinyusb//:tinyusb",
-)
-
-# TODO: Bazel build for mbedtls at @mbedtls//:mbedtls.
-# PICO_BAZEL_CONFIG: PICO_MBEDTLS_LIB, [Bazel only] The library that provides mbedtls, default=@mbedtls//:mbedtls, group=build
-label_flag(
- name = "PICO_MBEDTLS_LIB",
- build_setting_default = "//bazel:incompatible_cc_lib",
-)
-
-# PICO_BAZEL_CONFIG: PICO_DEFAULT_BINARY_INFO, [Bazel only] The library that provides custom_pico_binary_info to link into all binaries, default=//src/rp2_common/pico_standard_binary_info:default_binary_info, group=pico_standard_link
-label_flag(
- name = "PICO_DEFAULT_BINARY_INFO",
- build_setting_default = "//src/rp2_common/pico_standard_binary_info:default_binary_info",
-)
-
-# PICO_BAZEL_CONFIG: PICO_BAZEL_BUILD_TYPE, The type of build (e.g. Debug or Release) to embed in binary info, type=string, default=pico, group=build
-string_flag(
- name = "PICO_BAZEL_BUILD_TYPE",
- build_setting_default = "Debug",
-)
-
-# PICO_BAZEL_CONFIG: PICO_DEFAULT_LINKER_SCRIPT, [Bazel only] The library that provides a linker script to link into all binaries, default=//src/rp2_common/pico_crt0:default_linker_script, group=pico_standard_link
-label_flag(
- name = "PICO_DEFAULT_LINKER_SCRIPT",
- build_setting_default = "//src/rp2_common/pico_crt0:default_linker_script",
-)
-
-# PICO_BAZEL_CONFIG: PICO_NO_TARGET_NAME, Don't define PICO_TARGET_NAME, type=bool, default=0, group=build
-bool_flag(
- name = "PICO_NO_TARGET_NAME",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_CONFIG_EXTRA_HEADER, [Bazel only] The cc_library that provides "pico_config_extra_headers.h", default=//bazel:no_extra_headers, group=pico_base
-label_flag(
- name = "PICO_CONFIG_EXTRA_HEADER",
- build_setting_default = "//bazel:no_extra_headers",
-)
-
-# PICO_BAZEL_CONFIG: PICO_CONFIG_PLATFORM_HEADER, [Bazel only] The cc_library that provides "pico_config_platform_headers.h" and defines PICO_BOARD, default=//src/common/pico_base_headers:default_platform_headers, group=pico_base
-label_flag(
- name = "PICO_CONFIG_PLATFORM_HEADER",
- build_setting_default = "//src/boards:default",
-)
-
-# PICO_BAZEL_CONFIG: PICO_CONFIG_HEADER, [Bazel only] The cc_library that defines PICO_CONFIG_HEADER or pico/config_autogen.h and other SDK critical defines (overrides PICO_BOARD setting), default=//bazel:generate_config_header, group=pico_base
-label_flag(
- name = "PICO_CONFIG_HEADER",
- build_setting_default = "//bazel:generate_config_header",
-)
-
-# PICO_BAZEL_CONFIG: PICO_CLIB, [Bazel only] The flavor of libc porting layer to use. auto infers the correct value to use from PICO_TOOLCHAIN, group=pico_standard_link
-string_flag(
- name = "PICO_CLIB",
- build_setting_default = "auto",
- values = [
- "auto",
- "llvm_libc",
- "newlib",
- "picolibc",
- ],
-)
-
-# PICO_BAZEL_CONFIG: PICO_BTSTACK_CONFIG, [Bazel only] The cc_library that provides btstack_config.h, default=//bazel:empty_cc_lib, group=wireless
-label_flag(
- name = "PICO_BTSTACK_CONFIG",
- build_setting_default = "//bazel:empty_cc_lib",
-)
-
-# PICO_BAZEL_CONFIG: PICO_BT_ENABLE_BLE, [Bazel only] Whether or not to link in BLE portions of the btstack as part of //src/rp2_common/pico_btstack. Also defines ENABLE_BLE=1, type=bool, default=False, group=wireless
-bool_flag(
- name = "PICO_BT_ENABLE_BLE",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_BT_ENABLE_CLASSIC, [Bazel only] Whether or not to link in classic BT portions of the btstack as part of //src/rp2_common/pico_btstack. Also defines ENABLE_CLASSIC=1, type=bool, default=False, group=wireless
-bool_flag(
- name = "PICO_BT_ENABLE_CLASSIC",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_BT_ENABLE_MESH, [Bazel only] Whether or not to link in mesh BT portions of the btstack as part of //src/rp2_common/pico_btstack. Also defines ENABLE_MESH=1, type=bool, default=False, group=wireless
-bool_flag(
- name = "PICO_BT_ENABLE_MESH",
- build_setting_default = False,
-)
-
-# PICO_BAZEL_CONFIG: PICO_LWIP_CONFIG, [Bazel only] The cc_library that provides lwipopts.h, default=//bazel:empty_cc_lib, group=wireless
-label_flag(
- name = "PICO_LWIP_CONFIG",
- build_setting_default = "//bazel:empty_cc_lib",
-)
-
-# PICO_BAZEL_CONFIG: PICO_FREERTOS_LIB, [Bazel only] The cc_library that provides FreeRTOS, default=//bazel:empty_cc_lib, group=wireless
-label_flag(
- name = "PICO_FREERTOS_LIB",
- build_setting_default = "//bazel:empty_cc_lib",
-)
diff --git a/bazel/constraint/BUILD.bazel b/bazel/constraint/BUILD.bazel
deleted file mode 100644
index a4fe918..0000000
--- a/bazel/constraint/BUILD.bazel
+++ /dev/null
@@ -1,254 +0,0 @@
-load("//bazel/util:label_flag_matches.bzl", "label_flag_matches")
-
-package(default_visibility = ["//visibility:public"])
-
-# This constraint represents the dimension that guides the Pico SDK build. This
-# constraint will only ever enumerate specific MCUs (and the host), and does NOT
-# cover the differences from board-to-board.
-constraint_setting(
- name = "sdk_target",
- default_constraint_value = "host",
-)
-
-# This constraint value is used to guide the host build.
-constraint_value(
- name = "host",
- constraint_setting = ":sdk_target",
-)
-
-# This constraint value is used to guide parts of the build that are specific
-# to the rp2040.
-constraint_value(
- name = "rp2040",
- constraint_setting = ":sdk_target",
-)
-
-# This constraint value is used to guide parts of the build that are specific
-# to the rp2350.
-constraint_value(
- name = "rp2350",
- constraint_setting = ":sdk_target",
-)
-
-constraint_setting(
- name = "wireless_support",
- default_constraint_value = "no_wireless",
-)
-
-constraint_value(
- name = "no_wireless",
- constraint_setting = ":wireless_support",
-)
-
-constraint_value(
- name = "cyw43_wireless",
- constraint_setting = ":wireless_support",
-)
-
-config_setting(
- name = "is_pico_w",
- flag_values = {"//bazel/config:PICO_BOARD": "pico_w"},
-)
-
-config_setting(
- name = "is_pico2_w",
- flag_values = {"//bazel/config:PICO_BOARD": "pico2_w"},
-)
-
-config_setting(
- name = "pico_toolchain_clang_enabled",
- flag_values = {"//bazel/config:PICO_TOOLCHAIN": "clang"},
-)
-
-config_setting(
- name = "pico_toolchain_gcc_enabled",
- flag_values = {"//bazel/config:PICO_TOOLCHAIN": "gcc"},
-)
-
-config_setting(
- name = "pico_baremetal_enabled",
- flag_values = {"//bazel/config:PICO_BARE_METAL": "True"},
-)
-
-config_setting(
- name = "pico_no_gc_sections_enabled",
- flag_values = {"//bazel/config:PICO_NO_GC_SECTIONS": "True"},
-)
-
-config_setting(
- name = "pico_cxx_enable_exceptions_enabled",
- flag_values = {"//bazel/config:PICO_CXX_ENABLE_EXCEPTIONS": "True"},
-)
-
-config_setting(
- name = "pico_cxx_enable_rtti_enabled",
- flag_values = {"//bazel/config:PICO_CXX_ENABLE_RTTI": "True"},
-)
-
-config_setting(
- name = "pico_cxx_enable_cxa_atexit_enabled",
- flag_values = {"//bazel/config:PICO_CXX_ENABLE_RTTI": "True"},
-)
-
-config_setting(
- name = "pico_stdio_uart_enabled",
- flag_values = {"//bazel/config:PICO_STDIO_UART": "True"},
-)
-
-config_setting(
- name = "pico_stdio_usb_enabled",
- flag_values = {"//bazel/config:PICO_STDIO_USB": "True"},
-)
-
-config_setting(
- name = "pico_stdio_semihosting_enabled",
- flag_values = {"//bazel/config:PICO_STDIO_SEMIHOSTING": "True"},
-)
-
-config_setting(
- name = "pico_stdio_rtt_enabled",
- flag_values = {"//bazel/config:PICO_STDIO_RTT": "True"},
-)
-
-config_setting(
- name = "pico_multicore_enabled",
- flag_values = {"//bazel/config:PICO_MULTICORE_ENABLED": "True"},
-)
-
-config_setting(
- name = "pico_float_auto_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "auto"},
-)
-
-config_setting(
- name = "pico_float_compiler_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "compiler"},
-)
-
-config_setting(
- name = "pico_float_dcp_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "dcp"},
-)
-
-config_setting(
- name = "pico_float_rp2040_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "rp2040"},
-)
-
-config_setting(
- name = "pico_float_vfp_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "vfp"},
-)
-
-config_setting(
- name = "pico_double_auto_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_DOUBLE_IMPL": "auto"},
-)
-
-config_setting(
- name = "pico_double_compiler_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_DOUBLE_IMPL": "compiler"},
-)
-
-config_setting(
- name = "pico_double_dcp_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_DOUBLE_IMPL": "dcp"},
-)
-
-config_setting(
- name = "pico_double_rp2040_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_DOUBLE_IMPL": "rp2040"},
-)
-
-config_setting(
- name = "pico_divider_hardware_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_DIVIDER_IMPL": "hardware"},
-)
-
-config_setting(
- name = "pico_divider_auto_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_DIVIDER_IMPL": "auto"},
-)
-
-config_setting(
- name = "pico_printf_pico_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_PRINTF_IMPL": "pico"},
-)
-
-config_setting(
- name = "pico_printf_compiler_enabled",
- flag_values = {"//bazel/config:PICO_DEFAULT_PRINTF_IMPL": "compiler"},
-)
-
-config_setting(
- name = "pico_async_context_poll_enabled",
- flag_values = {"//bazel/config:PICO_ASYNC_CONTEXT_IMPL": "poll"},
-)
-
-config_setting(
- name = "pico_async_context_threadsafe_background_enabled",
- flag_values = {"//bazel/config:PICO_ASYNC_CONTEXT_IMPL": "threadsafe_background"},
-)
-
-config_setting(
- name = "pico_async_context_freertos_enabled",
- flag_values = {"//bazel/config:PICO_ASYNC_CONTEXT_IMPL": "freertos"},
-)
-
-config_setting(
- name = "pico_use_default_max_page_size_enabled",
- flag_values = {"//bazel/config:PICO_USE_DEFAULT_MAX_PAGE_SIZE": "True"},
-)
-
-config_setting(
- name = "pico_no_target_name_enabled",
- flag_values = {"//bazel/config:PICO_NO_TARGET_NAME": "True"},
-)
-
-config_setting(
- name = "pico_clib_llvm_libc_enabled",
- flag_values = {"//bazel/config:PICO_CLIB": "llvm_libc"},
-)
-
-config_setting(
- name = "pico_clib_newlib_enabled",
- flag_values = {"//bazel/config:PICO_CLIB": "newlib"},
-)
-
-config_setting(
- name = "pico_clib_picolibc_enabled",
- flag_values = {"//bazel/config:PICO_CLIB": "picolibc"},
-)
-
-config_setting(
- name = "pico_bt_enable_ble_enabled",
- flag_values = {"//bazel/config:PICO_BT_ENABLE_BLE": "True"},
-)
-
-config_setting(
- name = "pico_bt_enable_classic_enabled",
- flag_values = {"//bazel/config:PICO_BT_ENABLE_CLASSIC": "True"},
-)
-
-config_setting(
- name = "pico_bt_enable_mesh_enabled",
- flag_values = {"//bazel/config:PICO_BT_ENABLE_MESH": "True"},
-)
-
-label_flag_matches(
- name = "pico_lwip_config_unset",
- flag = "//bazel/config:PICO_LWIP_CONFIG",
- value = "//bazel:empty_cc_lib",
-)
-
-label_flag_matches(
- name = "pico_btstack_config_unset",
- flag = "//bazel/config:PICO_BTSTACK_CONFIG",
- value = "//bazel:empty_cc_lib",
-)
-
-label_flag_matches(
- name = "pico_freertos_unset",
- flag = "//bazel/config:PICO_FREERTOS_LIB",
- value = "//bazel:empty_cc_lib",
-)
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
deleted file mode 100644
index 888f59c..0000000
--- a/bazel/defs.bzl
+++ /dev/null
@@ -1,117 +0,0 @@
-load("@bazel_skylib//rules:write_file.bzl", "write_file")
-load("@rules_cc//cc:defs.bzl", "cc_library")
-
-def _pico_generate_pio_header_impl(ctx):
- generated_headers = []
- for f in ctx.files.srcs:
- out = ctx.actions.declare_file(
- "{}_pio_generated/{}.h".format(ctx.label.name, f.basename),
- )
- generated_headers.append(out)
- ctx.actions.run(
- executable = ctx.executable._pioasm_tool,
- arguments = [
- "-o",
- "c-sdk",
- f.path,
- out.path,
- ],
- inputs = [f],
- outputs = [out],
- )
-
- cc_ctx = cc_common.create_compilation_context(
- headers = depset(direct = generated_headers),
- includes = depset(direct = [generated_headers[0].dirname]),
- )
- return [
- DefaultInfo(files = depset(direct = generated_headers)),
- CcInfo(compilation_context = cc_ctx),
- ]
-
-pico_generate_pio_header = rule(
- implementation = _pico_generate_pio_header_impl,
- doc = """Generates a .h header file for each listed pio source.
-
-Each source file listed in `srcs` will be available as `[pio file name].h` on
-the include path if you depend on this rule from a `cc_library`.
-
-pico_generate_pio_header(
- name = "my_fun_pio",
- srcs = ["my_fun_pio.pio"],
-)
-
-# This library can #include "my_fun_pio.pio.h".
-cc_library(
- name = "libfoo",
- deps = [":my_fun_pio"],
- srcs = ["libfoo.c"],
-)
-""",
- attrs = {
- "srcs": attr.label_list(mandatory = True, allow_files = True),
- "_pioasm_tool": attr.label(
- default = "@pico-sdk//tools/pioasm:pioasm",
- cfg = "exec",
- executable = True,
- ),
- },
- provides = [CcInfo],
-)
-
-# Because the syntax for target_compatible_with when used with config_setting
-# rules is both confusing and verbose, provide some helpers that make it much
-# easier and clearer to express compatibility.
-#
-# Context: https://github.com/bazelbuild/bazel/issues/12614
-
-def compatible_with_config(config_label):
- """Expresses compatibility with a config_setting."""
- return select({
- config_label: [],
- "//conditions:default": ["@platforms//:incompatible"],
- })
-
-def incompatible_with_config(config_label):
- """Expresses incompatibility with a config_setting."""
- return select({
- config_label: ["@platforms//:incompatible"],
- "//conditions:default": [],
- })
-
-def compatible_with_rp2():
- """Expresses a rule is compatible with the rp2 family."""
- return incompatible_with_config("//bazel/constraint:host")
-
-def compatible_with_pico_w():
- """Expresses a rule is compatible a Pico W."""
- return select({
- "@pico-sdk//bazel/constraint:cyw43_wireless": [],
- "@pico-sdk//bazel/constraint:is_pico_w": [],
- "@pico-sdk//bazel/constraint:is_pico2_w": [],
- "//conditions:default": ["@platforms//:incompatible"],
- })
-
-def pico_board_config(name, platform_includes, **kwargs):
- """A helper macro for declaring a Pico board to use with PICO_CONFIG_HEADER.
-
- This generates pico_config_platform_headers.h using the list of
- includes provided in `platform_includes`, and the final artifact is
- a cc_library that you can configure //bazel/config:PICO_CONFIG_HEADER to
- point to.
- """
- _hdr_dir = "{}_generated_includes".format(name)
- _hdr_path = "{}/pico_config_platform_headers.h".format(_hdr_dir)
- write_file(
- name = "{}_platform_headers_file".format(name),
- out = _hdr_path,
- content = ['#include "{}"'.format(inc) for inc in platform_includes],
- )
- kwargs.setdefault("hdrs", [])
- kwargs["hdrs"].append(_hdr_path)
- kwargs.setdefault("includes", [])
- kwargs["includes"].append(_hdr_dir)
- cc_library(
- name = name,
- **kwargs
- )
diff --git a/bazel/generate_version_header.py b/bazel/generate_version_header.py
deleted file mode 100644
index 79be833..0000000
--- a/bazel/generate_version_header.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python3
-"""Generate a version header for the Bazel build.
-
-Splits a semantic version string into major, minor, and patch and uses the
-provided template to produce a working version header.
-"""
-
-import argparse
-import re
-import sys
-
-
-def _parse_args():
- parser = argparse.ArgumentParser(
- description=__doc__,
- )
- parser.add_argument(
- "--version-string",
- required=True,
- help="SDK version string",
- )
- parser.add_argument(
- "--template",
- type=argparse.FileType("r"),
- required=True,
- help="Path to version.h.in",
- )
- parser.add_argument(
- "-o",
- "--output",
- type=argparse.FileType("wb"),
- default=sys.stdout.buffer,
- help="Output file path. Defaults to stdout.",
- )
- return parser.parse_args()
-
-
-_EXPANSION_REGEX = re.compile(r"(?:\$\{)([a-zA-Z]\w*)(?:\})")
-
-
-def generate_version_header(version_string, template, output):
- version_parts = version_string.split('.')
- defines = {
- "PICO_SDK_VERSION_MAJOR": version_parts[0],
- "PICO_SDK_VERSION_MINOR": version_parts[1],
- "PICO_SDK_VERSION_REVISION": version_parts[2].split('-')[0],
- "PICO_SDK_VERSION_STRING": version_string,
- }
- output.write(
- _EXPANSION_REGEX.sub(
- lambda val: str(defines.get(val.group(1))),
- template.read(),
- ).encode()
- )
-
-
-if __name__ == "__main__":
- sys.exit(generate_version_header(**vars(_parse_args())))
diff --git a/bazel/include/pico/config_autogen.h b/bazel/include/pico/config_autogen.h
deleted file mode 100644
index e1bd61e..0000000
--- a/bazel/include/pico/config_autogen.h
+++ /dev/null
@@ -1,12 +0,0 @@
-// Rather than auto-generating as part of the build, this header
-// is checked in directly.
-//
-// You can change what is included by configuring these `label_flag`s:
-// --@pico-sdk//bazel/config:PICO_CONFIG_EXTRA_HEADER=//my_proj:my_custom_headers
-// --@pico-sdk//bazel/config:PICO_CONFIG_PLATFORM_HEADER=//my_proj:my_custom_headers
-
-// This header must be provided by //bazel/config:PICO_CONFIG_EXTRA_HEADER:
-#include "pico_config_extra_headers.h"
-
-// This header must be provided by //bazel/config:PICO_CONFIG_PLATFORM_HEADER:
-#include "pico_config_platform_headers.h"
diff --git a/bazel/pico_btstack_make_gatt_header.bzl b/bazel/pico_btstack_make_gatt_header.bzl
deleted file mode 100644
index e9468fb..0000000
--- a/bazel/pico_btstack_make_gatt_header.bzl
+++ /dev/null
@@ -1,59 +0,0 @@
-load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cpp_toolchain", "use_cc_toolchain")
-
-def _pico_btstack_make_gatt_header_impl(ctx):
- cc_toolchain = find_cpp_toolchain(ctx)
- feature_configuration = cc_common.configure_features(
- ctx = ctx,
- cc_toolchain = cc_toolchain,
- requested_features = ctx.features,
- unsupported_features = ctx.disabled_features,
- )
-
- out = ctx.actions.declare_file(
- "{}_gatt_generated/{}.h".format(ctx.label.name, ctx.file.src.basename.removesuffix(".gatt")),
- )
-
- ctx.actions.run(
- executable = ctx.executable._make_gat_header_tool,
- arguments = [
- ctx.file.src.path,
- out.path,
- "-I",
- ctx.file._btstack_hdr.dirname,
- ] + [
-
- ],
- inputs = [
- ctx.file.src,
- ctx.file._btstack_hdr,
- ],
- outputs = [out],
- )
-
- cc_ctx = cc_common.create_compilation_context(
- headers = depset(direct = [out]),
- includes = depset(direct = [out.dirname]),
- )
-
- return [
- DefaultInfo(files = depset(direct = [out])),
- CcInfo(compilation_context = cc_ctx)
- ]
-
-pico_btstack_make_gatt_header = rule(
- implementation = _pico_btstack_make_gatt_header_impl,
- attrs = {
- "src": attr.label(mandatory = True, allow_single_file = True),
- "_btstack_hdr": attr.label(
- default = "@btstack//:src/bluetooth_gatt.h",
- allow_single_file = True,
- ),
- "_make_gat_header_tool": attr.label(
- default = "@btstack//:compile_gatt",
- cfg = "exec",
- executable = True,
- ),
- },
- fragments = ["cpp"],
- toolchains = use_cc_toolchain(),
-)
diff --git a/bazel/platform/BUILD.bazel b/bazel/platform/BUILD.bazel
deleted file mode 100644
index 39187b2..0000000
--- a/bazel/platform/BUILD.bazel
+++ /dev/null
@@ -1,17 +0,0 @@
-package(default_visibility = ["//visibility:public"])
-
-platform(
- name = "rp2040",
- constraint_values = [
- "@pico-sdk//bazel/constraint:rp2040",
- "@platforms//cpu:armv6-m",
- ],
-)
-
-platform(
- name = "rp2350",
- constraint_values = [
- "@pico-sdk//bazel/constraint:rp2350",
- "@platforms//cpu:armv8-m",
- ],
-)
diff --git a/bazel/toolchain/BUILD.bazel b/bazel/toolchain/BUILD.bazel
deleted file mode 100644
index bba5baa..0000000
--- a/bazel/toolchain/BUILD.bazel
+++ /dev/null
@@ -1,291 +0,0 @@
-load("@rules_cc//cc/toolchains:args.bzl", "cc_args")
-load("@rules_cc//cc/toolchains:args_list.bzl", "cc_args_list")
-load("@rules_cc//cc/toolchains:feature.bzl", "cc_feature")
-load("@rules_cc//cc/toolchains:toolchain.bzl", "cc_toolchain")
-load("configurable_feature.bzl", "configurable_toolchain_feature")
-
-package(default_visibility = ["//visibility:public"])
-
-cc_args(
- name = "armv6m-none-eabi",
- actions = [
- "@rules_cc//cc/toolchains/actions:compile_actions",
- "@rules_cc//cc/toolchains/actions:link_actions",
- ],
- args = ["--target=armv6m-none-eabi"],
-)
-
-cc_args(
- name = "armv8m.main-none-eabi",
- actions = [
- "@rules_cc//cc/toolchains/actions:compile_actions",
- "@rules_cc//cc/toolchains/actions:link_actions",
- ],
- args = ["--target=armv8m.main-none-eabi"],
-)
-
-cc_args(
- name = "cortex-m0",
- actions = [
- "@rules_cc//cc/toolchains/actions:compile_actions",
- "@rules_cc//cc/toolchains/actions:link_actions",
- ],
- args = [
- "-mcpu=cortex-m0plus",
- "-mthumb",
- ],
-)
-
-cc_args(
- name = "cortex-m33",
- actions = [
- "@rules_cc//cc/toolchains/actions:compile_actions",
- "@rules_cc//cc/toolchains/actions:link_actions",
- ],
- args = [
- "-mcpu=cortex-m33",
- "-march=armv8-m.main+fp+dsp",
- "-mfloat-abi=softfp",
- "-mthumb",
- "-mcmse",
- ],
-)
-
-# :no_canonical_system_headers and :no_canonical_prefixes both prevent built-in
-# compiler include directories from resolving to absolute paths. Prefer to use
-# :bazel_no_absolute_paths, since it correctly guides based on the current
-# compiler type.
-cc_args(
- name = "no_canonical_system_headers",
- actions = ["@rules_cc//cc/toolchains/actions:compile_actions"],
- args = ["-fno-canonical-system-headers"],
-)
-
-cc_args(
- name = "no_canonical_prefixes",
- actions = ["@rules_cc//cc/toolchains/actions:compile_actions"],
- args = ["-no-canonical-prefixes"],
-)
-
-cc_args_list(
- name = "bazel_no_absolute_paths",
- args = select({
- "//bazel/constraint:pico_toolchain_clang_enabled": [],
- "//conditions:default": [":no_canonical_system_headers"],
- }) + [":no_canonical_prefixes"],
-)
-
-cc_args(
- name = "llvm-libc_args",
- actions = ["@rules_cc//cc/toolchains/actions:link_actions"],
- args = [
- "-nostdlib++",
- "-nostartfiles",
- "-Wl,-lc++",
- ],
- visibility = ["//visibility:private"],
-)
-
-cc_args(
- name = "opt_debug_args",
- actions = [
- "@rules_cc//cc/toolchains/actions:compile_actions",
- "@rules_cc//cc/toolchains/actions:link_actions",
- ],
- args = [
- "-Og", # TODO: Make this configurable.
- "-g3",
- ],
-)
-
-configurable_toolchain_feature(
- name = "gc_sections",
- copts = [
- "-ffunction-sections",
- "-fdata-sections",
- ],
- linkopts = ["-Wl,--gc-sections"],
-)
-
-configurable_toolchain_feature(
- name = "cxx_no_exceptions",
- cxxopts = [
- "-fno-exceptions",
- "-fno-unwind-tables",
- ],
-)
-
-configurable_toolchain_feature(
- name = "cxx_no_rtti",
- cxxopts = ["-fno-rtti"],
-)
-
-configurable_toolchain_feature(
- name = "cxx_no_cxa_atexit",
- cxxopts = ["-fno-use-cxa-atexit"],
-)
-
-configurable_toolchain_feature(
- name = "override_max_page_size",
- linkopts = ["-Wl,-z,max-page-size=4096"],
-)
-
-# TODO: Make this shim unnecessary.
-cc_args_list(
- name = "all_opt_debug_args",
- args = [":opt_debug_args"],
-)
-
-cc_feature(
- name = "override_debug",
- args = [":all_opt_debug_args"],
- overrides = "@rules_cc//cc/toolchains/features:dbg",
-)
-
-HOSTS = (
- ("linux", "x86_64"),
- ("linux", "aarch64"),
- ("win", "x86_64"),
- ("mac", "x86_64"),
- ("mac", "aarch64"),
-)
-
-_HOST_OS_CONSTRAINTS = {
- "linux": "@platforms//os:linux",
- "win": "@platforms//os:windows",
- "mac": "@platforms//os:macos",
-}
-
-_HOST_CPU_CONSTRAINTS = {
- "x86_64": "@platforms//cpu:x86_64",
- "aarch64": "@platforms//cpu:aarch64",
-}
-
-[cc_toolchain(
- name = "arm_gcc_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
- tool_map = "@arm_gcc_{}-{}//:all_tools".format(host_os, host_cpu),
- args = select({
- "//bazel/constraint:rp2040": [":cortex-m0"],
- "//bazel/constraint:rp2350": [":cortex-m33"],
- "//conditions:default": [],
- }) + [
- ":bazel_no_absolute_paths",
- ],
- exec_compatible_with = [
- _HOST_CPU_CONSTRAINTS[host_cpu],
- _HOST_OS_CONSTRAINTS[host_os],
- ],
- tags = ["manual"], # Don't try to build this in wildcard builds.
- known_features = [
- "@rules_cc//cc/toolchains/args:experimental_replace_legacy_action_config_features",
- "@pico-sdk//bazel/toolchain:override_debug",
- "@pico-sdk//bazel/toolchain:gc_sections",
- "@pico-sdk//bazel/toolchain:cxx_no_exceptions",
- "@pico-sdk//bazel/toolchain:cxx_no_rtti",
- "@pico-sdk//bazel/toolchain:cxx_no_cxa_atexit",
- "@pico-sdk//bazel/toolchain:override_max_page_size",
- ],
- enabled_features = [
- "@rules_cc//cc/toolchains/args:experimental_replace_legacy_action_config_features",
- "@pico-sdk//bazel/toolchain:override_debug",
- ] + select({
- "//bazel/constraint:pico_no_gc_sections_enabled": [],
- "//conditions:default": [":gc_sections"],
- }) + select({
- "//bazel/constraint:pico_cxx_enable_exceptions_enabled": [],
- "//conditions:default": [":cxx_no_exceptions"],
- }) + select({
- "//bazel/constraint:pico_cxx_enable_rtti_enabled": [],
- "//conditions:default": [":cxx_no_rtti"],
- }) + select({
- "//bazel/constraint:pico_cxx_enable_cxa_atexit_enabled": [],
- "//conditions:default": [":cxx_no_cxa_atexit"],
- }) + select({
- "//bazel/constraint:pico_use_default_max_page_size_enabled": [],
- "//conditions:default": [":override_max_page_size"],
- }),
-) for host_os, host_cpu in HOSTS]
-
-[cc_toolchain(
- name = "clang_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
- tool_map = "@clang_{}-{}//:all_tools".format(host_os, host_cpu),
- args = select({
- "//bazel/constraint:rp2040": [
- ":armv6m-none-eabi",
- ":cortex-m0",
- ],
- "//bazel/constraint:rp2350": [
- ":armv8m.main-none-eabi",
- ":cortex-m33",
- ],
- "//conditions:default": [],
- }) + [
- ":bazel_no_absolute_paths",
- ":llvm-libc_args",
- ],
- exec_compatible_with = [
- _HOST_CPU_CONSTRAINTS[host_cpu],
- _HOST_OS_CONSTRAINTS[host_os],
- ],
- tags = ["manual"], # Don't try to build this in wildcard builds.
- known_features = [
- "@rules_cc//cc/toolchains/args:experimental_replace_legacy_action_config_features",
- "@pico-sdk//bazel/toolchain:override_debug",
- "@pico-sdk//bazel/toolchain:gc_sections",
- "@pico-sdk//bazel/toolchain:cxx_no_exceptions",
- "@pico-sdk//bazel/toolchain:cxx_no_rtti",
- "@pico-sdk//bazel/toolchain:cxx_no_cxa_atexit",
- "@pico-sdk//bazel/toolchain:override_max_page_size",
- ],
- enabled_features = [
- "@rules_cc//cc/toolchains/args:experimental_replace_legacy_action_config_features",
- "@pico-sdk//bazel/toolchain:override_debug",
- ] + select({
- "//bazel/constraint:pico_no_gc_sections_enabled": [],
- "//conditions:default": [":gc_sections"],
- }) + select({
- "//bazel/constraint:pico_cxx_enable_exceptions_enabled": [],
- "//conditions:default": [":cxx_no_exceptions"],
- }) + select({
- "//bazel/constraint:pico_cxx_enable_rtti_enabled": [],
- "//conditions:default": [":cxx_no_rtti"],
- }) + select({
- "//bazel/constraint:pico_cxx_enable_cxa_atexit_enabled": [],
- "//conditions:default": [":cxx_no_cxa_atexit"],
- }) + select({
- "//bazel/constraint:pico_use_default_max_page_size_enabled": [],
- "//conditions:default": [":override_max_page_size"],
- }),
-) for host_os, host_cpu in HOSTS]
-
-[toolchain(
- name = "{}-{}-rp2040".format(host_os, host_cpu),
- exec_compatible_with = [
- _HOST_CPU_CONSTRAINTS[host_cpu],
- _HOST_OS_CONSTRAINTS[host_os],
- ],
- target_compatible_with = [
- "@pico-sdk//bazel/constraint:rp2040",
- ],
- toolchain = select({
- "//bazel/constraint:pico_toolchain_clang_enabled": "clang_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
- "//conditions:default": ":arm_gcc_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
- }),
- toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
-) for host_os, host_cpu in HOSTS]
-
-[toolchain(
- name = "{}-{}-rp2350".format(host_os, host_cpu),
- exec_compatible_with = [
- _HOST_CPU_CONSTRAINTS[host_cpu],
- _HOST_OS_CONSTRAINTS[host_os],
- ],
- target_compatible_with = [
- "@pico-sdk//bazel/constraint:rp2350",
- ],
- toolchain = select({
- "//bazel/constraint:pico_toolchain_clang_enabled": "clang_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
- "//conditions:default": ":arm_gcc_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
- }),
- toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
-) for host_os, host_cpu in HOSTS]
diff --git a/bazel/toolchain/clang.BUILD b/bazel/toolchain/clang.BUILD
deleted file mode 100644
index ef9344f..0000000
--- a/bazel/toolchain/clang.BUILD
+++ /dev/null
@@ -1,152 +0,0 @@
-load("@bazel_skylib//rules/directory:directory.bzl", "directory")
-load("@bazel_skylib//rules/directory:subdirectory.bzl", "subdirectory")
-load("@rules_cc//cc/toolchains:tool.bzl", "cc_tool")
-load("@rules_cc//cc/toolchains:tool_map.bzl", "cc_tool_map")
-load("@rules_cc//cc/toolchains:args.bzl", "cc_args")
-load("@rules_cc//cc/toolchains:args_list.bzl", "cc_args_list")
-
-package(default_visibility = ["//visibility:public"])
-
-licenses(["notice"])
-
-# Directory-based rules in this toolchain only referece things in
-# lib/ or include/ subdirectories.
-directory(
- name = "toolchain_root",
- srcs = glob([
- "lib/**",
- "include/**",
- ]),
-)
-
-cc_tool_map(
- name = "all_tools",
- tools = {
- "@rules_cc//cc/toolchains/actions:assembly_actions": ":asm",
- "@rules_cc//cc/toolchains/actions:c_compile": ":clang",
- "@rules_cc//cc/toolchains/actions:cpp_compile_actions": ":clang++",
- "@rules_cc//cc/toolchains/actions:link_actions": ":lld",
- "@rules_cc//cc/toolchains/actions:objcopy_embed_data": ":llvm-objcopy",
- "@rules_cc//cc/toolchains/actions:strip": ":llvm-strip",
- "@rules_cc//cc/toolchains/actions:ar_actions": ":llvm-ar",
- },
-)
-
-# TODO: https://github.com/bazelbuild/rules_cc/issues/235 - Workaround until
-# Bazel has a more robust way to implement `cc_tool_map`.
-alias(
- name = "asm",
- actual = ":clang",
-)
-
-cc_tool(
- name = "clang",
- src = select({
- "@platforms//os:windows": "//:bin/clang.exe",
- "//conditions:default": "//:bin/clang",
- }),
- data = glob([
- "bin/llvm",
- "lib/clang/*/include/**",
- "include/armv*-unknown-none-eabi/**",
- ]),
-)
-
-cc_tool(
- name = "clang++",
- src = select({
- "@platforms//os:windows": "//:bin/clang++.exe",
- "//conditions:default": "//:bin/clang++",
- }),
- data = glob([
- "bin/llvm",
- "lib/clang/*/include/**",
- "include/armv*-unknown-none-eabi/**",
- "include/c++/v1/**",
- ]),
-)
-
-cc_tool(
- name = "lld",
- src = select({
- "@platforms//os:windows": "//:bin/clang++.exe",
- "//conditions:default": "//:bin/clang++",
- }),
- data = glob([
- "bin/llvm",
- "bin/lld*",
- "bin/ld*",
- "lib/**/*.a",
- "lib/**/*.so*",
- "lib/**/*.o",
- "lib/armv*-unknown-none-eabi/**",
- "lib/clang/*/lib/armv*-unknown-none-eabi/**",
- ]),
-)
-
-cc_tool(
- name = "llvm-ar",
- src = select({
- "@platforms//os:windows": "//:bin/llvm-ar.exe",
- "//conditions:default": "//:bin/llvm-ar",
- }),
- data = glob(["bin/llvm"]),
-)
-
-cc_tool(
- name = "llvm-libtool-darwin",
- src = select({
- "@platforms//os:windows": "//:bin/llvm-libtool-darwin.exe",
- "//conditions:default": "//:bin/llvm-libtool-darwin",
- }),
- data = glob(["bin/llvm"]),
-)
-
-cc_tool(
- name = "llvm-objcopy",
- src = select({
- "@platforms//os:windows": "//:bin/llvm-objcopy.exe",
- "//conditions:default": "//:bin/llvm-objcopy",
- }),
- data = glob(["bin/llvm"]),
-)
-
-cc_tool(
- name = "llvm-objdump",
- src = select({
- "@platforms//os:windows": "//:bin/llvm-objdump.exe",
- "//conditions:default": "//:bin/llvm-objdump",
- }),
- data = glob(["bin/llvm"]),
-)
-
-cc_tool(
- name = "llvm-cov",
- src = select({
- "@platforms//os:windows": "//:bin/llvm-cov.exe",
- "//conditions:default": "//:bin/llvm-cov",
- }),
- data = glob(["bin/llvm"]),
-)
-
-cc_tool(
- name = "llvm-strip",
- src = select({
- "@platforms//os:windows": "//:bin/llvm-strip.exe",
- "//conditions:default": "//:bin/llvm-strip",
- }),
- data = glob(["bin/llvm"]),
-)
-
-cc_tool(
- name = "clang-tidy",
- src = select({
- "@platforms//os:windows": "//:bin/clang-tidy.exe",
- "//conditions:default": "//:bin/clang-tidy",
- }),
- data = glob([
- "bin/llvm",
- "include/**",
- "lib/clang/**/include/**",
- ]),
-)
diff --git a/bazel/toolchain/configurable_feature.bzl b/bazel/toolchain/configurable_feature.bzl
deleted file mode 100644
index 98f9d8a..0000000
--- a/bazel/toolchain/configurable_feature.bzl
+++ /dev/null
@@ -1,42 +0,0 @@
-load("@rules_cc//cc/toolchains:args.bzl", "cc_args")
-load("@rules_cc//cc/toolchains:args_list.bzl", "cc_args_list")
-load("@rules_cc//cc/toolchains:feature.bzl", "cc_feature")
-
-def configurable_toolchain_feature(name, copts = [], cxxopts = [], linkopts = []):
-
- all_args = []
-
- if copts:
- cc_args(
- name = name + "_cc_args",
- actions = ["@rules_cc//cc/toolchains/actions:compile_actions"],
- args = copts,
- )
- all_args.append(name + "_cc_args")
-
- if cxxopts:
- cc_args(
- name = name + "_cxx_args",
- actions = ["@rules_cc//cc/toolchains/actions:cpp_compile_actions"],
- args = cxxopts,
- )
- all_args.append(name + "_cxx_args")
-
- if linkopts:
- cc_args(
- name = name + "_link_args",
- actions = ["@rules_cc//cc/toolchains/actions:link_actions"],
- args = linkopts,
- )
- all_args.append(name + "_link_args")
-
- cc_args_list(
- name = name + "_args",
- args = all_args,
- )
-
- cc_feature(
- name = name,
- feature_name = name,
- args = [":{}_args".format(name)],
- )
diff --git a/bazel/toolchain/gcc_arm_none_eabi.BUILD b/bazel/toolchain/gcc_arm_none_eabi.BUILD
deleted file mode 100644
index d5b8a04..0000000
--- a/bazel/toolchain/gcc_arm_none_eabi.BUILD
+++ /dev/null
@@ -1,131 +0,0 @@
-load("@bazel_skylib//rules/directory:directory.bzl", "directory")
-load("@bazel_skylib//rules/directory:subdirectory.bzl", "subdirectory")
-load("@rules_cc//cc/toolchains:tool.bzl", "cc_tool")
-load("@rules_cc//cc/toolchains:tool_map.bzl", "cc_tool_map")
-load("@rules_cc//cc/toolchains:args.bzl", "cc_args")
-load("@rules_cc//cc/toolchains:args_list.bzl", "cc_args_list")
-
-
-package(default_visibility = ["//visibility:public"])
-
-cc_tool_map(
- name = "all_tools",
- tools = {
- "@rules_cc//cc/toolchains/actions:assembly_actions": ":asm",
- "@rules_cc//cc/toolchains/actions:c_compile": ":arm-none-eabi-gcc",
- "@rules_cc//cc/toolchains/actions:cpp_compile_actions": ":arm-none-eabi-g++",
- "@rules_cc//cc/toolchains/actions:link_actions": ":arm-none-eabi-ld",
- "@rules_cc//cc/toolchains/actions:objcopy_embed_data": ":arm-none-eabi-objcopy",
- "@rules_cc//cc/toolchains/actions:strip": ":arm-none-eabi-strip",
- "@rules_cc//cc/toolchains/actions:ar_actions": ":arm-none-eabi-ar",
- },
-)
-
-# TODO: https://github.com/bazelbuild/rules_cc/issues/235 - Workaround until
-# Bazel has a more robust way to implement `cc_tool_map`.
-alias(
- name = "asm",
- actual = ":arm-none-eabi-gcc",
-)
-
-cc_tool(
- name = "arm-none-eabi-ar",
- src = select({
- "@platforms//os:windows": "//:bin/arm-none-eabi-ar.exe",
- "//conditions:default": "//:bin/arm-none-eabi-ar",
- }),
-)
-
-cc_tool(
- name = "arm-none-eabi-g++",
- src = select({
- "@platforms//os:windows": "//:bin/arm-none-eabi-g++.exe",
- "//conditions:default": "//:bin/arm-none-eabi-g++",
- }),
- data = glob([
- "**/*.spec",
- "**/*.specs",
- "arm-none-eabi/include/**",
- "lib/gcc/arm-none-eabi/*/include/**",
- "lib/gcc/arm-none-eabi/*/include-fixed/**",
- "libexec/**",
- ]),
-)
-
-cc_tool(
- name = "arm-none-eabi-gcc",
- src = select({
- "@platforms//os:windows": "//:bin/arm-none-eabi-gcc.exe",
- "//conditions:default": "//:bin/arm-none-eabi-gcc",
- }),
- data = glob([
- "**/*.spec",
- "**/*.specs",
- "arm-none-eabi/include/**",
- "lib/gcc/arm-none-eabi/*/include/**",
- "lib/gcc/arm-none-eabi/*/include-fixed/**",
- "libexec/**",
- ]) +
- # The assembler needs to be explicitly added. Note that the path is
- # intentionally different here as `as` is called from arm-none-eabi-gcc.
- # `arm-none-eabi-as` will not suffice for this context.
- select({
- "@platforms//os:windows": ["//:arm-none-eabi/bin/as.exe"],
- "//conditions:default": ["//:arm-none-eabi/bin/as"],
- }),
-)
-
-# This tool is actually just g++ under the hood, but this specifies a
-# different set of data files to pull into the sandbox at runtime.
-cc_tool(
- name = "arm-none-eabi-ld",
- src = select({
- "@platforms//os:windows": "//:bin/arm-none-eabi-g++.exe",
- "//conditions:default": "//:bin/arm-none-eabi-g++",
- }),
- data = glob([
- "**/*.a",
- "**/*.ld",
- "**/*.o",
- "**/*.spec",
- "**/*.specs",
- "**/*.so",
- "libexec/**",
- ]),
-)
-
-cc_tool(
- name = "arm-none-eabi-objcopy",
- src = select({
- "@platforms//os:windows": "//:bin/arm-none-eabi-objcopy.exe",
- "//conditions:default": "//:bin/arm-none-eabi-objcopy",
- }),
-)
-
-cc_tool(
- name = "arm-none-eabi-strip",
- src = select({
- "@platforms//os:windows": "//:bin/arm-none-eabi-strip.exe",
- "//conditions:default": "//:bin/arm-none-eabi-strip",
- }),
-)
-
-cc_tool(
- name = "arm-none-eabi-objdump",
- src = select({
- "@platforms//os:windows": "//:bin/arm-none-eabi-objdump.exe",
- "//conditions:default": "//:bin/arm-none-eabi-objdump",
- }),
-)
-
-# There is not yet a well-known action type for objdump.
-
-cc_tool(
- name = "arm-none-eabi-gcov",
- src = select({
- "@platforms//os:windows": "//:bin/arm-none-eabi-gcov.exe",
- "//conditions:default": "//:bin/arm-none-eabi-gcov",
- }),
-)
-
-# There is not yet a well-known action type for gcov.
diff --git a/bazel/toolchain/objcopy.bzl b/bazel/toolchain/objcopy.bzl
deleted file mode 100644
index c1ba06a..0000000
--- a/bazel/toolchain/objcopy.bzl
+++ /dev/null
@@ -1,46 +0,0 @@
-load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "OBJ_COPY_ACTION_NAME")
-load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cpp_toolchain", "use_cc_toolchain")
-
-def _objcopy_to_bin_impl(ctx):
- cc_toolchain = find_cpp_toolchain(ctx)
- feature_configuration = cc_common.configure_features(
- ctx = ctx,
- cc_toolchain = cc_toolchain,
- requested_features = ctx.features,
- unsupported_features = ctx.disabled_features,
- )
- objcopy_tool_path = cc_common.get_tool_for_action(
- feature_configuration = feature_configuration,
- action_name = OBJ_COPY_ACTION_NAME,
- )
-
- ctx.actions.run(
- inputs = depset(
- direct = [ctx.file.src],
- transitive = [cc_toolchain.all_files],
- ),
- executable = objcopy_tool_path,
- outputs = [ctx.outputs.out],
- arguments = [
- ctx.file.src.path,
- "-Obinary",
- ctx.outputs.out.path,
- ],
- )
-
-objcopy_to_bin = rule(
- implementation = _objcopy_to_bin_impl,
- attrs = {
- "src": attr.label(
- allow_single_file = True,
- mandatory = True,
- doc = "File to use as input to objcopy command",
- ),
- "out": attr.output(
- mandatory = True,
- doc = "Destination file for objcopy command",
- ),
- },
- fragments = ["cpp"],
- toolchains = use_cc_toolchain(),
-)
diff --git a/bazel/util/BUILD.bazel b/bazel/util/BUILD.bazel
deleted file mode 100644
index ffd0fb0..0000000
--- a/bazel/util/BUILD.bazel
+++ /dev/null
@@ -1 +0,0 @@
-package(default_visibility = ["//visibility:public"])
diff --git a/bazel/util/label_flag_matches.bzl b/bazel/util/label_flag_matches.bzl
deleted file mode 100644
index a837584..0000000
--- a/bazel/util/label_flag_matches.bzl
+++ /dev/null
@@ -1,37 +0,0 @@
-"""A wrapper that enables a `config_setting` matcher for label_flag flags."""
-
-load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
-load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
-
-def _match_label_flag_impl(ctx):
- matches = str(ctx.attr.expected_value.label) == str(ctx.attr.flag.label)
- return [
- config_common.FeatureFlagInfo(value = str(matches)),
- BuildSettingInfo(value = matches),
- ]
-
-_match_label_flag = rule(
- implementation = _match_label_flag_impl,
- attrs = {
- "expected_value": attr.label(
- mandatory = True,
- doc = "The expected flag value",
- ),
- "flag": attr.label(
- mandatory = True,
- doc = "The flag to extract a value from",
- ),
- },
-)
-
-def label_flag_matches(*, name, flag, value):
- _match_label_flag(
- name = name + "._impl",
- expected_value = native.package_relative_label(value),
- flag = flag,
- )
-
- native.config_setting(
- name = name,
- flag_values = {":{}".format(name + "._impl"): "True"},
- )
diff --git a/bazel/util/multiple_choice_flag.bzl b/bazel/util/multiple_choice_flag.bzl
deleted file mode 100644
index 1806e40..0000000
--- a/bazel/util/multiple_choice_flag.bzl
+++ /dev/null
@@ -1,38 +0,0 @@
-def declare_flag_choices(flag, choices):
- """Declares a `config_setting` for each known choice for the provided flag.
-
- The name of each config setting uses the name of the `config_setting` is:
- [flag label name]_[choice]
-
- This can be used with select_choice() to map `config_setting`s to values.
-
- Args:
- flag: The flag that guides the declared `config_setting`s.
- pkg: The package that declare_flag_choices() was declared in.
- choice_map: A mapping of distinct choices to
- """
- flag_name = flag.split(":")[1]
- [
- native.config_setting(
- name = "{}_{}".format(flag_name, choice),
- flag_values = {flag: choice},
- )
- for choice in choices
- ]
-
-def flag_choice(flag, pkg, choice_map):
- """Creates a `select()` based on choices declared by `declare_choices()`.
-
- Args:
- flag: The flag that guides the select.
- pkg: The package that `declare_flag_choices()` was called in.
- choice_map: A mapping of distinct choices to the final intended value.
- """
- return {
- "{}:{}_{}".format(
- pkg.split(":")[0],
- flag.split(":")[1],
- choice,
- ): val
- for choice, val in choice_map.items()
- }
diff --git a/bazel/util/sdk_define.bzl b/bazel/util/sdk_define.bzl
deleted file mode 100644
index cd9b499..0000000
--- a/bazel/util/sdk_define.bzl
+++ /dev/null
@@ -1,43 +0,0 @@
-load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
-
-def _pico_sdk_define_impl(ctx):
- val = ctx.attr.from_flag[BuildSettingInfo].value
-
- if type(val) == "string":
- # Strings need quotes.
- val = "\"{}\"".format(val)
- elif type(val) == "bool":
- # Convert bools to 0 or 1.
- val = 1 if val else 0
- cc_ctx = cc_common.create_compilation_context(
- defines = depset(
- direct = ["{}={}".format(ctx.attr.define_name, val)],
- ),
- )
- return [CcInfo(compilation_context = cc_ctx)]
-
-pico_sdk_define = rule(
- implementation = _pico_sdk_define_impl,
- doc = """A simple rule that offers a skylib flag as a define.
-
-These can be listed in the `deps` attribute of a `cc_library` to get access
-to the value of a define.
-
-Example:
-
- bool_flag(
- name = "my_flag",
- build_setting_default = False,
- )
-
- pico_sdk_define(
- name = "flag_define",
- define_name = "MY_FLAG_DEFINE",
- from_flag = ":my_flag",
- )
-""",
- attrs = {
- "define_name": attr.string(mandatory = True),
- "from_flag": attr.label(mandatory = True),
- },
-)
diff --git a/bazel/util/transition.bzl b/bazel/util/transition.bzl
deleted file mode 100644
index 67f0d61..0000000
--- a/bazel/util/transition.bzl
+++ /dev/null
@@ -1,167 +0,0 @@
-def _normalize_flag_value(val):
- """Converts flag values to transition-safe primitives."""
- if type(val) == "label":
- return str(val)
- return val
-
-def declare_transtion(attrs, flag_overrides = None, append_to_flags = None, executable = True):
- """A helper that drastically simplifies declaration of a transition.
-
- A transition in Bazel is a way to force changes to the way the build is
- evaluated for all dependencies of a given rule.
-
- Imagine the following simple dependency graph:
-
- ->: depends on
- a -> b -> c
-
- Normally, if you set `defines` on a, they couldn't apply to b or c because
- they are dependencies of a. There's no way for b or c to know about a's
- settings, because they don't even know a exists!
-
- We can fix this via a transition! If we put a transition in front of `a`
- that sets --copts=-DFOO=42, we're telling Bazel to build a and all of its
- dependencies under that configuration.
-
- Note: Flags must be referenced as e.g. `//command_line_option:copt` in
- transitions.
-
- `declare_transition()` eliminates the frustrating amount of boilerplate. All
- you need to do is provide a set of attrs, and then a `flag_overrides`
- dictionary that tells `declare_transition()` which attrs to pull flag values
- from. The common `src` attr tells the transition which build rule to apply
- the transition to.
- """
-
- def _flag_override_impl(settings, attrs):
- final_overrides = {}
- if flag_overrides != None:
- final_overrides = {
- key: _normalize_flag_value(getattr(attrs, value))
- for key, value in flag_overrides.items()
- }
- if append_to_flags != None:
- for flag, field in append_to_flags.items():
- accumulated_flags = final_overrides.get(flag, settings.get(flag, []))
- accumulated_flags.extend(
- [str(val) for val in getattr(attrs, field)],
- )
- final_overrides[flag] = accumulated_flags
- return final_overrides
-
- output_flags = []
- if flag_overrides != None:
- output_flags.extend(flag_overrides.keys())
- if append_to_flags != None:
- output_flags.extend(append_to_flags.keys())
- _transition = transition(
- implementation = _flag_override_impl,
- inputs = append_to_flags.keys() if append_to_flags != None else [],
- outputs = output_flags,
- )
-
- def _symlink_artifact_impl(ctx):
- out = ctx.actions.declare_file(ctx.label.name)
- if executable:
- ctx.actions.symlink(output = out, target_file = ctx.executable.src)
- return [DefaultInfo(files = depset([out]), executable = out)]
-
- ctx.actions.symlink(
- output = out,
- target_file = ctx.attr.src[0][DefaultInfo].files.to_list()[0],
- )
- return [DefaultInfo(files = depset([out]))]
-
- return rule(
- implementation = _symlink_artifact_impl,
- executable = executable,
- attrs = {
- "src": attr.label(
- cfg = _transition,
- executable = executable,
- mandatory = True,
- ),
- } | attrs,
- )
-
-# This transition is applied before building the boot_stage2 image.
-rp2040_bootloader_binary = declare_transtion(
- attrs = {
- "_malloc": attr.label(default = "//bazel:empty_cc_lib"),
- # This could be shared, but we don't in order to make it clearer that
- # a transition is in use.
- "_allowlist_function_transition": attr.label(
- default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
- ),
- "_link_extra_libs": attr.label(default = "//bazel:empty_cc_lib"),
- },
- flag_overrides = {
- # We don't want --custom_malloc to ever apply to the bootloader, so
- # always explicitly override it here.
- "//command_line_option:custom_malloc": "_malloc",
-
- # Platforms will commonly depend on bootloader components in every
- # binary via `link_extra_libs`, so we must drop these deps when
- # building the bootloader binaries themselves in order to avoid a
- # circular dependency.
- "@bazel_tools//tools/cpp:link_extra_libs": "_link_extra_libs",
- },
-)
-
-# This transition sets SDK configuration options required to build test binaries
-# for the kitchen_sink suite of tests.
-kitchen_sink_test_binary = declare_transtion(
- attrs = {
- "bt_stack_config": attr.label(mandatory = True),
- "lwip_config": attr.label(mandatory = True),
- "enable_ble": attr.bool(default = False),
- "enable_bt_classic": attr.bool(default = False),
- # This could be shared, but we don't in order to make it clearer that
- # a transition is in use.
- "_allowlist_function_transition": attr.label(
- default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
- ),
- },
- flag_overrides = {
- "@pico-sdk//bazel/config:PICO_BTSTACK_CONFIG": "bt_stack_config",
- "@pico-sdk//bazel/config:PICO_LWIP_CONFIG": "lwip_config",
- "@pico-sdk//bazel/config:PICO_BT_ENABLE_BLE": "enable_ble",
- "@pico-sdk//bazel/config:PICO_BT_ENABLE_CLASSIC": "enable_bt_classic",
- },
-)
-
-# This transition sets SDK configuration options required to build test binaries
-# for the pico_float_test suite of tests.
-pico_float_test_binary = declare_transtion(
- attrs = {
- "pico_printf_impl": attr.string(),
- "extra_copts": attr.string_list(),
- # This could be shared, but we don't in order to make it clearer that
- # a transition is in use.
- "_allowlist_function_transition": attr.label(
- default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
- ),
- },
- flag_overrides = {
- "@pico-sdk//bazel/config:PICO_DEFAULT_PRINTF_IMPL": "pico_printf_impl",
- },
- append_to_flags = {
- "//command_line_option:copt": "extra_copts",
- },
-)
-
-# This is a general purpose transition that applies the listed copt flags to
-# all transitive dependencies.
-extra_copts_for_all_deps = declare_transtion(
- attrs = {
- "extra_copts": attr.string_list(),
- # This could be shared, but we don't in order to make it clearer that
- # a transition is in use.
- "_allowlist_function_transition": attr.label(
- default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
- ),
- },
- append_to_flags = {
- "//command_line_option:copt": "extra_copts",
- },
-)
diff --git a/cmake/Platform/PICO.cmake b/cmake/Platform/PICO.cmake
index c21714b..06388b5 100644
--- a/cmake/Platform/PICO.cmake
+++ b/cmake/Platform/PICO.cmake
@@ -1,11 +1,4 @@
# this is included because toolchain file sets SYSTEM_NAME=PICO
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
-set(CMAKE_EXECUTABLE_SUFFIX .elf)
-
-# include paths to find installed tools
-if(CMAKE_HOST_WIN32)
- include(Platform/WindowsPaths)
-else()
- include(Platform/UnixPaths)
-endif()
+set(CMAKE_EXECUTABLE_SUFFIX .elf)
\ No newline at end of file
diff --git a/cmake/generic_board.cmake b/cmake/generic_board.cmake
deleted file mode 100644
index c7fdfe5..0000000
--- a/cmake/generic_board.cmake
+++ /dev/null
@@ -1,41 +0,0 @@
-# For boards without their own cmake file, we look for a header file
-cmake_minimum_required(VERSION 3.15)
-
-# PICO_CMAKE_CONFIG: PICO_BOARD_HEADER_DIRS, List of directories to look for .h in. This may be specified the user environment, type=list, group=build
-if (DEFINED ENV{PICO_BOARD_HEADER_DIRS})
- set(PICO_BOARD_HEADER_DIRS $ENV{PICO_BOARD_HEADER_DIRS})
- message("Using PICO_BOARD_HEADER_DIRS from environment ('${PICO_BOARD_HEADER_DIRS}')")
-endif()
-set(PICO_BOARD_HEADER_DIRS ${PICO_BOARD_HEADER_DIRS} CACHE STRING "PICO board header directories" FORCE)
-
-list(APPEND PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR}/../src/boards/include/boards)
-pico_find_in_paths(PICO_BOARD_HEADER_FILE PICO_BOARD_HEADER_DIRS ${PICO_BOARD}.h)
-
-if (EXISTS ${PICO_BOARD_HEADER_FILE})
- message("Using board configuration from ${PICO_BOARD_HEADER_FILE}")
- list(APPEND PICO_CONFIG_HEADER_FILES ${PICO_BOARD_HEADER_FILE})
-
- # we parse the header file to configure the defaults
- file(STRINGS ${PICO_BOARD_HEADER_FILE} HEADER_FILE_CONTENTS)
-
- while(HEADER_FILE_CONTENTS)
- list(POP_FRONT HEADER_FILE_CONTENTS LINE)
- if (LINE MATCHES "^[ \t\]*//[ \t\]*pico_cmake_set[ \t\]*([a-zA-Z_][a-zA-Z0-9_]*)[ \t\]*=[ \t\]*(.*)")
- set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
- endif()
- if (LINE MATCHES "^[ \t\]*//[ \t\]*pico_cmake_set_default[ \t\]*([a-zA-Z_][a-zA-Z0-9_]*)[ \t\]*=[ \t\]*(.*)")
- if (NOT DEFINED "${CMAKE_MATCH_1}")
- set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
- else()
- list(APPEND PICO_BOARD_CMAKE_OVERRIDES ${CMAKE_MATCH_1})
- endif()
- endif()
- endwhile()
-else()
- set(msg "Unable to find definition of board '${PICO_BOARD}' (specified by PICO_BOARD):\n")
- list(JOIN PICO_BOARD_HEADER_DIRS ", " DIRS)
- string(CONCAT msg ${msg} " Looked for ${PICO_BOARD}.h in ${DIRS} (additional paths specified by PICO_BOARD_HEADER_DIRS)\n")
- list(JOIN PICO_BOARD_CMAKE_DIRS ", " DIRS)
- string(CONCAT msg ${msg} " Looked for ${PICO_BOARD}.cmake in ${DIRS} (additional paths specified by PICO_BOARD_CMAKE_DIRS)")
- message(FATAL_ERROR ${msg})
-endif()
diff --git a/cmake/pico_pre_load_platform.cmake b/cmake/pico_pre_load_platform.cmake
index df9aebd..51ee39a 100644
--- a/cmake/pico_pre_load_platform.cmake
+++ b/cmake/pico_pre_load_platform.cmake
@@ -1,135 +1,21 @@
-# PICO_BOARD is the root of config as it can define PICO_PLATFORM and other build vars
-
-# PICO_CMAKE_CONFIG: PICO_BOARD, Board name being built for. This may be specified in the user environment, type=string, default=pico or pico2, group=build, docref=cmake-platform-board-config
-if (DEFINED ENV{PICO_BOARD} AND NOT PICO_BOARD)
- set(PICO_BOARD $ENV{PICO_BOARD})
- message("Initializing PICO_BOARD from environment ('${PICO_BOARD}')")
-endif()
-
-# PICO_CMAKE_CONFIG: PICO_PLATFORM, Platform to build for e.g. rp2040/rp2350/rp2350-arm-s/rp2350-riscv/host. This may be specified in the user environment, type=string, default=based on PICO_BOARD or environment value, group=build, docref=cmake-platform-board-config
-if (DEFINED ENV{PICO_PLATFORM} AND NOT PICO_PLATFORM)
+# PICO_CMAKE_CONFIG: PICO_PLATFORM, platform to build for e.g. rp2040/host, default=rp2040 or environment value, group=build
+if (DEFINED ENV{PICO_PLATFORM} AND (NOT PICO_PLATFORM))
set(PICO_PLATFORM $ENV{PICO_PLATFORM})
- message("Initializing PICO_PLATFORM from environment ('${PICO_PLATFORM}')")
-endif()
-set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}")
-
-# If PICO_PLATFORM is specified but not PICO_BOARD, we'll make a stab at defaulting
-if (NOT PICO_DEFAULT_BOARD_rp2040)
- set(PICO_DEFAULT_BOARD_rp2040 "pico")
-endif()
-if (NOT PICO_DEFAULT_BOARD_rp2350)
- set(PICO_DEFAULT_BOARD_rp2350 "pico2")
-endif()
-if (NOT PICO_DEFAULT_BOARD_rp2350-arm-s)
- set(PICO_DEFAULT_BOARD_rp2350-arm-s "pico2")
-endif()
-if (NOT PICO_DEFAULT_BOARD_rp2350-riscv)
- set(PICO_DEFAULT_BOARD_rp2350-riscv "pico2")
-endif()
-if (NOT PICO_DEFAULT_BOARD_host)
- set(PICO_DEFAULT_BOARD_host "none")
-endif()
-
-if (NOT PICO_DEFAULT_PLATFORM)
- set(PICO_DEFAULT_PLATFORM "rp2040")
-endif()
-
-if (NOT PICO_BOARD)
+ message("Using PICO_PLATFORM from environment ('${PICO_PLATFORM}')")
+else()
if (NOT PICO_PLATFORM)
- # if we have neither BOARD nor PLATFORM default PLATFORM silently, so we don't end up with a board of "none"
- # on platform that does have a default board (we want default PLATFORM and BOARD in that case)
- set(PICO_PLATFORM ${PICO_DEFAULT_PLATFORM})
- # set PICO_SAVED_PLATFORM so we don't print "Defaulting" again below
- set(PICO_SAVED_PLATFORM ${PICO_DEFAULT_PLATFORM})
- pico_message("Defaulting platform (PICO_PLATFORM) to '${PICO_PLATFORM}' since not specified.")
- endif()
- if (PICO_DEFAULT_BOARD_${PICO_PLATFORM})
- set(PICO_BOARD ${PICO_DEFAULT_BOARD_${PICO_PLATFORM}})
+ set(PICO_PLATFORM "rp2040")
+ pico_message("Defaulting PICO_PLATFORM to ${PICO_PLATFORM} since not specified.")
else()
- set(PICO_BOARD "none")
+ message("PICO platform is ${PICO_PLATFORM}.")
endif()
- pico_message("Defaulting target board (PICO_BOARD) to '${PICO_BOARD}' since not specified.")
-else()
- message("Target board (PICO_BOARD) is '${PICO_BOARD}'.")
-endif()
-set(PICO_BOARD ${PICO_BOARD} CACHE STRING "PICO target board (e.g. pico, pico2)" FORCE)
+endif ()
-# PICO_CMAKE_CONFIG: PICO_BOARD_CMAKE_DIRS, List of directories to look for .cmake in. This may be specified in the user environment, type=list, group=build
-if (DEFINED ENV{PICO_BOARD_CMAKE_DIRS})
- set(PICO_BOARD_CMAKE_DIRS $ENV{PICO_BOARD_CMAKE_DIRS})
- message("Using PICO_BOARD_CMAKE_DIRS from environment ('${PICO_BOARD_CMAKE_DIRS}')")
-endif()
+set(PICO_PLATFORM ${PICO_PLATFORM} CACHE STRING "PICO Build platform (e.g. rp2040, host)")
-list(APPEND PICO_BOARD_CMAKE_DIRS ${CMAKE_CURRENT_LIST_DIR}/../src/boards)
-
-pico_find_in_paths(PICO_BOARD_CMAKE_FILE PICO_BOARD_CMAKE_DIRS ${PICO_BOARD}.cmake)
-if (EXISTS "${PICO_BOARD_CMAKE_FILE}")
- message("Using CMake board configuration from ${PICO_BOARD_CMAKE_FILE}")
- include(${PICO_BOARD_CMAKE_FILE} board_config)
-else()
- include(generic_board)
-endif()
-
-list(APPEND PICO_INCLUDE_DIRS ${PICO_SDK_PATH}/src/boards/include) # so boards/foo.h can be explicitly included
-
-# PICO_CMAKE_CONFIG: PICO_DEFAULT_RP2350_PLATFORM, Default actual platform to build for if rp2350 is specified for PICO_PLATFORM e.g. rp2350-arm-s/rp2350-riscv, type=string, default=rp2350-arm-s, group=build
-if (DEFINED ENV{PICO_DEFAULT_RP2350_PLATFORM} AND NOT PICO_DEFAULT_RP2350_PLATFORM)
- set(PICO_DEFAULT_RP2350_PLATFORM $ENV{PICO_DEFAULT_RP2350_PLATFORM})
-endif()
-if (NOT PICO_DEFAULT_RP2350_PLATFORM)
- set(PICO_DEFAULT_RP2350_PLATFORM "rp2350-arm-s")
-endif()
-
-if (NOT COMMAND pico_expand_pico_platform)
- function(pico_expand_pico_platform FUNC DO_MESSAGE)
- if (${FUNC} STREQUAL "rp2350")
- if (DO_MESSAGE)
- message("Auto-converting non-specific PICO_PLATFORM='rp2350' to '${PICO_DEFAULT_RP2350_PLATFORM}'")
- endif()
- set(${FUNC} "${PICO_DEFAULT_RP2350_PLATFORM}" PARENT_SCOPE)
- endif()
- endfunction()
-endif()
-
-if (NOT PICO_PLATFORM)
- set(PICO_PLATFORM ${PICO_DEFAULT_PLATFORM})
- pico_message("Defaulting platform (PICO_PLATFORM) to '${PICO_PLATFORM}' since not specified.")
-else()
- if (NOT PICO_SAVED_PLATFORM)
- pico_expand_pico_platform(PICO_PLATFORM 1)
- pico_message("Defaulting platform (PICO_PLATFORM) to '${PICO_PLATFORM}' based on PICO_BOARD setting.")
- else()
- string(REGEX REPLACE "-.*" "" PICO_PLATFORM_PREFIX ${PICO_PLATFORM})
- string(REGEX REPLACE "-.*" "" PICO_SAVED_PLATFORM_PREFIX ${PICO_SAVED_PLATFORM})
- if (PICO_PLATFORM_PREFIX STREQUAL PICO_SAVED_PLATFORM_PREFIX)
- # the PICO_PLATFORM specified based on the board is compatible based on the one we were
- # already using, so use that
- pico_expand_pico_platform(PICO_SAVED_PLATFORM 0)
- set(PICO_PLATFORM ${PICO_SAVED_PLATFORM})
- message("Pico Platform (PICO_PLATFORM) is '${PICO_PLATFORM}'.")
- else()
- message(FATAL_ERROR "PICO_PLATFORM is specified to be '${PICO_SAVED_PLATFORM}', but PICO_BOARD='${PICO_BOARD}' uses \
- '${PICO_PLATFORM}' which is incompatible. You need to delete the CMake cache or build directory and reconfigure to proceed. \
- The best practice is to use separate build directories for different platforms.")
- endif()
- endif()
-endif()
-unset(PICO_SAVED_PLATFORM)
-
-if (PICO_PREVIOUS_PLATFORM AND NOT PICO_PREVIOUS_PLATFORM STREQUAL PICO_PLATFORM)
- message(FATAL_ERROR "PICO_PLATFORM has been modified from '${PICO_SAVED_PLATFORM}' to '${PICO_PLATFORM}.\
- You need to delete the CMake cache or build directory and reconfigure to proceed.\
- The best practice is to use separate build directories for different platforms.")
-endif()
-set(PICO_PLATFORM ${PICO_PLATFORM} CACHE STRING "PICO Build platform (e.g. rp2040, rp2350, rp2350-riscv, host)" FORCE)
-set(PICO_PREVIOUS_PLATFORM ${PICO_PLATFORM} CACHE STRING "Saved PICO Build platform (e.g. rp2040, rp2350, rp2350-riscv, host)" INTERNAL)
-
-# PICO_CMAKE_CONFIG: PICO_CMAKE_PRELOAD_PLATFORM_FILE, Custom CMake file to use to set up the platform environment, type=string, group=build
-set(PICO_CMAKE_PRELOAD_PLATFORM_FILE ${PICO_CMAKE_PRELOAD_PLATFORM_FILE} CACHE INTERNAL "")
-if (NOT PICO_CMAKE_PRELOAD_PLATFORM_DIR)
- set(PICO_CMAKE_PRELOAD_PLATFORM_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/platforms")
-endif()
-set(PICO_CMAKE_PRELOAD_PLATFORM_DIR "${PICO_CMAKE_PRELOAD_PLATFORM_DIR}" CACHE INTERNAL "")
+# PICO_CMAKE_CONFIG: PICO_CMAKE_RELOAD_PLATFORM_FILE, custom CMake file to use to set up the platform environment, default=none, group=build
+set(PICO_CMAKE_PRELOAD_PLATFORM_FILE "" CACHE INTERNAL "")
+set(PICO_CMAKE_PRELOAD_PLATFORM_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/platforms" CACHE INTERNAL "")
if (NOT PICO_CMAKE_PRELOAD_PLATFORM_FILE)
set(PICO_CMAKE_PRELOAD_PLATFORM_FILE ${PICO_CMAKE_PRELOAD_PLATFORM_DIR}/${PICO_PLATFORM}.cmake CACHE INTERNAL "")
diff --git a/cmake/pico_pre_load_toolchain.cmake b/cmake/pico_pre_load_toolchain.cmake
index b41b386..b77f421 100644
--- a/cmake/pico_pre_load_toolchain.cmake
+++ b/cmake/pico_pre_load_toolchain.cmake
@@ -1,11 +1,9 @@
-# PICO_CMAKE_CONFIG: PICO_TOOLCHAIN_PATH, Path to search for compiler, type=string, default=none (i.e. search system paths), group=build, docref=cmake-toolchain-config
+# PICO_CMAKE_CONFIG: PICO_TOOLCHAIN_PATH, Path to search for compiler, default=none (i.e. search system paths), group=build
set(PICO_TOOLCHAIN_PATH "${PICO_TOOLCHAIN_PATH}" CACHE INTERNAL "")
# Set a default build type if none was specified
set(default_build_type "Release")
-list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_PREFIX_PATH)
-
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Defaulting build type to '${default_build_type}' since not specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build, options are: 'Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo'." FORCE)
@@ -18,59 +16,28 @@ if (CMAKE_BUILD_TYPE STREQUAL "Default")
error("Default build type is NOT supported")
endif()
-if (NOT (DEFINED PICO_COMPILER OR DEFINED CMAKE_TOOLCHAIN_FILE))
- if (DEFINED PICO_DEFAULT_COMPILER)
- pico_message("Defaulting compiler (PICO_COMPILER) to '${PICO_DEFAULT_COMPILER}' since not specified.")
- set(PICO_COMPILER ${PICO_DEFAULT_COMPILER})
- endif()
-endif ()
-
-# PICO_CMAKE_CONFIG: PICO_COMPILER, Specifies the compiler family to use, type=string, group=build, default=PICO_DEFAULT_COMPILER which is set based on PICO_PLATFORM, docref=cmake-toolchain-config
+# PICO_CMAKE_CONFIG: PICO_COMPILER, Optionally specifies a different compiler (other than pico_arm_gcc.cmake) - this is not yet fully supported, default=none, group=build
# If PICO_COMPILER is specified, set toolchain file to ${PICO_COMPILER}.cmake.
if (DEFINED PICO_COMPILER)
- # maintain backwards compatibility with RP2040 SDK compilers
- set(ORIG_PICO_COMPILER "${PICO_COMPILER}")
- if (PICO_COMPILER STREQUAL "pico_arm_gcc")
- if (PICO_PLATFORM STREQUAL "rp2040")
- set(PICO_COMPILER "pico_arm_cortex_m0plus_gcc")
- elseif(PICO_PLATFORM STREQUAL "rp2350")
- set(PICO_COMPILER "pico_arm_cortex_m33_gcc")
- endif()
- elseif(PICO_COMPILER STREQUAL "pico_arm_clang")
- if (PICO_PLATFORM STREQUAL "rp2040")
- set(PICO_COMPILER "pico_arm_cortex_m0plus_clang")
- elseif(PICO_PLATFORM STREQUAL "rp2350-arm-s")
- set(PICO_COMPILER "pico_arm_cortex_m33_clang")
- elseif(PICO_PLATFORM STREQUAL "rp2350-arm-ns")
- set(PICO_COMPILER "pico_arm_cortex_m33_clang")
- endif()
- endif()
- if (NOT PICO_COMPILER STREQUAL ORIG_PICO_COMPILER)
- message("Accepting PICO_COMPILER value '${ORIG_PICO_COMPILER}' for compatibility, but using '${PICO_COMPILER}' instead")
- endif()
- if (NOT DEFINED PICO_TOOLCHAIN_DIR)
- set(PICO_TOOLCHAIN_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/toolchains")
- endif()
- set(toolchain_file "${PICO_TOOLCHAIN_DIR}/${PICO_COMPILER}.cmake")
- if (EXISTS "${toolchain_file}")
- set(CMAKE_TOOLCHAIN_FILE "${toolchain_file}")
+ if (DEFINED CMAKE_TOOLCHAIN_FILE)
+ get_filename_component(toolchain "${CMAKE_TOOLCHAIN_FILE}" NAME_WE)
+ if (NOT "${PICO_COMPILER}" STREQUAL "${toolchain}")
+ message(WARNING "CMAKE_TOOLCHAIN_FILE is already defined to ${toolchain}.cmake, you\
+ need to delete cache and reconfigure if you want to switch compiler.")
+ endif ()
else ()
- # todo improve message
- message(FATAL_ERROR "Toolchain file \"${PICO_COMPILER}.cmake\" does not exist, please\
- select one from \"cmake/toolchains\" folder.")
+ set(toolchain_dir "${CMAKE_CURRENT_LIST_DIR}/preload/toolchains")
+ set(toolchain_file "${toolchain_dir}/${PICO_COMPILER}.cmake")
+ if (EXISTS "${toolchain_file}")
+ set(CMAKE_TOOLCHAIN_FILE "${toolchain_file}" CACHE INTERNAL "")
+ else ()
+ # todo improve message
+ message(FATAL_ERROR "Toolchain file \"${PICO_COMPILER}.cmake\" does not exist, please\
+ select one from \"cmake/toolchains\" folder.")
+ endif ()
endif ()
- message("Configuring toolchain based on PICO_COMPILER '${PICO_COMPILER}'")
+ message("PICO compiler is ${PICO_COMPILER}")
endif ()
-if (PICO_PREVIOUS_CMAKE_TOOLCHAIN_FILE)
- if (NOT "${PICO_PREVIOUS_CMAKE_TOOLCHAIN_FILE}" STREQUAL "${CMAKE_TOOLCHAIN_FILE}")
- message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE was previously defined to ${PICO_PREVIOUS_CMAKE_TOOLCHAIN_FILE}, and now\
- is being changed to ${CMAKE_TOOLCHAIN_FILE}. You\
- need to delete the CMake cache and reconfigure if you want to switch compiler.\
- The best practice is to use separate build directories for different platforms or compilers.")
- endif ()
-endif ()
-
-set(PICO_PREVIOUS_CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE} CACHE INTERNAL "Saved CMAKE_TOOLCHAIN_FILE" FORCE)
unset(PICO_COMPILER CACHE)
diff --git a/cmake/preload/platforms/combined-docs.cmake b/cmake/preload/platforms/combined-docs.cmake
deleted file mode 100644
index 5683d77..0000000
--- a/cmake/preload/platforms/combined-docs.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(PICO_DEFAULT_COMPILER "pico_arm_cortex_m33_gcc")
-set(PICO_CHIP rp2350)
-
diff --git a/cmake/preload/platforms/pico/pico.cmake b/cmake/preload/platforms/pico/pico.cmake
new file mode 100644
index 0000000..6e49411
--- /dev/null
+++ b/cmake/preload/platforms/pico/pico.cmake
@@ -0,0 +1,7 @@
+if (NOT (DEFINED PICO_COMPILER OR DEFINED CMAKE_TOOLCHAIN_FILE))
+ pico_message("Defaulting PICO platform compiler to pico_arm_gcc since not specified.")
+ set(PICO_COMPILER "pico_arm_gcc")
+endif ()
+
+
+
diff --git a/cmake/preload/platforms/rp2040.cmake b/cmake/preload/platforms/rp2040.cmake
index e8151dc..3406bfc 100644
--- a/cmake/preload/platforms/rp2040.cmake
+++ b/cmake/preload/platforms/rp2040.cmake
@@ -1,2 +1 @@
-set(PICO_DEFAULT_COMPILER "pico_arm_cortex_m0plus_gcc")
-set(PICO_CHIP rp2040)
+include(${CMAKE_CURRENT_LIST_DIR}/pico/pico.cmake)
\ No newline at end of file
diff --git a/cmake/preload/platforms/rp2350-arm-s.cmake b/cmake/preload/platforms/rp2350-arm-s.cmake
deleted file mode 100644
index 5683d77..0000000
--- a/cmake/preload/platforms/rp2350-arm-s.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(PICO_DEFAULT_COMPILER "pico_arm_cortex_m33_gcc")
-set(PICO_CHIP rp2350)
-
diff --git a/cmake/preload/platforms/rp2350-riscv.cmake b/cmake/preload/platforms/rp2350-riscv.cmake
deleted file mode 100644
index 2d15db4..0000000
--- a/cmake/preload/platforms/rp2350-riscv.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(PICO_DEFAULT_COMPILER "pico_riscv_gcc")
-set(PICO_CHIP rp2350)
-
diff --git a/cmake/preload/toolchains/util/find_compiler.cmake b/cmake/preload/toolchains/find_compiler.cmake
similarity index 59%
rename from cmake/preload/toolchains/util/find_compiler.cmake
rename to cmake/preload/toolchains/find_compiler.cmake
index 62519bd..6052369 100644
--- a/cmake/preload/toolchains/util/find_compiler.cmake
+++ b/cmake/preload/toolchains/find_compiler.cmake
@@ -7,10 +7,10 @@ endif ()
# Find the compiler executable and store its path in a cache entry ${compiler_path}.
# If not found, issue a fatal message and stop processing. PICO_TOOLCHAIN_PATH can be provided from
# commandline as additional search path.
-function(pico_find_compiler compiler_path compiler_exes)
+function(pico_find_compiler compiler_path compiler_exe)
# Search user provided path first.
find_program(
- ${compiler_path} NAMES ${compiler_exes}
+ ${compiler_path} ${compiler_exe}
PATHS ENV PICO_TOOLCHAIN_PATH
PATH_SUFFIXES bin
NO_DEFAULT_PATH
@@ -21,21 +21,11 @@ function(pico_find_compiler compiler_path compiler_exes)
if (DEFINED ENV{PICO_TOOLCHAIN_PATH})
message(WARNING "PICO_TOOLCHAIN_PATH specified ($ENV{PICO_TOOLCHAIN_PATH}), but ${compiler_exe} not found there")
endif()
- find_program(${compiler_path} NAMES ${compiler_exes})
+ find_program(${compiler_path} ${compiler_exe})
endif ()
if ("${${compiler_path}}" STREQUAL "${compiler_path}-NOTFOUND")
set(PICO_TOOLCHAIN_PATH "" CACHE PATH "Path to search for compiler.")
- list(JOIN compiler_exes " / " compiler_exes)
- message(FATAL_ERROR "Compiler '${compiler_exes}' not found, you can specify search path with\
+ message(FATAL_ERROR "Compiler '${compiler_exe}' not found, you can specify search path with\
\"PICO_TOOLCHAIN_PATH\".")
endif ()
endfunction()
-
-# Find the compiler executable and store its path in a cache entry ${compiler_path}.
-# If not found, issue a fatal message and stop processing. PICO_TOOLCHAIN_PATH can be provided from
-# commandline as additional search path.
-function(pico_find_compiler_with_triples compiler_path triples compiler_suffix)
- list(TRANSFORM triples APPEND "-${compiler_suffix}")
- pico_find_compiler(${compiler_path} "${triples}")
- set(${compiler_path} ${${compiler_path}} PARENT_SCOPE)
-endfunction()
diff --git a/cmake/preload/toolchains/pico_arm_clang.cmake b/cmake/preload/toolchains/pico_arm_clang.cmake
new file mode 100644
index 0000000..1d2c4eb
--- /dev/null
+++ b/cmake/preload/toolchains/pico_arm_clang.cmake
@@ -0,0 +1,53 @@
+# NOTE: THIS IS A WIP ONLY PICO_ARM_GCC IS CURRENTLY SUPPORTED
+# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
+# i.e. CMakeInformation and whatnot
+include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
+
+# include our Platform/pico.cmake
+set(CMAKE_SYSTEM_NAME PICO)
+set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
+
+# Find CLANG
+pico_find_compiler(PICO_COMPILER_CC clang)
+pico_find_compiler(PICO_COMPILER_CXX clang)
+#pico_find_compiler(PICO_COMPILER_ASM armasm)
+set(PICO_COMPILER_ASM "${PICO_COMPILER_CC}" CACHE INTERNAL "")
+pico_find_compiler(PICO_OBJCOPY llvm-objcopy)
+pico_find_compiler(PICO_OBJDUMP llvm-objdump)
+
+# Specify the cross compiler.
+set(CMAKE_C_COMPILER ${PICO_COMPILER_CC} CACHE FILEPATH "C compiler")
+set(CMAKE_CXX_COMPILER ${PICO_COMPILER_CXX} CACHE FILEPATH "C++ compiler")
+set(CMAKE_C_OUTPUT_EXTENSION .o)
+
+# todo should we be including CMakeASMInformation anyway - i guess that is host side
+set(CMAKE_ASM_COMPILER ${PICO_COMPILER_ASM} CACHE FILEPATH "ASM compiler")
+set(CMAKE_ASM_COMPILE_OBJECT " -o