Skip to content

Commit d7e7b7c

Browse files
authored
Merge branch 'raspberrypi:master' into pioasm-wrap-dot-word
2 parents fb4fade + a1438df commit d7e7b7c

File tree

173 files changed

+4896
-1122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+4896
-1122
lines changed

.bazelignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ common --host_per_file_copt=external/.*@-w
44

55
# Produce useful output when the build fails.
66
common --verbose_failures
7+
8+
# Silence warnings about old bazel_dep pins. Bazel 8 brings along newer ones,
9+
# but we can support Bazel 7 (for now).
10+
common --check_direct_dependencies=off

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.2.1
1+
8.1.0

.github/workflows/check_board.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check Board Headers
2+
3+
on:
4+
push:
5+
paths:
6+
- 'src/boards/include/boards/**'
7+
- 'tools/check_board_header.py'
8+
- 'tools/check_all_board_headers.sh'
9+
- '.github/workflows/check_board.yml'
10+
pull_request:
11+
paths:
12+
- 'src/boards/include/boards/**'
13+
- 'tools/check_board_header.py'
14+
- 'tools/check_all_board_headers.sh'
15+
- '.github/workflows/check_board.yml'
16+
17+
jobs:
18+
check-board-headers:
19+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Check Board Headers
26+
run: |
27+
tools/check_all_board_headers.sh
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Check Configs
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
check-configs:
9+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Check Build Defines
16+
if: always()
17+
run: |
18+
tools/extract_build_defines.py .
19+
20+
- name: Check CMake Configs
21+
if: always()
22+
run: |
23+
tools/extract_cmake_configs.py .
24+
25+
- name: Check CMake Functions
26+
if: always()
27+
run: |
28+
tools/extract_cmake_functions.py .
29+
30+
- name: Check Configs
31+
if: always()
32+
run: |
33+
tools/extract_configs.py .

.github/workflows/choco_packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
<packages>
33
<package id="gcc-arm-embedded" version="10.2.1" />
44
<package id="mingw" version="12.2.0" />
5-
<package id="ninja" version="1.12.1" />
65
</packages>

.github/workflows/pr-check.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Make sure PRs target the develop branch
2+
3+
on:
4+
pull_request_target:
5+
6+
# By default, pull_request_target gets write permissions to the repo - this prevents that
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
check-branch:
12+
if: github.event.pull_request.base.ref == 'master'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Add comment
16+
uses: actions/github-script@v7
17+
with:
18+
script: |
19+
github.rest.issues.createComment({
20+
issue_number: context.issue.number,
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
body: 'Please do not submit against `master`, use `develop` instead'
24+
})
25+
- name: Throw error
26+
run: |
27+
echo "::error title=wrong-branch::Please do not submit against 'master', use 'develop' instead"
28+
exit 1

MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module(
22
name = "pico-sdk",
3-
version = "2.1.2-develop",
3+
version = "2.2.0",
44
)
55

66
bazel_dep(name = "platforms", version = "0.0.9")
77
bazel_dep(name = "bazel_skylib", version = "1.6.1")
88
bazel_dep(name = "rules_python", version = "0.36.0")
9-
bazel_dep(name = "picotool", version = "2.1.1")
9+
bazel_dep(name = "picotool", version = "2.2.0")
1010
bazel_dep(name = "rules_cc", version = "0.0.10")
1111

1212
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,11 @@ instructions for other platforms, and just in general, we recommend you see [Ras
177177
1. Setup a CMake build directory.
178178
For example, if not using an IDE:
179179
```
180-
$ mkdir build
181-
$ cd build
182-
$ cmake ..
183-
```
180+
$ cmake -S . -B build
181+
```
182+
> The cmake -S flag indicates the source directory, and the -B flag tells cmake the name of the output-directory to create. This doesn't have to be named "build", you can call it whatever you want.
184183
185-
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.
184+
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 -S . -B build -DPICO_BOARD=pico2` or `cmake -S . -B build -DPICO_BOARD=pico_w` to configure the SDK and build options accordingly for that particular board.
186185
187186
Specifying `PICO_BOARD=<boardname>` sets up various compiler defines (e.g. default pin numbers for UART and other hardware) and in certain
188187
cases also enables the use of additional libraries (e.g. wireless support when building for `PICO_BOARD=pico_w`) which cannot
@@ -193,11 +192,32 @@ instructions for other platforms, and just in general, we recommend you see [Ras
193192
194193
1. Make your target from the build directory you created.
195194
```sh
196-
$ make hello_world
195+
$ cmake --build build --target hello_world
197196
```
197+
> The directory-name supplied to the `--build` flag needs to match the directory-name that was passed to the `-B` flag in the earlier cmake command.
198198
199199
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.
200200
201201
# RISC-V support on RP2350
202202
203203
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.
204+
205+
## RISC-V quick start
206+
207+
The [pico-sdk-tools](https://github.com/raspberrypi/pico-sdk-tools/releases) repository contains some prebuilt versions of the RISC-V compiler.
208+
209+
You can use these to get a working RISC-V compiler on Raspberry Pi OS for example.
210+
211+
```
212+
wget https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-5/riscv-toolchain-14-aarch64-lin.tar.gz
213+
sudo mkdir -p /opt/riscv/riscv-toolchain-14
214+
sudo chown $USER /opt/riscv/riscv-toolchain-14
215+
tar xvf riscv-toolchain-14-aarch64-lin.tar.gz -C /opt/riscv/riscv-toolchain-14
216+
```
217+
218+
To use the RISC-V compiler to build code you need to set a couple of environment variables and run cmake from fresh.
219+
220+
```
221+
export PICO_TOOLCHAIN_PATH=/opt/riscv/riscv-toolchain-14/
222+
export PICO_PLATFORM=rp2350-riscv
223+
```

REPO.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ignore_directories(
2+
[
3+
# Don't accidentally pick up external CMake deps with Bazel build files.
4+
"cmake-*",
5+
"build",
6+
"build-*",
7+
# Don't treat submodules as part of this project.
8+
"lib",
9+
],
10+
)

0 commit comments

Comments
 (0)