Commit graph

1276 commits

Author SHA1 Message Date
Peter N Lewis
bc5481455f
Document Clock Divider = 1 in pio_get_default_sm_config in pio.h (#2863)
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
Add Clock Divider = 1 to documentation of pio_get_default_sm_config
2026-03-11 15:16:44 -05:00
graham sanderson
e000ba1f43 Revert "Update Clang toolchain used by Bazel (#2860)"
This reverts commit 5e99331e8d.
2026-03-11 14:32:14 -05: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
Prabhu Rajasekaran
5e99331e8d
Update Clang toolchain used by Bazel (#2860)
The Clang toolchain is updated to a newer revision
cb3d7ffb09e8be115da1fd57a6c09860e89f5449 from Feb 23, 2026.
2026-03-11 13:21:51 -05:00
Peter Harper
dd2d122366
Update btstack v1.8 (#2848)
* Update btstack to v1.8
2026-03-11 10:48:44 +00:00
Petr Hosek
429775b480
Use alternate macro mode to evaluate expressions (#2781)
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
Without the alternate macro mode, when building with Clang, the
arguments to macros weren't evaluated.
2026-03-09 16:56:20 +00:00
Andrew Scheller
18ca0c8751
Add return-value to Doxyegn for clock_configure_gpin (#2855)
(copied from Doxygen for clock_configure)
2026-03-09 10:00:25 -05:00
Graham Sanderson
7b2d0ffeb4
Additional float fixes (#2853)
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
* ensure that fix<>float methods (not inline versions) are called too in VFP tests

* remove sf_table.h include from float.h as it is not part of the public API

* fix float->fixed/int infinite conversions via VFP

* 2 instructions -> 1

* add missing call_ tests for float2fix_z and float2ufix_z

* fix test descriptions

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

---------

Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2026-03-07 12:40:32 -06:00
Graham Sanderson
47226c63cf
various floating point fixes (#2849)
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
* fix issues with and improve tests for dcp conversions of INFINITES to fixed point values

* improve comments

* fix outstanding todo in __aeabi_dmul via DCP which improves speed/size

* fix missing DCP state saves for float2int, float2uint and float2fix

* slightly improve implementation of saturation of INFINITES

* should not include sf_table.h in double.h

* point out that float/double->fixed/int saturate in the docs

* move some doxygen into RP2350 specific and change include guards ro be RP2350 specific

* more doc tweaks

* fixup check names to be more consistent
2026-03-06 13:48:11 -06:00
Andrew Scheller
549674a68b
Check for parameter underflow when PIO_USE_GPIO_BASE is in use (#2618)
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
* Fix PIO comment and assertion typos

* Add (and use) 32-bit version of check_pio_pin_mask64

* minor comment tidyup

* small code size improvement

* oops

* hmm

* fix typos

---------

Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2026-03-05 15:43:11 -06:00
Luke Wren
e7b0dbc44c
Fix some errors from -fanalyzer. (#2697)
* Fix some errors from -fanalyzer.

Includes a genuine bug in multicore_doorbell_claim() which seemed to use the wrong bit for the second core.

* Return NULL instead of panicking on secondary allocation fail in pico_time
2026-03-05 15:42:21 -06:00
Graham Sanderson
9c20a62fa5
Force fflush of stdout after printf when using pico_set_printf_implementation(compiler) and PICO_STDIO_SHORT_CIRCUIT_CLIB_FUNCS as a semi-workaround for the c library buffering stdout during printf (#2821)
Note: the correct solution would be to flush stdout in the short-circuited functions, but this rather destroys the point of making them fast.

This takes care of the common case. For complete/best support use PICO_STDIO_SHORT_CIRCUIT_CLIB_FUNCS=0 when using compiler printf
2026-03-05 12:10:54 -06:00
Graham Sanderson
9a4766867d
Add support for hard float on M33 via CMake variable PICO_HARD_FLOAT_ABI=1 (#2822)
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
* Enable hard-float ABI support for pico_float and pico_double on m33

Resolves #2783

Signed-off-by: Andy Lin <andylinpersonal@gmail.com>

* Add (non google) LLVM support, and replace calling convention check with #if defined(__ARM_PCS_VFP)

* switch float.h to use static inline method for int2float() etc in VFP mode rather than #define

* float/double test cleanup - particularly:

- splitting out executable for each test type for pico_float/double_test
- removing undefined behavior from custom_float_funcs_test.c, to de-confuse clang
- add test of denormal->int

Note some tests still fail on llvm libc (at least version 19)

* fix some issues with newer llvm_libc/compiler as used by bazel build

* keep check_configs happy

* another bazel issue

* introduce pico_double_pico_dcp for consistency

* fixup debug output based on previous commit

* remove unnecessary build guard from double_conv_m33.S

* allow -1 for neg_denormal->int rounding towards minus infinity

* Update test/pico_float_test/CMakeLists.txt

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

* Update test/pico_float_test/CMakeLists.txt

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

* - add fma/_fast functions to pico_float_test/pico_double_test
- fix guard for TEST_SATURATION in pico_double_test - GCC doesn't clamp either

* - double functions were only wrapped in pico_double_pico not pico_double_pico_dcp explicitly (i.e. explicitly setting double impl to pico_dcp was not selecting our versions)

* avoid extra stack alignment push (per review comment)

* fix fma return code in VFP mode (register transfer was the wrong way around)

* separate PCS=VFP and non-PCS-VFP versions of fma_fast

* remove saving_func_return (which is just bx lr) and fold the separate pop of lr, into a pop of pc

* better fix for wrapping right libraries

* rename some labels from _entry (which is an internal entry point) to _softfp to be clear that these are the function entry points which work with softfp calling conventions

* Make bazel pico_float build not wrap SCI functions on RISC-V to match CMake build

* Split out FMAF as a selectable wrapped item since we don't want to wrap it for VFP

* fix typos

* fix test

---------

Signed-off-by: Andy Lin <andylinpersonal@gmail.com>
Co-authored-by: Andy Lin <andylinpersonal@gmail.com>
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2026-03-04 10:22:27 -06:00
Nephtaly Aniceta
70d9032faa
Fix bit mask in powman_set_debug_power_request_ignored (#2826)
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
Fixed a one-off error
2026-03-02 14:53:19 -06: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
martijn
33c01e9531
Update CMakeLists.txt (#2711) 2026-03-02 13:40:59 -06:00
Andrew Kohlsmith
9fce82f9d8
remove guards that disable sdio_usb when tinyusb_host is linked in (#2764)
* remove guards that disable sdio_usb when tinyusb_host is linked in; it works just fine

* implement better guards
2026-03-02 13:34:25 -06:00
Nephtaly Aniceta
3f1ab22951
Update pico-examples link for Bluetooth documentation (#2828)
Updated broken link
2026-03-02 19:23:54 +00:00
Andrew Scheller
ab51a83a3a
Rename pio_claim_free_sm_and_add_program_for_gpio_range's gpio_base parameter to gpio_start (#2831)
in order to avoid confusion with pio_set_gpio_base's gpio_base parameter
2026-03-02 13:17:15 -06:00
Andrew Scheller
0ff0974c0a
Change a couple of hardcoded numbers to PIO_INSTRUCTION_COUNT for clarity (#2832)
* Change a couple of hardcoded numbers to PIO_INSTRUCTION_COUNT

for clarity

* fix sign-compare warning
2026-03-02 13:15:58 -06:00
Michel Le Bihan
0da73ec045
Correct Seeed XIAO RP2350 flash size from 4MB to 2MB (#2837)
Fixes #2834
2026-03-02 13:13:59 -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
Andrew Kohlsmith
a1e9cf05b2
fix panic message in multicore_doorbell_claim_unused
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
2026-02-07 20:17:23 -06:00
Andy Lin
abd7c9ad2a
Fix RP2040 crash with PICO_*_IN_RAM and NaN propagation (#2772)
``__check_nan<f|d><1|2>`` is hard-coded into ``.text`` instead
of being wrapped with ``<double|float>_section`` like other
``__aeabi*`` functions. When those functions are moved to SRAM,
this leaves ``__check_nan*`` in flash, causing GCC to emit a veneer
call that clobbers ip and corrupts the saved ``lr`` in
``wrapper_func_<d|f><1|2>``.

Fixes #2771

Signed-off-by: Andy Lin <andylinpersonal@gmail.com>
2026-02-07 20:15:48 -06:00
Andrew Scheller
dc4be9c54e
ADC FIFO depth is the same on both RP2040 and RP2350 (#2806)
Both chips have "8 element receive sample FIFO"
2026-02-07 20:12:11 -06:00
Graham Sanderson
218603253b
make host hardware_ libraries depend on hardware_claim too as it was moved to common in 2.0.0 (#2786) 2026-02-07 20:02:16 -06:00
FLyrfors-MI
e7aed3261b
Correct printf format in pheap.c (#2814)
See #2813
2026-02-07 15:26:00 -06:00
will-v-pi
1ed42558a5
Fix Risc-V binaries when pico_float_none is set (#2800)
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
2026-02-03 17:38:34 -06:00
Jaylon Gowie
9c6713a8ed
Change PICO_SD_DAT3_PIN from 8 to 9 (#2769)
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
Pin 8 is for PSRAM Chip Select, not SD card. This seems to be an oversight
2026-01-07 17:05:13 -06:00
Andy Lin
6ec9ea0657
Add WeAct RP2350A core board V10 (#2777)
Signed-off-by: Andy Lin <andylinpersonal@gmail.com>
2026-01-07 17:04:36 -06:00
Romain
e316b9b6f9
Fix typo in gpio.h (#2705)
Align the comments and documentation with the correct constant name
2026-01-07 16:29:17 -06:00
Disappear9
9437573186
Add board definition for nologo RP2350 USB (#2767)
* Add header for nologo_rp2350_usb board configuration

* Remove PICO_SMPS_MODE_PIN definition

Removed definition for PICO_SMPS_MODE_PIN.

* Update nologo_rp2350_usb.h
2026-01-07 16:27:45 -06:00
Richard Hulme
52d3592d41
Add missing dependency to hardware_timer in host-mode pico-platform (#2734)
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
Fixes #2733
2026-01-05 17:11:12 -06:00
Petr Hosek
1cc19a2130
Omit semicolons after _Pragma directives (#2780)
These are not statements and shouldn't be terminated by semicolons; in
newer versions of Clang separating these by semicolons results in a
build error.

We can also further simplify `remove_volatile_cast` by using the comma
operator and avoiding the reliance on non-standard GNU extensions.
2026-01-05 16:56:29 -06:00
madh4tter
9ecafe71d1
Multicore documentation fix (#2703)
* Multicore documentation fix

* Update src/rp2_common/pico_multicore/include/pico/multicore.h

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

---------

Co-authored-by: TITLEY\adam.nelson <adam.nelson@titley-scientific.com>
Co-authored-by: Andrew Scheller <lurch@durge.org>
2026-01-05 16:55:13 -06:00
graham sanderson
578dabb60b fix host build error of pico_stdlib_test caused by recent host changes 2026-01-05 16:23:09 -06:00
Petr Hosek
f600a5bd9e
Update the localtime_r declaration for LLVM libc (#2775)
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
This is to match upstream declaration and avoid conflicting declaration
error. This declaration will be removed after the next Clang update
since LLVM libc now implements localtime_r but we keep the declaration
for now to allow soft transition for SDK users.
2026-01-05 12:09:55 -06:00
BlockListed
a3dbebb184
correct reference to rp2350 (#2762) 2026-01-05 11:48:08 -06:00
Andrew Scheller
8f5b574782
Add missing pio_encode_wait_jmppin function to pio_instructions.h (#2755) 2026-01-05 11:47:16 -06:00
Richard Hulme
6665319aad
Add pico_unique_id library to host platform (#2751)
Fixes #2750
2026-01-05 11:43:51 -06:00
Richard Hulme
9d1b3c691d
Add definition of PICO_NUM_VTABLE_IRQS to host build (#2749)
Fixes #2748
2026-01-05 11:41:58 -06:00
Richard Hulme
c0b8539242
Host GPIO improvements (#2737)
* Add empty 'check_gpio_param' to host GPIO

All the approriate gpio_xxx functions now call check_gpio_param.  This
provides an easy way for a project to add simple range checking by
defining a final version of check_gpio_param, which whatever error
mechanism it chooses if an invalid value is passed.

Refs #2736

* Declare all host GPIO functions weak

This allows them to be easily overridden by user code for testing
purposes.

Refs #2736

* Mark all parameters in host GPIO unused

This prevents lots of compiler warnings if the default warning level
is increased.

Refs #2736

* Add missing functions/types to host GPIO

Some RP2350 GPIO_FUNC_ enums don't match the values defined in the
rp2350 hardware header but the actual values shouldn't matter if only
the enums are used (i.e. no magic numbers).

Refs #2736
2026-01-05 11:40:37 -06:00
Richard Hulme
f37481723e
Fix incorrect Bazel dependency in host/hardware_irq (#2739)
Bazel configuration adds a dependency on hardware_claim in 'host' but
it doesn't exist there.  It's in 'common'.

Fixes #2738
2026-01-05 11:37:10 -06:00
Andrew Scheller
49451b38cb
Fix small Doxygen syntax-typos (#2730) 2026-01-05 11:31:08 -06:00
Peter Harper
5986b8386c
Set picotest_error_code in PICOTEST_CHECK_AND_ABORT (#2722)
Fixes #2721
2026-01-05 11:30:19 -06:00
Earle F. Philhower, III
2e3374ba37
Make private async_context_*_execute_sync static (#2679)
Fixes #2678

The FreeRTOS, Poll, and Threadsafe async_context implementations have
execute_sync functions that's set as a member of their
async_context_type_t struct for use by the user-visible async_context
API.  These implementation functions should not be accessible
by user code which chouls only use async_context_execute_sync and
not the low-lever async_context_{freertos,poll,threadsafe}_execute_sync
implementation.

Make these private functions static like the other low-level functions
in the async_context_type_t struct.
2026-01-05 11:23:41 -06:00
drewpo28
a9c381dc3f
Added Waveshare RP2350 PiZero board header (#2674)
Co-authored-by: Andrew Pochinchik <andrew.pochinchik@ftco.ltd>
2026-01-05 11:22:04 -06:00
m24goller09
a13f46a11e
Fixed multicore_doorbell_claim_under_lock (#2667) 2026-01-05 11:21:24 -06:00
will-v-pi
5c419dcfba
Add PICO_CONFIG entries for the metadata block configuration defines (#2671)
Includes rejigging it a bit, as the checking script requires #defines for all configs
2026-01-05 11:17:53 -06:00
Jérôme Hordies
645df1b99a
Add Raspberry Pi 500's RP2040 board support Fixes #2640 (#2641)
* Add Raspberry Pi 500 board support

- W25X10CL flash configuration for DSPI mode
- USB standalone operation support
- Complete GPIO pin documentation with keyboard matrix mapping
- Debug UART configuration on GP16
- Hardware-specific boot and power management settings

Tested with TinyUSB MIDI example - successful enumeration and operation.

* Correct Pi 500 board support: RP2040 chip, proper naming

- Rename to raspberry_pi_pi500_rp2040.h for clarity
- Correct chip type from RP2350 to RP2040
- Remove pico2.h inheritance, use self-contained definitions
- Add comprehensive GPIO pin mapping documentation
- Include critical power management warning
- Configure W25X10CL flash support for RP2040

* PICO_RP2040_B0_SUPPORTED can be changed to 0, since all Pi 500s are using RP2040 B2.

* Update Raspberry Pi 500 board support for minimal original intent.
- Fix mistake done in pico.h PICO_RP2040_B0_SUPPORTED 0 => 1
- Disable B0 support in pi500_rp2040
- Fix flash size 1M-Bit not 1Mb
- Add Matrix pin definition

* Fix flash size.
Add warning on GP19
Remove GP17

* Adding UART TX GP16

* Add Caps led as default led

---------

Co-authored-by: Jerome Hordies <jerome.hordies.ext@luminus.be>
2026-01-05 11:15:54 -06:00