Commit graph

1180 commits

Author SHA1 Message Date
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
andygpz11
6587f5cc9a
Add the required SYS_CLK_HZ definition to the suggested cmake output (#2022)
Fixes #2014
2024-11-06 10:24:10 -06:00
Earle F. Philhower, III
11961b97e4
Very minor typos in contributing.md (#1939) 2024-11-05 14:07:38 -06:00
Earle F. Philhower, III
ca0c0db979
Fix GCC14.1 compile error in w25x10cls.S (#2000)
GCC14 doesn't like the 2-character temporary label "00" and throws an error
.../pico-sdk/src/rp2040/boot_stage2/boot2_w25x10cl.S: Assembler messages:
.../pico-sdk/src/rp2040/boot_stage2/boot2_w25x10cl.S:147: Error: junk at end of line, first unrecognized character is `0'
.../pico/rp2040/pico-sdk/src/rp2040/boot_stage2/boot2_w25x10cl.S:150: Error: garbage following instruction -- `beq 00b'

Convert it to a single number, "1", like in other boot2xxx.S files

Fixes #1999
2024-11-05 14:06:04 -06:00
armandomontanez
e48a2e158c
[Bazel] Update rules_cc to v0.0.10 (#1989)
Updates rules_cc to v0.0.10 to reduce the steps required to get started
with creating a Bazel-based Pi Pico project.
2024-11-05 14:05:44 -06:00
Peter Harper
d649c6c77a
Add some tests (#1978)
* Test for best_effort_wfe_or_timeout sev issue

best_effort_wfe_or_timeout should not ignore an outstanding sev
See https://github.com/raspberrypi/pico-sdk/issues/1812

* Test for alarm being set in the past issue

See https://github.com/raspberrypi/pico-sdk/issues/1953
2024-11-05 17:27:19 +00:00
Graham Sanderson
bd130eddff
Remove code bloat in public SDK for 64K roms (#2016) 2024-11-05 10:57:22 -06:00
Graham Sanderson
8905de509f
Add missing instruction to vestigial copro_dis.py (#2018) 2024-11-05 10:54:26 -06:00
Graham Sanderson
37c6b24b1b
Add missing instruction to vestigial copro_dis.py (#2018) 2024-11-05 10:53:19 -06:00
Philip Howard
50322234b7
boards/pimoroni_plasma2350.h: correct flash size. (#2015)
Correct flash size from 8MB to 4MB to avoid wrapped addresses causing
firmware to be overwritten by the user filesystem in MicroPython.

Signed-off-by: Phil Howard <github@gadgetoid.com>
2024-11-04 13:12:11 -06:00
Hugh Nixon
98c114a8ee
Updated hardware/pio.h to correct the comment for the third (PIO 2) hardware PIO instance (#2004) 2024-11-04 13:11:46 -06:00
Dave Roth
37085889b0
Add RP2350 specific values to the exception_number enum (#1988) 2024-10-17 13:56:35 -05:00
Peter Harper
91dfbd01e8
Fix issue with free rtos execute sync (#1979)
Stop handle_sync_func_call removing the worker. Depending on thread priority
this can occur after the memory has gone out of scope in
async_context_freertos_execute_sync.

Fixes #1962
2024-10-17 13:55:20 -05:00
Peter Harper
66c7f0f607
Move cyw32 pin definitions (#1982)
It was probably not a good idea to put the default pin definitions in
cyw43_configport.h as they're specific to pico_w and Micropython needs
these but it has it's own version of cyw43_configport.h
2024-10-17 13:53:49 -05:00
armandomontanez
07d6dc1315
[Bazel] Fix bazel build, add presubmit (#1973)
* [Bazel] Fix bazel build, add presubmit

* Fixes a missing dep in the Bazel build breaking the host build.
* Automagically finds all board headers.
* Improves presubmit script polish for GH Action readiness.
* Adds a GitHub action workflow for the Bazel build.
* Disable failing checks
* Disables Windows, as there's a mix of real build errors and
  overly-ambitious checks that don't work on Windows.
* Disables extra checks temporarily since it's currently failing.
2024-10-12 17:41:43 -05:00
Petr Hosek
03a82f3d2f
Update Clang toolchain used by Bazel (#1976)
LLVM-libc baremetal build now includes `mktime` so we no longer need to
provide our own declaration in the polyfill header.
2024-10-12 11:24:18 -05:00
chrisboross
fa91723371
Update hellbender_0001.h (#1967)
Updating flash sizes to match BOM
2024-10-01 18:46:39 -05:00
Graham Sanderson
c675dfeaa5
fix mis-spelling of PICO_CLOCK_AJDUST_PERI_CLOCK_WITH_SYS_CLOCK (#1966) 2024-10-01 09:48:23 -05:00
Caleb Jamison
761bb1dba0
hellbender_0001 board file (#1957)
* hellbender_0001 board file

* Fix FTRX_RX_PIN, Fix define names to match filename
2024-09-30 16:17:45 -05:00
Graham Sanderson
bd5523cc64
Improve best_effort_wfe_or_timeout (#1822)
* #1812 improvements to best_effort_wfe_or_timeout

* Fix best_effort_wfe_or_timeout further by not having the IRQ ever move the alarm target backwards
2024-09-30 09:43:55 -05:00
Dhiru Kholia
cf8301f3e6
Doc fix for aon_timer on RP2350 (#1960) 2024-09-30 09:39:58 -05:00
Graham Sanderson
e2e0fd51c3
remove support for A0 & A1 versions of RP2350 (#1958) 2024-09-30 09:39:36 -05:00
Giampiero Baggiani
075e829cd9
Update i2c_slave.c: clock stretching comment fix (#1811)
* Update i2c_slave.c: clock stretching comment fix

This changed since 89914870ae

* Update i2c_slave.c
2024-09-27 23:54:47 -05:00
Matt Bennett
ff373b33dc
Fixes #1891 Update pico_configure_ip4_address comments (#1892)
* Update pico_configure_ip4_address comments

Update pico_configure_ip4_address CMakeLists.txt function comments to correct compile definition names

* Swap compile definitions in comments

Swap compile definitions order in pico_configure_ip4_address to group more naturally.
2024-09-27 23:54:12 -05:00
Andrew Scheller
78533ec119
Specify minimum cmake version for generic_board.cmake (#1879) 2024-09-27 23:53:44 -05:00
Stanislav Rubint
20cf7119f4
removed dangling #ifdef __cplusplus (#1941) 2024-09-27 23:52:39 -05:00
Peter Harper
66335f1dc7
Clarify that RP2350 gets its unique id from OTP (#1942)
* Clarify that RP2350 gets its unique id from OTP

Fixes #1915

* Wrap rp2040_specific and rp2350_specific bits
2024-09-27 23:51:39 -05:00
Dave Roth
8c08f2b8ff
Export linker scripts in the bazel build. (#1944)
* Export linker scripts in the bazel build.

Make the rp2040 and rp2350 linker scripts available in downstream
projects bazel builds.

* Move exports_files below the package declaration.
2024-09-27 23:50:22 -05:00
Andrew Featherstone
0e5ef0f40f
Fix hardware_alarm_irq_handler when using Timer 1 (#1949)
Correct the logic for determining `timer_num`. Previously this would
always evaluate to 0 due to using `alarm_num` instead of `irq_num`.

Fixes #1948.
2024-09-27 23:49:22 -05:00
Andrew Scheller
a0f828fb16
Fix doxygen typo (#1945) 2024-09-27 23:48:58 -05:00
Peter Harper
9f56a47dca
Avoid setting an alarm in the past (#1954)
* Avoid setting an alarm in the past

Fixes #1953

* Call ta_time_us_64 when needed

Remove local "now" variable.
2024-09-26 10:56:05 -05:00
graham sanderson
d08f36cd1c fix assertion failure in rp2350_chip_version 2024-09-20 12:18:18 -05:00
David Goffredo
780817a8c7
Fix comments next to enum gpio_irq_level values. (#1928)
The comments for the values of `enum gpio_irq_level` mix up zero and
one. This commit replaces "0" with "1" and vice versa where appropriate
in those comments.
2024-09-18 14:17:18 -05:00
Peter Harper
af2f42613e
Changes for pico2_w (#1816)
* Add board file for pico2_w

This is a copy of pico2 with the definitions from pico_w added.
Set PICO_BOARD=pico2_w

* Simplify CYW43 PIO config

cyw43_spi_init contains code to find a free PIO and state machine. This
can all be replaced with pio_claim_free_sm_and_add_program_for_gpio_range

* Make CYW43 gpio pins configurable at build time

The CYW43 gpio pins are currently hardcoded. Give the defines better
names and make them overrideable at build time.

Note: CYW43_PIN_WL_REG_ON and CYW43_PIN_WL_HOST_WAKE are already used by
the driver via cyw43_hal_* functions

* Fix pio initialisation

Need to make sure the pio can work with all the gpios

* Add missing doxygen for cyw43_set_pio_clock_divisor

* Support dynamic configuration of cyw43 gpio pins

Add CYW43_PIN_WL_DYNAMIC that means cyw43 gpio pins can be changed at
runtime.

Then CYW43_PIN_WL_* calls cyw43_get_pin_wl to get the gpio out of
the array.

cyw43_set_pins_wl can be used to change the cyw43 gpio pins although
care is needed when calling this?

* Some fixes for cyw32 gpio > 32

* Allow CYW43 to be configured with cmake

* Add default config of CYW43_WL_GPIO_COUNT to cyw43_configport.h

* Fix some review comments

Add some PICO_CMAKE_CONFIG
Stop using gpio_*_mask64 functions
2024-09-18 14:16:41 -05:00
Graham Sanderson
6500c59d70
Add busy_wait_at_leasy_cycles to host (#1925) 2024-09-11 18:33:33 -05:00
Mete Balcı
42e234f8f3
#1909 fix system_RP2350 typos (#1910) 2024-09-11 10:48:35 -05:00
Thomas Watson
0ed2840306
boot_stage2: improve reproducibility (#1907)
Specifying the final boot2 source file as a link library here causes the
final `.elf` to be linked directly with that `.S`, which causes it to be
compiled into an object file with a name like `/tmp/<random chars>.o`.
This temporary object name is embedded in the final `.elf`, so the
`.elf`'s contents change after each link even if none of the input files
change, breaking reproducibility.

Fix the issue by specifying the source file as the source for an
object-only library, then specifying the library's object files as the
target link libraries, so the source is compiled in a separate step and
only the object is passed to the linker.
2024-09-11 10:43:32 -05:00
seesturm
ec0037b508
Enable building with Bazel on Raspberry PI OS machines (#1921)
* Adding RaspberryPI OS as build host

* Add rp2350 for build on Raspberry PI OS
2024-09-11 10:34:44 -05:00
CMD
f12ac1c2c1
RISC-V inline assembly constraints fix - platform.h (#1923)
Changed the constraint from "l" (specific to ARM) to the general "r" in inline assembly used for RISC-V architecture.

This ensures most compilers are able to compile this header file.
2024-09-11 10:08:15 -05:00