Commit graph

1226 commits

Author SHA1 Message Date
Luke Wren
65d118c342
RISC-V __mulsf3: handle exponent increase due to rounding (#2086) 2024-11-23 13:02:03 -06:00
Graham Sanderson
39a7f97116
Cleanup/clarification of PIO behavior with >32 pins (#2085) 2024-11-22 13:13:15 -06:00
Graham Sanderson
3dce58f21b
support both struct timespec and struct tm variants of the aon timer APIs (#2079)
* support both struct timespec and struct tm variants of the aon timer APIs since use of one type on RP2040 and the other on RP2350 require pulling in C library code. Provide weak pico_ wrappers for localtime_r and mktime so that the user can override the conversion functions
2024-11-22 12:11:02 -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
08ea1d89a9
prevent self-deadlock with PICOLIBC due to calloc/realloc internally calling malloc/free (#2069) 2024-11-21 16:53:24 -06:00
Luke Wren
7b07b0b6a1
Save/restore QMI window 1 registers across calls to flash_exit_xip(). (#2082)
* Save/restore QMI window 1 registers across calls to flash_exit_xip().

This works around the RP2350 ROM reinitialising window 1 even when it
does not actually issue an XIP exit sequence to that QSPI device. If no
exit sequence is issued, then the original configuration still applies.

This is not valid in the case where the ROM *does* issue an XIP exit
sequence to the second chip select, because the original mode is no
longer valid once the device is in the serial command state. The ROM
does this when FLASH_DEVINFO (loaded from OTP, stored in boot RAM) has a
nonzero size for chip select 1. To distinguish the two cases, this patch
adds getters/setters for FLASH_DEVINFO.

If chip select 1 has a nonzero size in FLASH_DEVINFO then the ROM's
register changes for window 1 are not reverted, and instead the
hardware_flash code makes additional changes to ensure writes also work
(as the ROM only reinitialises for reads).

This means that, in the case you have opted into ROM support for the
second chip select by setting a nonzero CS1 size in FLASH_DEVINFO, the
device on chip select 1 will continue to function correctly, but full
performance won't be restored until it is reinitialised. The best way to
handle this is initialising both chip select devices in your XIP setup
function (your boot2).

* Fix whitespace. Fix handling of PICO_FLASH_SIZE_BYTES == 0.
2024-11-21 16:52:34 -06:00
Graham Sanderson
9762b00c13
disable all IRQs in dma_chanel_cleanup - fixes for RP2350 (#2060) 2024-11-21 16:52:04 -06:00
Graham Sanderson
6bb44dd07d
Make all float->int/frac conversions round to nearest by default (#2065)
* making pio_calculate_clkdiv8_from_float round to the neareset 1/256 (not lower 1/256)

* chage rounding of all float clkdivs to round to neareset; default to nearest (which is a backwards incompatible change, but I think OK), and add ability to turn it off

* fix copy/paste errors in PICO_CONFIG

* Calculate size of FRAC field using its own MSB and LSB, rather than hoping that INT_LSB is in the right place

* Add a new REG_FIELD_WIDTH macro, and make the calculation of the clock-dividers more consistent

---------

Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2024-11-21 16:48:33 -06:00
Graham Sanderson
5a98889434
add rom_reset_usb_boot_extra which supports >32 pins and ACTIVE_LOW; change existing uses to use this (#2084) 2024-11-21 16:48:05 -06:00
Graham Sanderson
6bb3ccf822
some minor pioasm fixes for #1950 (#2056) 2024-11-21 11:56:22 -06:00
Jack Wilsdon
8970241772
Fix flash_safe_execute timeout under FreeRTOS (#2021)
In some cases, the flash lockout task can start on the wrong core and
not have time to move to the correct core before exit is called. This
causes a timeout as the exit function is looking at the wrong core when
checking for the lockout task.
2024-11-21 11:24:17 -06:00
Luke Wren
36fefb5f30
Implement pico_bootsel_via_double_reset with the POWMAN DOUBLE_TAP flag on RP2350. (#2083)
The existing RAM implementation does not work because asserting the RUN pin holds SRAM in power-down.
2024-11-21 10:31:33 -06:00
Graham Sanderson
90bfb532a7
provide slightly meaningless _start symbol for boot_stage2 to make LLVM lld happy (#2080) 2024-11-21 10:10:12 -06:00
Graham Sanderson
31c1be5d5c
make panic loop back to breakpoint FWIW, and remove spurious header (#2062) 2024-11-21 10:00:38 -06:00
Andrew Scheller
f3459a45d4
Update documented max PIN values, to accomodate RP2350B (#2072) 2024-11-20 20:28:54 -06:00
Andrew Scheller
e17a82d291
Change __always_inline to __force_inline to suppress GCC errors (#2078) 2024-11-20 18:06:50 -06:00
newbrain
105a2b89d5
Update pwm.h (#2077)
NUM_DMA_IRQS was used instead of NUM_PWM_IRQS
2024-11-20 18:05:50 -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
Graham Sanderson
9a2b75e26e
prevent early macro expansion in PICOBIN_..._AS_BITS() macros (#2068) 2024-11-20 16:42:19 -06:00
will-v-pi
74db3c2d86
Update work area size from 3064 to 3264, and recommend 3.25K (#2073) 2024-11-20 16:41:48 -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
Peter Harper
54d4f3a8f7
Add some missing pio functions (#2074)
Adds some 64 versions to work with rp2350b and more than 32 pins.
Change cyw43 code to use the new function.

Fixes #1834
2024-11-20 16:38:05 -06:00
Graham Sanderson
46283dd00f
github action upgrades (#2075)
* Windows workflow: bump cmake version

* Actions: update all workflows to checkout@v4
2024-11-20 11:02:03 -06:00
Graham Sanderson
06a244b2b5
fix incorrect disassembly of MOV rx_fifo (#2067) 2024-11-20 10:57:22 -06:00
Graham Sanderson
c2118cc005
allow PICO_CORE1_STACK_SIZE=0 (#2058) 2024-11-20 10:56:25 -06:00
Graham Sanderson
08bf6a7faa
use configured uart_instance rather than default instance for flushing stdio uart (#2066) 2024-11-20 10:45:20 -06:00
Andrew Scheller
2a4dbd9b7c
Small comment typo (#2064) 2024-11-20 10:44:50 -06:00
Andrew Scheller
c4b55f6346
Fix the name of a PICO_CMAKE_CONFIG (#2061)
Looks like this change accidentally got omitted from #1926
2024-11-19 19:12:48 -06:00
Graham Sanderson
e99c43b670
fix method name spelling (#2057) 2024-11-19 16:14:56 -06:00
Peter Harper
482dd59b5e
Abilty to limit iterations in hci processing loop (#1998)
Fixes #1455
2024-11-19 14:11:47 -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
Liam Fraser
363302f780
Move to TinyUSB release 0.17.0 (#2053) 2024-11-19 14:08:44 -06:00
Liam Fraser
35fcc34747
Clocks doxygen: Remove incorrect clk_ref auxsrc value LPOSC. LPOSC is a primary source of clk_ref. Fixes issue #2047 (#2052) 2024-11-19 14:03:13 -06:00
Earle F. Philhower, III
5f6c432806
Fix minor uninitialized warnings from G++ 12.3.0 (#1786)
Use empty initializer list for struct clearing, avoiding a pedantic
warning from G++ 12 and 14.

Fixes #1785
2024-11-19 13:42:46 -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
11e7801ba4
Remove repeated source file from pico_btstack (#2042)
Removes a duplicate reference to btstack's src/mesh/mesh.c file in the
CMake build.
2024-11-18 17:32:29 -06:00
graham sanderson
37e42578b0 bump macOS build action to macos-latest from deprecated macos-12 2024-11-18 17:32:00 -06:00
Peter Harper
8d1378dcd2
Remove Segger RTT from pico-btstack (#1995)
* Remove btstack Segger RTT from pico-btstack

We now have this in the SDK so adding it again in pico-btstack leads to
link errors.

But it's possible to use the btstack RTT functionality by defining
ENABLE_SEGGER_RTT=1, and if we're not using pico_stio_rtt we still need
to add the btstack RTT source.

* Fix build issues when RTT is enabled

Fixes https://github.com/raspberrypi/pico-examples/issues/565
2024-11-18 17:29:34 -06:00
Dryw Wade
fe018f92ab
Add SparkFun ThingPlus RP2350 (#2038)
* Add SparkFun Thing Plus RP2350

* Add pico_cmake_set_default to Thing Plus RP2350
2024-11-18 17:25:16 -06:00
Philip Howard
7ceca315f1
PPP2 and Plasma2350: SPICE to SPCE. (#2048)
As per discussion on https://github.com/adafruit/circuitpython/pull/9803

Change "SPICE" to "SPCE" for consistency.

Signed-off-by: Phil Howard <github@gadgetoid.com>
2024-11-18 17:25:01 -06:00
Gregory Neverov
d6e3fa06f1
Fixes to picolibc_interface (#1795)
* Fixes to picolibc_interface

- Don't include bindings for tinystdio if picolibc was compiled with POSIX_IO.
- Add times() function, which seems to be missed, in the same pattern as settimeofday/gettimeofday.
2024-11-18 17:24:37 -06:00
Andrew Scheller
d0db3780fd
Fix typo in rom_get_partition_table_info doxygen (#2041) 2024-11-18 17:13:21 -06:00
Earle F. Philhower, III
0f847db371
Remove ARM assembly from RISC-V CYW43 SPI PIO (#2045)
Add hand-coded assembly RISC-V version of swap16x2 for CYW32 SPI PIO
driver.

Fixes #2044
2024-11-18 17:11:39 -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
Graham Sanderson
06b7c1cf9e
Change div_int_frac methods to be suffixed by the number of bits of fraction e.g. div_int_frac8 (#1926) 2024-11-12 11:18:42 -06:00
Luke Wren
f9eb48bd91
Add XIP cache maintenance API (fixes #2005) (#2013)
* Add XIP cache maintenance API (fixes #2005)

Also add a cache clean to hardware_flash implementations, to avoid
losing pending writes on the subsequent invalidate.

* Fix comment typos, add to docs index, remove unnecessary defaulting of XIP_CACHE assertions on FLASH

* Fix sense of unsigned wrapping test

* update bazel build

---------

Co-authored-by: graham sanderson <graham.sanderson@raspberrypi.com>
2024-11-11 12:09:30 -06:00
Graham Sanderson
09a9379ea9
Add explicit alignment for embedded_end_block (#2017) 2024-11-11 11:13:12 -06:00
Machdyne UG
c7e562604e
add support for machdyne werkzeug rp2040 board (#2023)
* add support for machdyne werkzeug rp2040 board

* boards/machdyne_werkzeug: set default flash size for cmake

---------

Co-authored-by: inc <87362+inc@users.noreply.github.com>
2024-11-11 10:44:55 -06:00
Peter Harper
68778b1135
Clear i2c abort reason less often. (#2026)
It seems to be possible to get stuck in the loop which is checking for
abort. It can take 100s of iterations before an abort happens and on
each iteration we're clearing the abort interrupt even when it's not
required. If we only clear the abort when needed the lockup doesn't seem
to be reproducible.

Fixes #2025
2024-11-11 10:09:08 -06:00