Commit graph

128 commits

Author SHA1 Message Date
Cantrell Hepner
a554a770ce
Merge 410956a3e6 into bc5481455f 2026-03-13 09:21:57 +00:00
Graham Sanderson
a224028c0b
add a test driver script (#2850)
Some checks are pending
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Waiting to run
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Waiting to run
Bazel presubmit checks / other-bazel-checks (push) Waiting to run
Check Configs / check-configs (push) Waiting to run
CMake / build (push) Waiting to run
Build on macOS / build (push) Waiting to run
Build on Windows / build (push) Waiting to run
add a test driver script to run a matrix of tests via gdb on device
2026-03-11 13:34:07 -05:00
Richard Hulme
5a2cbf93a6
Use 'constexpr' when including pio header files from a C++ compiler (#2651)
* Use 'constexpr' when including pio header files from a C++ compiler

In particular this allows compile-time checks to be performed on the
contents of pio_program structs via 'static_assert'.

This could be used (for example) to confirm that multiple PIO programs
fit in a single PIO module and abort compilation if not.

Fixes #2650

* Use feature test macro to check for 'constexpr' support

* Rename modifier PIO_CONST to __pio_const

---------

Co-authored-by: Graham Sanderson <graham.sanderson@gmail.com>
2026-03-02 14:12:14 -06:00
armandomontanez
6262b49c74
[bazel] Run buildifier on Bazel build files (#2825)
Some checks are pending
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Waiting to run
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Waiting to run
Bazel presubmit checks / other-bazel-checks (push) Waiting to run
Check Configs / check-configs (push) Waiting to run
CMake / build (push) Waiting to run
Build on macOS / build (push) Waiting to run
Build on Windows / build (push) Waiting to run
This is an automated change with the following commands:

$ find . -name "BUILD.bazel" -o -name "*.bzl" \
  -exec buildifier -lint=fix {} \;

* Add missing `load()` statements for things provided by @rules_cc. This
  is required for Bazel >9.
* Sort attributes on build targets.
* Add missing trailing commas where applicable.
2026-03-02 10:24:17 +00:00
Graham Sanderson
3461d65d79
add some missing pico_config and pico_cmake_config entries (#2559) 2025-07-25 09:44:08 -05:00
Andrew Scheller
4f5ebb8d26
Refactor extraction-scripts to reduce code-duplication (#2592)
extract_configs.py now supports reading min, max or default values
from a #define value (which reduces false-positives)
2025-07-25 09:14:31 -05:00
Andrew Scheller
de5fb4f71f
Doxygen "group" fixes (#2591)
- Add missing libraries to docs/index.h
 - Remove duplicate libraries from docs/index.h
 - Add new script to match up doxygen groups with the PICO_CONFIG groups
2025-07-25 09:13:40 -05:00
Andrew Scheller
c650739c4c
Look for other possible "missing PICO_CONFIG" lines, and make message more obvious (#2477)
Some checks are pending
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Waiting to run
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Waiting to run
Bazel presubmit checks / other-bazel-checks (push) Waiting to run
Check Configs / check-configs (push) Waiting to run
CMake / build (push) Waiting to run
Build on macOS / build (push) Waiting to run
Build on Windows / build (push) Waiting to run
2025-07-23 09:18:07 -05:00
Graham Sanderson
4242010f11
Misc cleanup (#2569)
* miscellaneous cleanup:

* cleanup some #ifdefs which were slightly hacky when RP2350 was added; use HAS_ flags in preference to PICO_RP2040/RP2350
* make some dependencies more explicit - i.e. compile if the user doesn't want to include certain libraries
* cleanup some directory A -> directory B relative path names in CMakeLists.txt to be SDK root -> directory B
2025-07-18 09:37:21 -05:00
will-v-pi
d70cccd561
Add FLASH option to pico_package_uf2_output (#2545)
Some checks are pending
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Waiting to run
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Waiting to run
Bazel presubmit checks / other-bazel-checks (push) Waiting to run
Check Configs / check-configs (push) Waiting to run
CMake / build (push) Waiting to run
Build on macOS / build (push) Waiting to run
Build on Windows / build (push) Waiting to run
* Add FLASH option to pico_package_uf2_output

Allows passing FLASH instead of 0x10000000 (eg pico_package_uf2_output(hello_serial FLASH))

* Add `pico_ensure_load_map` function

* Update tools/CMakeLists.txt

* Remove FLASH option and just make PACKADDR optional
2025-07-15 16:53:05 -05:00
Graham Sanderson
d2cdf6c953
add pioasm --version, and print version number in generated files (#2554)
Some checks are pending
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Waiting to run
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Waiting to run
Bazel presubmit checks / other-bazel-checks (push) Waiting to run
Check Configs / check-configs (push) Waiting to run
CMake / build (push) Waiting to run
Build on macOS / build (push) Waiting to run
Build on Windows / build (push) Waiting to run
* add pioasm --version, and print version number in generated files

* Hook up pio version string in Bazel build

---------

Co-authored-by: Armando Montanez <amontanez@google.com>
2025-07-15 15:09:36 -05:00
will-v-pi
6f856ee4eb
Add Board Header Check Action (#2519)
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Board Headers / check-board-headers (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
* Add action to check board headers when modified

* Fix invalid escape warning

* Check for more board header errors before exiting script

* Also run when action file changes

* Add back newline at end of check_all_board_headers.sh

* Remove python install step

* `e.__str__()` -> `str(e)`
2025-06-26 09:59:32 -05:00
will-v-pi
c3c62675e8
Clean extra output files (#2504)
Add bin/uf2/dis/hex output files as byproducts, so they get cleaned up

This is only best-effort, because BYPRODUCTS doesn't support generator expressions, so everything must be evaluated at the time pico_add_extra_outputs is called
2025-06-18 17:07:34 -05:00
will-v-pi
287196517b
Add config check action (#2525)
* Add action to check configs & defines

* Check for all errors before exiting scripts

* Add extract_cmake_functions to the checks

* Fix invalid escape sequence warning
2025-06-18 10:18:25 -05:00
Brad Nolan
be549183e8
Bazel build implementation, doesn't provide options for the compilation modes opt and debug (#2395)
* Bazel add default compliation args for opt and debug. Can be overriden

* Add docstrings for new compilation mode override flags

* Remove cc_args_list shims, which arent needed anymore for cc_feature

* Add Compilation mode overrides to the BAZEL_ONLY_ALLOWLIST, these dont exist in Cmake

* For completness add the fastbuild default options, and override flag

* Remove the default options for fastbuiild, as the bazel doc defaults didnt make much sense, nor work. Leaving these for completness and future addition

* Rename the config and constraint labels from OVERRIDE to REMOVE_DEFS

* Change naming of flags from PICO_COMPILATION_XXX_REMOVE_DEFS to PICO_COMPILATION_NO_XXX_ARGS for OPT, FASTBUILD & DEBUG variants

* Fixup spellling mistakes, and comments

* Fix typo PICO_COMPILATION_NO_FASBUILD_ARGS to FASTBUILD
2025-06-12 17:45:44 -05:00
will-v-pi
1ae2f0e32c
Don't include the picobin end block when sealing (#2492)
* Don't include the picobin end block when signing, as picotool will add a new end block anyway

* small whitespace fix

---------

Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2025-05-30 16:17:46 -05:00
will-v-pi
6841d4d15b
Remove DEPENDS argument from add_custom_command(TARGET functions (#2489)
This raises a warning with recent CMake versions, and isn't required due to the `pico_add_link_depend` already added for these files

Fixes raspberrypi/picotool#235
2025-05-30 08:35:25 -05:00
will-v-pi
6613aa45a5
Add support for creating self-decrypting binaries (#2315)
Note: this support is experimental until the next release

Co-authored-by: graham sanderson <graham.sanderson@raspberrypi.com>
2025-05-29 08:12:29 -05:00
27Onion Nebell
66540fe88e
Fix pioasm build failure caused by GCC 15 changes (#2448) (#2468) 2025-05-20 15:30:17 -05:00
will-v-pi
14d75c0b78
Add printout of picotool location (#2475)
This prints out the location of the picotool executable being used

For example:
* `Using picotool from /usr/local/bin/picotool` for a system install
* `Using picotool from /home/name/pico-examples/build/_deps/picotool/picotool` for a picotool fetched by the SDK
2025-05-20 15:29:41 -05:00
will-v-pi
6e315799f5
Add script to extract CMake function descriptions (#2422) 2025-04-29 11:09:06 -05:00
Andrew Scheller
082d9f75cd
More board-header checks (followup to #2397) (#2442)
- make the error messages less misleading
- suggest replacing the old comment-style syntax with the new macro-style syntax
2025-04-26 12:15:26 -05:00
Graham Sanderson
fed7188e52
Rework use of pico_cmake_set in board headers to make it slightly less magic/confusing (#2397)
* Rework use of pico_cmake_set in board headers to make it slightly less magic/confusing

- prefer "pico_cmake_set(var, value)" over "// pico_cmake_set var = value"
- prefer "pico_cmake_set_default(var, value)" over "// pico_cmake_set_default var = value"
- move these inside the header include guards as CLion complains

Note that the macros are defined in "pico.h" however that is not explicitly included by the board headers; this
will probably confuse some VS code syntax highligting, so lets see how it looks - i'd prefer to avoid having
to include a header just for this

* Update check_board_header.py with the new pico_cmake_set formats

* Add brackets back around `PICO_FLASH_SIZE_BYTES` settings

The python script checks for an exact match between the #define and the pico_cmake_set_default, so fails without the brackets

* Rename to pico_board_cmake_set and pico_board_cmake_set_default

* Fix support for old versions

---------

Co-authored-by: William Vinnicombe <william.vinnicombe@raspberrypi.com>
2025-04-14 08:50:25 -07:00
Peter Harper
d47c0c89ce
Update mbedtls, lwip and cyw43-driver (#2405)
* Update LwIP to 2.2.1
* Update to mbedtls to 3.6.1
* Update lib/cyw43-driver to 1.1.0
* Support using a more recent version of mbedtls
altcp_tls_mbedtls.c is not compatible with mbedtls 3.x so use a
patched version until this is resolved.
* Make sure MBEDTLS_VERSION_MAJOR is visible to LwIP.
* Test mbedtls in kitchen sink
* Add mbedtls to bazel
2025-04-11 09:14:02 -07:00
audiobird
410956a3e6 Make constexpr output namespace a user defined option 2025-04-07 10:51:12 -07:00
audiobird
be979f65f5 Fix typo
.
2025-04-07 10:15:23 -07:00
audiobird
8464e5eeb7 Add pioasm c++ constexpr output target 2025-04-06 13:41:04 -07:00
Andrew Scheller
c88bd53a68
Ensure that all RP2350 board-headers explicitly define PICO_RP2350A (#2370) 2025-04-04 11:35:42 -05:00
Andrew Scheller
ad0bca9c85
Fix bug in extract_configs.py (#2389)
This bug was actually introduced by #1845 , but I never noticed until now because it depended on which order the filesystem traversed the directories
2025-04-04 11:33:18 -05:00
Andrew Scheller
fa94f6448a
Look for PICO_CONFIG: entries in .S files too (#2368)
(and fix the errors that this found)
2025-03-24 17:28:59 -05:00
will-v-pi
f81851a2cb
Throw a warning when using the example signing/encryption keys (#2352)
* Raise a warning when using the example signing/encryption keys
  This is automatically disabled for pico-examples, and can be manually disabled by setting PICO_ALLOW_EXAMPLE_KEYS
2025-03-22 18:22:37 -05:00
Andrew Scheller
7d0f44b8b7
Fix tools/build_all_headers.py to cope with chip-specific headers (#2292) 2025-03-18 13:43:03 -05:00
Christopher Chamberlain
6d8588d62c
Adjust generated name to match pio_mov_status_type (#2324)
The enum pio_mov_status_type expects the member name to be STATUS_IRQ_SET.
2025-03-18 13:39:38 -05:00
Andrew Scheller
3751bc5f98
Check for the misuse of '#define PICO_RP2350B' in board headers (#2290) 2025-03-18 13:31:21 -05:00
graham sanderson
b5af60771c bump SDK version to 2.1.1 and update picotool dependency since 2.1.1 is faster 2025-02-18 17:27:39 -06:00
Graham Sanderson
302fd9a811
Fix WAIT GPIO n for n > 32 and when using gpio_base = 16 (#2265)
- fix bug: pioasm was spilling bit 5 of arg2 into arg1
- make pio_add_program flip bit 5 of a WAIT GPIO instruction if gpio_base is 16

Note: pioasm will encode only the bits 4-0 of arg2 (the GPIO number), however it does indicate whether
0-15 means 0-15 or 32-47. This can only be fixed up when loading the program, and indeed once the GPIO
base is known. pio_can_add_program and friends already detected the cases where this was impossible
2025-02-14 09:26:22 -06:00
Graham Sanderson
111fa7de2d
small pioasm improvements (#2224)
- fix disassembly of `wait jmppin`
- fix incorrect error message
- make python output emit `word(x)` for all unsupported instructions
2025-02-05 10:55:24 -06:00
Graham Sanderson
0c2de5dc0c
Eat PATH argument to pico_generate_pio_header which was ignored before supporting multi-target on pico_generate_pio_header (#2221) 2025-02-03 11:23:56 -06:00
Wu Haotian
d1a1c9f9fc
Support multiple .pio file in pico_generate_pio_header (#2188) 2025-01-29 09:31:06 -06:00
will-v-pi
c54475da6f
Remove deprecated uses of FetchContent_Populate (#2169)
* Remove deprecated uses of FetchContent_Populate

Cannot use MakeAvailable as the files shouldn't be added to the build, so instead uses the full signature for FetchContent_Populate

Fixes #2124

* Fix GIT_SUBMODULES_RECURSE for older CMake versions
2025-01-20 13:45:51 -06:00
Graham Sanderson
f0a1ff3c03
Fixes for/found by documentation generation (#2099)
* fix errors breaking extra_[cmake_]configs.py
* remove trailing whitespace which is confusing asciidoctor
* fix rp2xxx-specific -> rp2xxx_specific
* add missing xip_cache funcs to the combined docs
* Revert "fix errors breaking extra_[cmake_]configs.py"
* Fix typo in #define name
* Allow optional whitespace at the start of "commented out" config lines

Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2024-11-25 12:30:55 -06:00
graham sanderson
beb2449622 Update picotool dependency to 2.1.0 (not strictly required, but we prefer people to be on the latest) 2024-11-24 23:43:46 -06:00
will-v-pi
2692d9a4cb
Propogate changed pico_cmake_set_default values to the compilation (#2034)
* Propogate non-default pico_cmake_set_default values through to compile definitions

Add PICO_BOARD_CMAKE_OVERRIDES common scope variable, to contain any pico_cmake_set_default
CMake variables which have been overwritten. This allows passing CMake arguments to the
build, without needing extra target_compile_definitions.

Also add pico_cmake_set_default PICO_RP2350_A2_SUPPORTED to enable/disable the E10 abs-block fix

* Fix more board files missing pico_cmake_set_default PICO_RP2350_A2_SUPPORTED

* Apply @lurch's patch to check_board_header.py
2024-11-21 17:47:51 -06:00
armandomontanez
338f99ff1c
Initial Pico/2 W Bazel support (#2049)
* Initial Pico 2 W Bazel support

Improves compatibility with Pico W and Pico 2 W by fixing issues that
prevented correct linking of wireless libraries.

* Improve correctness and configurability

* Require newer rules_python

* Require rules_python@0.36.0

* Fix missing compatibility expressions

* Minor tweaks

* Minor cleanup

* Update suggested version in Bazel README

* More README tweaks

* Improve Bazel btstack build correctness
2024-11-21 16:58:02 -06:00
Graham Sanderson
6bb3ccf822
some minor pioasm fixes for #1950 (#2056) 2024-11-21 11:56:22 -06:00
Andrew Scheller
f3459a45d4
Update documented max PIN values, to accomodate RP2350B (#2072) 2024-11-20 20:28:54 -06:00
will-v-pi
6bf5d9bf7d
Enforce ordering of pico_add_extra_outputs and picotool functions (#2054)
* Thow FATAL_ERROR when using post-processing functions after pico_add_extra_outputs

* Remove property definition, and rename to `PICOTOOL_PROCESSING_CONFIGURED` and `picotool_check_configurable`

* done -> configured
2024-11-20 16:43:05 -06:00
Andrew Scheller
d3080e777f
Slight tweak to the config-extraction scripts. (#2070)
* Slight tweak to the config-extraction scripts.
A small logic bug meant they were reporting more false-positive warnings than they should have been.

* Small code tidy-up
2024-11-20 16:41:28 -06:00
Graham Sanderson
06a244b2b5
fix incorrect disassembly of MOV rx_fifo (#2067) 2024-11-20 10:57:22 -06:00
Andrew Scheller
b122c42989
More CYW43 config tweaks (#2033)
- Re-synchronise the PICO_CMAKE_CONFIG: entries with the corresponding PICO_CONFIG: entries
 - Fix a silly typo I made in #2002
 - Enhance config-extraction scripts to catch similar typos in future
2024-11-19 14:10:40 -06:00