Commit graph

111 commits

Author SHA1 Message Date
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
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
armandomontanez
89691ed879
Do not assume submodule root directory in presubmit (#2040)
Tweaks compare_build_systems.py slightly so that it does not assume the
root directory of submodules, which arguably made the implementation a
little less intuitive.
2024-11-18 17:33:00 -06:00
armandomontanez
1b64cac8d6
Extend build system checks (#2039)
* Adds check that ensures the Bazel and CMake Pico SDK version strings
  stay in sync.
* Adds check that ensures the Bazel pins for external dependencies stays
  in sync with the git submodule pins.
* Updates cyw43-driver pin in Bazel.
* Makes the checks for some build configurability options non-blocking.
2024-11-13 14:11:49 -06:00
will-v-pi
2331e6f203
Fix dependency on files used by picotool (#2027)
Add the key files and partition table JSON to the link dependencies, to ensure the postprocessing is run when any of them are updated. Link dependencies seem to be the simplest way, as the elf file needs re-linking anyway given it has been post-processed, so this doesn't add any unecessary extra processing.

Without this fix, if you modify a pt.json file or a private key, the ouptut binary will not have the correct pt/key.
2024-11-08 18:27:30 -06:00
Graham Sanderson
37c6b24b1b
Add missing instruction to vestigial copro_dis.py (#2018) 2024-11-05 10:53:19 -06:00
armandomontanez
07d6dc1315
[Bazel] Fix bazel build, add presubmit (#1973)
* [Bazel] Fix bazel build, add presubmit

* Fixes a missing dep in the Bazel build breaking the host build.
* Automagically finds all board headers.
* Improves presubmit script polish for GH Action readiness.
* Adds a GitHub action workflow for the Bazel build.
* Disable failing checks
* Disables Windows, as there's a mix of real build errors and
  overly-ambitious checks that don't work on Windows.
* Disables extra checks temporarily since it's currently failing.
2024-10-12 17:41:43 -05:00
armandomontanez
b49d4ec949
Fix Bazel build breakages (#1908)
* Fix Bazel build breakages

* Adds support for new PICO_DEFAULT_UART_BAUD_RATE option.
* Fixes issues related to Picotool and boot_picoboot_headers.
* Adds pico_float RISC-V pieces to the Bazel build (not yet fully
  tested).
* Adds the missing adafruit board header to the Bazel build.

* Exclude hazard3 float test in Bazel validation script

* Restore missing dependency in hardware_boot_lock
2024-09-10 18:44:55 -05:00
will-v-pi
dfb573818f
Use lib instead of CMAKE_INSTALL_LIBDIR for pioasm install (#1865) 2024-09-03 16:26:43 -05:00
Graham Sanderson
876f331033
bump picotool to the develop branch (#1886) 2024-08-29 19:14:50 -05:00
Andrew Scheller
d639292fea
Update extract configs (#1845)
* Update config-extraction scripts to work with multiple chips

* Standardise wording between common options

* Various config-related fixes

* Update pico_rand to use correct busctrl_hw struct-name

* Don't start config descriptions with "The ..."
2024-08-27 11:11:42 -05:00
Andrew Scheller
9a41722dd3
More board header checks (#1814)
* Modify check_board_header.py to work with both RP2040- and RP2350-based boards

* Tweaks to the board-header files so that they pass check_board_header.py

* Update tools/check_board_header.py
so that it handles pico_cmake_set_default the same way as cmake/generic_board.cmake does
2024-08-20 12:47:20 -05:00
graham sanderson
e930bf3261 Deprecate copro_dis.py - keep for now as it is used by bootrom build 2024-08-20 09:48:50 -05:00
graham sanderson
9430469e18 Revert "Delete tools/copro_dis.py (#1833)"
This reverts commit b271208071.
2024-08-20 09:48:50 -05:00
Andrew Scheller
b271208071
Delete tools/copro_dis.py (#1833)
This functionality has been moved into `picotool`, so remove this Python script to avoid confusion
2024-08-16 12:21:27 -05:00
graham sanderson
efe2103f9b SDK 2.0.0 release 2024-08-08 08:54:38 -05:00
Andrew Scheller
45984e276f
Small tweak to extract_configs.py (#1776)
Always write the path as "abosolute" (relative to the root of pico-sdk) as that makes searching for it (when building the RP2040 datasheet) much faster. This matches the behaviour of extract_build_defines.py and extract_cmake_configs.py
2024-07-25 15:13:00 -05:00
Andrew Scheller
9f85f25640
Add extra checks to check_board_header.py (#1775)
* Small whitespace fixup

* typo bugfix

* Small refactoring of check_board_header.py

* Make structure of rp2040_interface_pins.json more explicit, so that it can be more easily extended

* Move definition of valid-pins from python to json

* Check that each interface includes all (minimally) expected pins
Note that UART_CTS, UART_RTS & SPI_CSN are classed as optional

* Split "expected_functions" into "required" (all of these pins must be present) and "one_of" (at least one of these pins must be present)
2024-07-25 09:47:26 -05:00
Andrew Scheller
0e5cef3ffa
Boards header updates (#1724)
* Add script to automatically validate board header files

* Fix small automatically-found inconsistencies in various board header files

* Tweak and add board header file from abandoned PR #1174
2024-06-21 14:26:45 -05:00