Commit graph

1168 commits

Author SHA1 Message Date
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
Peter Harper
4726a56d24
Update cyw43-driver to latest main. (#2032) 2024-11-11 10:07:29 -06:00
Andrew Scheller
f642b763be
Move CYW43-related PICO_CONFIG lines to cyw43_driver.h (#2002) 2024-11-08 19:04:53 -06:00
Graham Sanderson
5c6fece28a
Minor header cleanups and ASM compatibility (#2019) 2024-11-08 19:04:02 -06:00
Peter Harper
750bfaeed3
Mesh support (#2001)
* Add `pico_btstack_mesh` CMake library to link BlueTooth Mesh capabilities hidden in BTstack

* Add pico_btstack_mesh to docs

---------

Co-authored-by: theshteves <stevenkneiser@gmail.com>
2024-11-08 19:03:21 -06:00
Peter Harper
4196f2c17e
Avoid hang in stdio_set_chars_available_callback (#2020)
The function is setting the callback after enabing the interrupt which
can cause a hang if a receive character is already pending.
Similarly we also have to clear the callback pointer only after the
interrupt is disabled.

Fixes #2009
2024-11-08 18:34:30 -06:00
Tobias Simetsreiter
1aa049f14b
update glibc header sys/cdefs.h include guard (#2029) 2024-11-08 18:33:11 -06:00
will-v-pi
2331e6f203
Fix dependency on files used by picotool (#2027)
Add the key files and partition table JSON to the link dependencies, to ensure the postprocessing is run when any of them are updated. Link dependencies seem to be the simplest way, as the elf file needs re-linking anyway given it has been post-processed, so this doesn't add any unecessary extra processing.

Without this fix, if you modify a pt.json file or a private key, the ouptut binary will not have the correct pt/key.
2024-11-08 18:27:30 -06:00
Peter Harper
809a423fb0
Fix some header dependencies (#2031)
Fixes #1929
2024-11-08 18:09:13 -06:00