Commit graph

1161 commits

Author SHA1 Message Date
will-v-pi
4ee09729cf
Use platform/generator agnostic CMake commands (#2539)
* Use platform/generator agnostic CMake commands

Change the README to use platform/generator agnostic commands to create and build the CMake project

* review fixup

* Apply suggestions from code review

Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>

* Whitespace fix

---------

Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2025-07-14 11:20:55 -05:00
Peter Harper
214c24386a
Add a "quick start" section for RISC-V to the readme (#2537)
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
2025-07-02 09:42:53 -05:00
BogDan Vatra
e5acd29d86
Added Olimex RP2350-PICO2-XL&XXL boards (#2541)
https://github.com/OLIMEX/RP2350-PICO2-XXL
2025-07-02 09:41:25 -05:00
Graham Sanderson
d7c26e68e2
add armv8m.main_soft_nofp_unaligned as a supporter clang runtime (for 20.1.0) (#2542)
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 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
2025-06-30 08:11:17 -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
eightycc
8fb131a70f
Fix powman powman_configure_wakeup_state and powman_get_power_state (#2516)
* fix powman_get_power_state (#2506)

* fix powman_configure_wakeup_state (#2511)
2025-06-20 09:00:25 -05:00
Philip Howard
7b4b2b760d
Add POWMAN_PASSWORD_BITS to pico_bootsel_via_double_reset. (#2532)
Fix pico_bootsel_via_double_reset for RP2350.

Signed-off-by: Phil Howard <github@gadgetoid.com>
2025-06-19 10:41:26 -05:00
graham sanderson
52ec9ecd5f downgrade hard_assert to assert 2025-06-19 09:11:46 -05:00
graham sanderson
44527b4f08 fix compiler warning 2025-06-19 09:10:07 -05:00
Goran Miskovic
b1ca434581
async_context_threadsafe_background: fix incorrect mutex assertion in cross-core execute_sync() (#2528)
* async_context_threadsafe_background: fix incorrect mutex assertion in cross-core execute_sync()

In multicore configurations, `async_context_threadsafe_background_execute_sync()`
contained an overly strict assertion used during cross-core calls:

```c
hard_assert(!recursive_mutex_enter_count(&self->lock_mutex));
```

This check fails whenever the `lock_mutex` is held — regardless of *who*
owns it — even in valid situations where the async core is processing background
work.

The assertion does **not check ownership**, only that the `enter_count` is zero,
which leads to false-positive failures on valid cross-core calls.

This patch replaces the enter-count check with a core-aware assertion:

```c
hard_assert(self->lock_mutex.owner != calling_core);
```

This ensures the current core does not recursively hold the mutex, preventing
deadlocks while allowing valid usage where the *other* core owns the lock.

The patch ensures that both `get_core_num()` and `hard_assert()` remain inlined
as in the original implementation, preserving the performance characteristics
under `-Os` and `RelWithDebInfo` builds.

Fixes #2527

Signed-off-by: Goran Mišković <schkovich@users.noreply.github.com>

* fix indents

* Update async_context_threadsafe_background.c

Use pre-existing mutex owner method; add a comment

* oops

* typo

* Update async_context_threadsafe_background.c

---------

Signed-off-by: Goran Mišković <schkovich@users.noreply.github.com>
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2025-06-19 08:57:07 -05:00
Tom
a24bc13301
Add board header for Waveshare RP2350-USB-A (#2435)
* Add definition for the Waveshare RP2350-USB-A board

* Set XOSC startup delay multiplier for the RP2350-USB-A

* Update waveshare_rp2350_usb_a.h

Tweak to the PICO_DEFAULT_PIO_USB_DP_PIN define

---------

Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2025-06-19 08:46:12 -05:00
Andrew Scheller
d45a09039c
Fix ms/us confusion around watchdog time_remaining functions (#2533)
Fix documention for watchdog_get_time_remaining_ms and add a new watchdog_get_time_remaining_us
Fixes #2496
2025-06-19 08:43:22 -05:00
Peter Harper
24af10a6a2
Use cyw43 macros for bluetooth logging (#2490)
* Tidy up bt logging

Fixes #2253

* Allow logging to be overridden
2025-06-18 17:08:35 -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
Michael Brase
5ddb441cf1
async_context_freertos: Add support for configSUPPORT_STATIC_ALLOCATION (#2436)
* async_context_freertos: Add support for configSUPPORT_STATIC_ALLOCATION

The implementation of async_context_freertos currently assumes that
FreeRTOS has been configured with `configSUPPORT_DYNAMIC_ALLOCATION`,
which causes it to allocate semaphores, timers and tasks from the heap.
However, some projects may prefer `configSUPPORT_STATIC_ALLOCATION`,
which requires memory to be allocated ahead of time. This change allows
async_context_freertos to support either static or dynamic allocation.

The way this works is when `configSUPPORT_STATIC_ALLOCATION` is enabled,
`async_context_freertos` struct will reserve extra space for the static
objects (e.g. `StaticSemaphore_t`) and it will prefer to use the static
creation functions (e.g. `xSemaphoreCreateBinaryStatic()`). For the task
creation, the user will be responsible for allocating the stack memory
and setting the task_stack field in `async_context_freertos_config_t`.
For convenience, The `cyw43_arch_init_default_async_context()` function
will reserve `CYW43_TASK_STACK_SIZE` words of stack space in static
memory.

* Assert that task_stack is set

* Add CYW43_NO_DEFAULT_TASK_STACK

In theory you can use your own async context therefore bypassing
cyw43_arch_init_default_async_context, which would leave
cyw43_async_context_freertos_task_stack unused.

Add a #define for this rare situation.

* Update documentaton for async_context_freertos_config.task_stack

---------

Co-authored-by: Peter Harper <peter.harper@raspberrypi.com>
2025-06-18 17:06:34 -05:00
UUGear
893a06bb80
Add UUGear Witty Pi 5 HAT+ board header file (#2518)
* Add UUGear Witty Pi 5 HAT+ board header file

* Update uugear_wittypi5_hat_plus.h

Fixes detected errors
2025-06-18 10:21:18 -05:00
Dan Halbert
dddb5146d5
Adafruit Fruit Jam board (#2363)
* Adafruit Fruit Jam board

* add Adafruit Fruit Jam specific pins

* fix pin typos and errors

* update to Fruit Jam rev D, address #2510 review

* add additional PICO_DEFAULT_* pins

* add PICO_AUDIO_I2S_* pins
2025-06-18 10:19:59 -05:00
Joel Murphy
7d58f95108
Add board definition for Adafruit Feather RP2040 Adalogger (#2524)
* Add board definition for Adafruit Feather RP2040 Adalogger

* Fix default SPI instance and pin mapping
2025-06-18 10:19:11 -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
Andrew Scheller
a7ec8c3f79
Fix the "type" of SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST_DELAY_US (#2531)
It's int, not bool
2025-06-18 08:34:48 -05:00
Mark Hermeling
a9851a1577
remove unnecessary escaping (#2526)
* remove unnecessary escaping

* Removed one too many \

* I removed 2 necessary \
2025-06-16 17:46:08 -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
Andrew Scheller
e6d18920c7
RP2040 and RP2350 have different maximum watchdog delays (#2500) 2025-06-12 17:43:53 -05:00
will-v-pi
a1faacff07
Remove reference to wafer_id (#2512)
`wafer_id` is not correct, as it is a 64-bit `device_ID` instead of a separate `device_id` and `wafer_id`
2025-06-10 08:49:04 -05:00
Marek Küthe
d7abd66dea
Fix typo (#2508) 2025-06-09 09:37:20 -05:00
Goran Miskovic
a9146b65ad
fix(async_context_threadsafe_background_execute_sync): prevent use-after-return by removing worker before semaphore release (#2494)
Ensures the async worker is unregistered from the context before releasing the
blocking thread. This prevents the `sync_func_call_t` stack object from being
accessed after it goes out of scope, avoiding a use-after-return condition
in multicore `async_context_execute_sync()` scenarios.

Fixes raspberrypi/pico-sdk#2433

Signed-off-by: Goran Mišković <schkovich@users.noreply.github.com>
2025-06-03 11:06:35 -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
6860f0d882
Call enable_interrupts when initialising IRQs (#2491)
* Call enable_interrupts when initialising IRQs

Fixes raspberrypi/pico-examples#584, supercedes raspberrypi/pico-examples#588

* move enable_interrupts to the end though it doesn't make much difference

* guard enable_interrupts by !RP2040 as it isn't needed there

---------

Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2025-05-30 08:33:04 -05:00
armandomontanez
67f89e44aa
Update Bazel pin, ignore build-* directories (#2461)
Updates the Bazel pin to 8.1.0 so that build-* directories can be
properly ignored.
2025-05-29 08:25:46 -05:00
Graham Sanderson
0722de395c
add new M33 processor exception handlers (#2482) 2025-05-29 08:18:05 -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
Andrew Scheller
9fdfe110dc
Remove accidental comment words in stdio.h (#2480) 2025-05-23 07:15:44 -05:00
Graham Sanderson
c9c38252ec
remove assembler warning if StackSize or HeapSize are explicitly set to zero (#2465) 2025-05-21 06:57:09 -05:00
Jack Whitham
3515dad632
Fix multicore_lockout features so that the victim core cannot become stuck in an infinite loop if the lockout attempt times out (#2467)
* Fix issue 2454 flash safe execute lockout

The lockout state is controlled by a shared variable. The FIFO
is used to begin a lockout and acknowledge it (i.e.
multicore_lockout_handshake works as before) but the end
of the lockout is now signalled by updating the shared variable.
This ensures that timeouts are recognised reliably by the victim core.
__wfe and __sev are used to signal updates to the shared variable
in order to avoid polling.

* Update documentation for multicore_lockout_end functions

* Simplification, remove magic number (not required)

* Review improvements

* Restore use of non-zero magic number
2025-05-20 15:43:06 -05:00
Sergio R. Caprile
47f288b5d6
Add support for wiznet_w5100s_evb_pico2 (#2458)
* Add support for wiznet_w5100s_evb_pico2

This board has an RP2350 and a smaller 2MB flash

Signed-off-by: Sergio R. Caprile <scaprile@gmail.com>

* update to new syntax

Signed-off-by: Sergio R. Caprile <scaprile@gmail.com>

* fix missing definition

Signed-off-by: Sergio R. Caprile <scaprile@gmail.com>

---------

Signed-off-by: Sergio R. Caprile <scaprile@gmail.com>
2025-05-20 15:41:49 -05:00
will-v-pi
cbd765644b
Minor fixups to compile with TF-M (#2403)
* Minor fixups to compile with TF-M

TF-M requires c99 compatibility, which throws errors at these lines

This patch fixes those errors and is currently applied by TF-M when cloning the SDK, but it would be better to get it into the SDK by default so that patch isn't needed

* #ifdef only on __STRICT_ANSI__

Also fix devinfo type
2025-05-20 15:41:30 -05:00
Graham Sanderson
8066bee734
give user more control over embedded_start_block.S contents (#2470) 2025-05-20 15:32:27 -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
Graham Sanderson
550aa09624
fix typo in PICO_RUNTIME_SKIP_INIT_POST_CLOCK_RESETS (was missing INIT) (#2457) 2025-05-11 20:34:17 -05:00
Michael Brase
792f55628e
Use cyw43_delay_ms() in cyw43_spi_reset() instead of sleep_ms() (#2431)
Since cyw43_spi_reset() may be executed from an async context, we
should use cyw43_delay_ms() instead of sleep_ms(). This is particularly
a problem when using the async_context_threadsafe_background backend,
because sleep_ms() will assert in an ISR.
2025-05-08 10:26:08 -05:00
Graham Sanderson
799225d550
Add PICO_CRT0_NEAR_CALLS to indicate that crt0 can call runtimine_init/main/exit etc via near calls (#2452)
---------

Co-authored-by: will-v-pi <108662275+will-v-pi@users.noreply.github.com>
2025-05-07 08:56:40 -05:00
Graham Sanderson
7cdb8eca57
Add PICO_CRT0_NO_RESET_SECTION (#2453) 2025-05-07 08:56:19 -05:00
Andrew Scheller
0779dfe3eb
Small PICO_CONFIG tweak (#2456) 2025-05-06 09:14:20 -05:00
Tommy G
25789c433f
Fix wrong value used for lposc_freq_khz_frac and xosc_freq_khz_frac 2025-05-04 14:21:00 -05:00
Andrew Brock
ec25563b82
Fix binary_info compilation in C++ due to out-of-order designated initialisers (#2438) 2025-05-04 12:57:04 -05:00
Peter Harper
4bbd53371e
Fix sha build issues with mbedtls 3.x (#2447)
The mbedtls methods have dropped the "_ret" from the function names in
mbedtls 3.x. Use the new function names but support the old names if
mbedtls 2.x is used.
2025-05-02 08:42:53 -05:00
Peter Harper
0de8847b99
Crashes after calling btstack_cyw43_deinit (#2446)
You can deinitialise cyw43 and btstack by calling btstack_cyw43_deinit
but its pending and timeout workers are not removed which means they can
keep running, whcih causes a crash.

Add a btstack_run_loop_async_context_deinit method and call this from
btstack_cyw43_deinit.
2025-05-01 10:35:29 -05:00
Peter Harper
31fadf42eb
Revert "Add --recursive flag to git submodule cmd (#2416)" (#2445)
This reverts commit 5592322465.
2025-05-01 10:31:35 -05:00