Commit graph

917 commits

Author SHA1 Message Date
William Vinnicombe
1ae7e0b9c8 Add customisable heap location, with pico_set_linker_script_var function 2026-03-06 16:04:04 +00:00
William Vinnicombe
18e65fad16 Separate linker scripts out into include files
Allows for much simpler custom linker scripts
2026-03-06 16:04:04 +00:00
William Vinnicombe
ef57fea213 fixups 2026-03-06 16:04:04 +00:00
William Vinnicombe
c96479599d Fix some kitchen sink errors 2026-03-06 16:04:04 +00:00
William Vinnicombe
01a398bd09 Fix hardware_rosc bazel build 2026-03-06 16:04:04 +00:00
William Vinnicombe
27d41e67e6 Add bazel build, and some CMake function docs 2026-03-06 16:04:04 +00:00
William Vinnicombe
71c3dadd97 Fix powman doc
https://forums.raspberrypi.com/viewtopic.php?t=391783
2026-03-06 16:04:04 +00:00
William Vinnicombe
d6d59d0a48 Use better runtime_init_rp2350_sleep_fix
Use dummy IRQ, rather than a timer
2026-03-06 16:04:04 +00:00
William Vinnicombe
c32de66f23 Add support for sleep, dormant, and powman with tinyusb device and host
Deinit and init tusb as required, and keep clocks on during sleep
2026-03-06 16:04:04 +00:00
William Vinnicombe
d0568c0edd Update xip pinning load map
size of 0 works
2026-03-06 16:04:04 +00:00
William Vinnicombe
851dfcb982 Fix infinite loop with no persistent data 2026-03-06 16:04:04 +00:00
William Vinnicombe
bcff0549fc Implement low_power_sleep_until_irq
Add to hello_sleep_gpio test using chars_available_callback
2026-03-06 16:04:04 +00:00
William Vinnicombe
69f8242a51 Add USB support and chars_available callback
Also add no_flash test for RP2350
2026-03-06 16:04:04 +00:00
William Vinnicombe
d35381a57b Persistent data now zeroed on non-persisted boot 2026-03-06 16:04:04 +00:00
William Vinnicombe
a90ee5cecb Make persistent_data NOLOAD
This allows sealing, but does mean you have to initialise it (like uninitialised_data)
2026-03-06 16:04:04 +00:00
William Vinnicombe
66c5479c53 Accept NULL pstate as default 2026-03-06 16:04:04 +00:00
William Vinnicombe
faf5025d5b Add runtime init function to unpin xip cache that isn't persistent data 2026-03-06 16:04:04 +00:00
William Vinnicombe
94754f8dbc Redo memory handling
Now only persists __persistent_data, and adds low_power_persistent_pstate_get function to return the pstate that persists all that data

This uses a new pico_ld_constants.ld file, to allow CMake to modify the addresses of persistent data and the heap

This new __persistent_data is only supported with HAS_POWMAN_TIMER, and does not work if your binary is signed
2026-03-06 16:04:04 +00:00
William Vinnicombe
471abd7a7f Tidy up non-RP2040 defines
Use HAS_POWMAN_TIMER instead
2026-03-06 16:03:17 +00:00
William Vinnicombe
db151e1302 Add Risc-V crt0 data_cpy skip
Also shrink Arm one, and standardise PICO_NO_FLASH skipped code between them
2026-03-06 16:03:17 +00:00
William Vinnicombe
42f33036bd Add skips of data_copy in arm crt0 2026-03-06 16:03:17 +00:00
William Vinnicombe
50069f06aa Implement exclusive variable when sleeping
Disables all other interrupts
2026-03-06 16:03:17 +00:00
William Vinnicombe
657f9ed067 Pass low power state through powman reboot, so software knows what wasn't persisted
Also fix riscv
2026-03-06 16:03:17 +00:00
William Vinnicombe
9bf9fffd7c Add support for RP2040 dormant (using external RTC clock) 2026-03-06 16:03:17 +00:00
William Vinnicombe
83d1e65f1e Fix hello_sleep_gpio on RP2040 2026-03-06 16:03:17 +00:00
William Vinnicombe
9423fb5202 Fix pin_state functions on RP2350
Don't seem to work on RP2040
2026-03-06 16:03:17 +00:00
William Vinnicombe
03cd9ef681 Implement pstate functions 2026-03-06 16:03:17 +00:00
William Vinnicombe
eb89a06c64 Make it compile and work with RP2040 and RP2350
Includes AMY-1782 workaround
2026-03-06 16:03:17 +00:00
Liam Fraser
991fc65582 Add sleep3 notes from meeting 2026-03-06 16:03:17 +00:00
graham sanderson
b1cc5ace59 transplant sleep2 onto develop 2026-03-06 16:03:17 +00: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
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