Commit graph

1192 commits

Author SHA1 Message Date
graham sanderson
f994c26347 add typedefs and rename dma_channel_config to be consistent
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
2025-07-24 09:58:19 -05:00
graham sanderson
f5cb120250 more review fixes 2025-07-24 09:42:30 -05:00
Graham Sanderson
4c6823f6cb
Apply suggestions from code review
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2025-07-24 09:37:43 -05:00
graham sanderson
548c676fd9 Update docs, and add methods for new RP2350 dma_transfer modes
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
Update docs, and add methods for handling reversed/double-increment DMA
2025-07-23 15:07:16 -05:00
Graham Sanderson
d011e8abd4
add a task completion semaphore to guarantee async_context task is finished before async_context cleanup finishes (#2587)
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 13:35:26 -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
will-v-pi
58d000f210
Improve rom_pick_ab_update_partition docs (#2577)
* Improve rom_pick_ab_update_partition docs

* Some review fixups

Add more `\ref`s and tidy up wording

* Move function docs next to rom_pick_ab_partition

* Add \return to rom_pick_ab_partition docs

* Rename rom_pick_ab_update_partition -> rom_pick_ab_partition_during_update and replace "call"
2025-07-23 09:13:10 -05:00
Peter Harper
bf4906b1b5
Improve error code description for some cyw43 connection methods (#2586)
* Improve error code description for some cyw43 connection methods

Fixes #2564

* Apply suggestions from code review

Put error description on separate lines for clarity.

Co-authored-by: Andrew Scheller <lurch@durge.org>

---------

Co-authored-by: Andrew Scheller <lurch@durge.org>
2025-07-23 09:11:18 -05:00
Andrew Scheller
f194749d47
Update and expand docs/weblinks_page.md (#2575)
* Update and expand docs/weblinks_page.md

* Add link to RM2 datasheet too

* Updated shortlinks
2025-07-23 09:10:24 -05:00
will-v-pi
9b876bbc24
Fix location of map file on Ninja (#2584) 2025-07-23 08:51:36 -05:00
Fadhil Riyanto
2afa251201
fix typo "serialzed" -> "serialized" (#2583)
Signed-off-by: fadhil riyanto <me@fadev.org>
2025-07-23 08:46:21 -05:00
Graham Sanderson
2e2651f087
add default implementation of _get_entropy() that returns -1 to avoid linker warning (#2578)
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-22 10:39:07 -05:00
Luke Wren
dfc26a00b0
hardware_flash: preserve QSPI pad state over flash access calls. (#2565)
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
* hardware_flash: preserve QSPI pad state over flash access calls.

Add new function, flash_start_xip(), which explicitly performs a
first-time XIP setup (including initialising pads). This is mostly
useful for PICO_NO_FLASH=1 binaries where there is actually an attached
external flash.

Fixes #2333

* Address review comments
2025-07-20 17:19:38 -05:00
Luke Wren
175abe7315
Clarify pio_gpio_init doxygen (fixes #2387) (#2574)
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-07-18 15:51:36 +01: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
Jeunese
4003a64789
Merge style and grammar updates
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
* Update mainpage.md

Re-wrote to be in line with style guidance and to be easier to read.

* Changed "adjust" to "refine" (previously "fine-tune").

* Updated first paragraph of the "SDK design" section.

* Minor fixes

* Minor grammatical updates

* Changed "adjust and refine" to "tweak"
2025-07-18 10:27:41 +01:00
will-v-pi
f5e0371ad5
Make spacer sections allocatable (#2515)
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
* Default to allocating spacer sections (stack & heap), with PICO_CRT0_ALLOCATE_SPACERS config option to disable the behaviour

* Add pico_check_linker_script function to check for compatibility of custom linker scripts

* tweak error message

---------

Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2025-07-17 11:33:23 -05:00
Graham Sanderson
968289625b
Gpio to gpout clock handle (#2561)
* add gpio_to_gpout_clock_handle to encapsulate GPIO->gpout mapping

* oops; wrong parenthesis placement
2025-07-17 11:33:05 -05:00
Graham Sanderson
af518de1c3
add missing libraries to test/kitchen_sink and auto-gen includes (#2567)
* add missing libraries to test/kitchen_sink and auto-gen includes

* bazel fix
2025-07-17 11:32:46 -05:00
Graham Sanderson
d32d315624
minor tidying of hardware_rcp header; add an rcp_is_true() that is safe to use on RISC-V too (#2568) 2025-07-17 11:32:28 -05:00
will-v-pi
820a33a39f
Add Wi-Fi firmware partition support for Pico 2 W (#1969) 2025-07-17 09:21:24 -05:00
Timo Kokkonen
8fd7c60f09
Add WeAct RP2350B Core board support. (#2570)
Some checks failed
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
Check Board Headers / check-board-headers (push) Has been cancelled
* Add WeAct RP2350B Core board support.

* Update to new format.
2025-07-17 08:28:59 -05:00
Graham Sanderson
c7f37fc211
make gpio_acknowledge_irq inline (#2562)
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-16 08:17:40 -05:00
Peter Harper
e62cd02a1b
Powman fix (#2499)
* Fix powman_timer_use_gpio

Fixes #2471

* Fix docs for clock_gpio_init etc for RP2350

You can also use gpios 13 and 15 on RP2350

* macro-ify the mapping from GPI to ext_time_ref_source - note i kept this private for now, as it's a bit murky

---------

Co-authored-by: graham sanderson <graham.sanderson@raspberrypi.com>
2025-07-16 08:17:16 -05:00
will-v-pi
c1981f5253
Fix Windows CI (#2563)
Ninja is pre-installed on all Windows runners
2025-07-16 08:16:02 -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
rbryson74
19904be31f
Update makefsdata.py to support content encoding Fixes #2548 (#2549)
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
* Update makefsdata.py to support content encoding

changed makefsdata.py slightly to allow it to recognize files that have been manually gzipped (e.g. "mysite.css.gz") to send the proper Content-Encoding information in the response headers.

* Code review fix

---------

Co-authored-by: Peter Harper <peter.harper@raspberrypi.com>
2025-07-14 12:23:50 -05:00
Markus Gyger
a72865be12
Allow pio_encode_sideset_opt(0, value) (#2485) 2025-07-14 11:42:03 -05:00
Peter Harper
b3aed37a18
Provide an easy way to disable cyw43 logging (#2535)
* Provide an easy way to disable cyw43 logging

All cyw43 logging uses CYW43_PRINTF by default. To disable logging you
have to define this to do nothing. There's no simple way to achieve
this. Make it easier by adding PICO_CYW43_LOGGING_ENABLED which can be
set to zero to disable CYW43_PRINTF.

Fixes #2523

* teensy style change

---------

Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2025-07-14 11:29:28 -05:00
will-v-pi
69e018504d
Add PR branch check action (#2536) 2025-07-14 11:21:11 -05:00
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