Commit graph

1167 commits

Author SHA1 Message Date
Graham Sanderson
ccbd07c758
add extra assertions to pio.h (#2211)
* add extra assertions to pio.h

* add another assert

* minor clarifications
2025-02-03 11:25:03 -06:00
Graham Sanderson
0c2de5dc0c
Eat PATH argument to pico_generate_pio_header which was ignored before supporting multi-target on pico_generate_pio_header (#2221) 2025-02-03 11:23:56 -06:00
Richard Hulme
d7f6582459
Declare platform.h functions with C linkage (#2218)
The platform.h headers for both RP2040 and RP2350 need 'extern "C"'
declarations when included from C++ code or 'rp2040_chip_version'
and 'rp2350_chip_version' won't be found by the linker.
2025-02-02 11:44:17 -06:00
nilswiersma
6c06f90bfe
Release the lock in mbedtls_sha256_free if it was not released already (#2105)
* Release the lock in mbedtls_sha256_free if it was not released already. Requires making pico_sha256_unlock include-able. Fixes #2103.

* addres lock release API comment

* Fix description of pico_sha256_cleanup

---------

Co-authored-by: nils <nils@nils>
Co-authored-by: Peter Harper <peter.harper@raspberrypi.com>
2025-01-31 11:41:07 -06:00
Dryw Wade
3d746b3fa7
Add SparkFun IoT Node LoRaWAN board (#2143) 2025-01-29 09:35:47 -06:00
Matthias Ringwald
25069f5472
btstack: configure incoming pre-buffer for cyw43 driver (#2165) 2025-01-29 09:35:20 -06:00
Wu Haotian
d1a1c9f9fc
Support multiple .pio file in pico_generate_pio_header (#2188) 2025-01-29 09:31:06 -06:00
Peter Harper
700f861eac
Update btstack 1.6.2 (#2202)
* Update btstack

v1.6.2 plus one commit

* Update bazel for btstack

* Build changes for btstack v1.6.2
2025-01-29 09:20:42 -06:00
Peter Harper
524716f1b9
Fix unreliable writes to cyw43. (#2209)
We use a pio and dma to write to the cyw43 chip using spi. Normally you
write an address and then read the data from that address, so the pio
program does does a write then read.

If you just want to write data in the case of uploading firmware we
use the fdebug_tx_stall flag to work out if the pio has stalled waiting
to write more data.

The theory is that this flag will also get set if the bus is busy. So
we mistakenly think a write to cyw43 has completed.

Wait for the dma write to complete before waiting for the pio to stall.

Fixes #2206
2025-01-29 09:17:50 -06:00
Hardy Griech
3ba9534c03
update tinyusb to 0.18 (#2215)
* update tinyusb to 0.18

* update tinyusb also for bazel
2025-01-29 09:15:36 -06:00
Graham Sanderson
9f95a46e31
fix pico_time_test.c compile on native (#2207) 2025-01-29 09:13:51 -06:00
graham sanderson
f20663cb7f Fix pico_divider_nesting_test.c on RP2350 - was broken due to running faster and hence further on RP2350, breaking a check which was wrong for larger inputs 2025-01-26 13:31:51 -06:00
graham sanderson
a62d17cb42 Add PASSED/FAILED output to cmsis_test.c 2025-01-26 13:30:56 -06:00
will-v-pi
c54475da6f
Remove deprecated uses of FetchContent_Populate (#2169)
* Remove deprecated uses of FetchContent_Populate

Cannot use MakeAvailable as the files shouldn't be added to the build, so instead uses the full signature for FetchContent_Populate

Fixes #2124

* Fix GIT_SUBMODULES_RECURSE for older CMake versions
2025-01-20 13:45:51 -06:00
Peter Harper
73d007f1a4
Update cyw43 driver. (#2199)
* Update cyw43 driver.

Fixes #2153

* Update cyw43 in bazel
2025-01-20 13:45:06 -06:00
gazzyt
09482ed7a0
Disable irq before removing handler in cyw43_irq_deinit (#2185) 2025-01-20 13:42:46 -06:00
Gregory Neverov
863f5446e1
Follow-up to #1795 (#2177)
Address the review comment to fix conditional compilation syntax:
https://github.com/raspberrypi/pico-sdk/pull/1795#pullrequestreview-2444179188
2025-01-20 11:01:03 -06:00
Arkin Solomon
5022582ec7
Fix brief #2196 (#2197) 2025-01-20 10:56:58 -06:00
Peter Harper
b8dc8c488d
Fix ta_wakes_up_on_or_before (#2190)
* Fix ta_wakes_up_on_or_before

Handle target in the past and running for > 2^32 us.

Fixes #2186

* Add test for ta_wakes_up_on_or_before fix
2025-01-20 10:56:23 -06:00
waveshare
61e2712057
Added some weveshare board support (#2145)
Signed-off-by: eng33 <eng33@waveshare.com>
Co-authored-by: eng33 <eng33@waveshare.com>
2025-01-18 13:48:26 -06:00
Petr Hosek
4b6e647590
Update Clang toolchain used by Bazel (#2151)
* Update Clang toolchain used by Bazel

* <time.h> include

* Sort includes

* Use libc timeval definition

* Disable unwinder linking for now

* Link libm
2025-01-13 15:59:03 -06:00
Lesords
306c461cd3
Fix: solve the problem that micropython could not be used (#2098) 2025-01-11 14:07:59 -06:00
Peter Harper
5202c272cb
Initialise stack in async_context_execute_sync call (#2106)
We need to do this to avoid work_pending being set twice.

Fixes #2101
2025-01-11 14:06:12 -06:00
Osman Karaketir
fc37bede32
Fix Doxygen comment (#2175)
remove incorrect pool parameter
2025-01-11 14:04:10 -06:00
Andrew Scheller
1b80db289d
Restore the "API Documentation" link in sidebar when building with Doxygen >= 1.9.8 (#2135) 2025-01-11 14:02:40 -06:00
Andrew Scheller
7bd430d7d6
Fix RP02040 typos (#2168) 2025-01-11 13:53:45 -06:00
Jean Jonethal
e7a0e61165
convert windows path delimiter to posix (#2149) (#2150)
* convert windows path delimiter to posix (#2149)

* add explicite variable assignment for intermediate resource name conversion result (#2149)
2025-01-07 11:05:13 -06:00
Peter Harper
969f5895aa
ta_set_timeout can fail to set an alarm (#2127)
* ta_set_timeout can fail to set an alarm

If alarm_pool_irq_handler takes <1us between handling an alarm and
calling ta_set_timeout then no alarms will be set as it will appear as
if an earlier alarm is already armedi before the target time.

Make sure ta_set_timeout always leaves with an alarm set by checking the
armed status.

Fixes #2118

* ta_disable_irq_handler should unarm its timer
2024-12-06 10:39:04 -06:00
Andrew Scheller
ba7aa3f075
Fix mis-matched backticks in doxygen (#2104) 2024-12-04 14:51:48 -06:00
will-v-pi
54784f884b
Add rom_data_lookup_inline function (#2116)
* Move rom_data_lookup code into rom_data_lookup_inline

Allows ROM data lookup from FLASH/RAM sensitive code

* Use rom_data_lookup_inline in flash_devinfo_ptr

Fixes bug introduced by #2082 where flash_devinfo_get_cs_size would use rom_data_lookup from flash during a __no_inline_not_in_flash_func
2024-12-02 11:19:55 -06:00
Peter Harper
fe81780508
Update btstack license. (#2115) 2024-12-01 11:17:13 -06:00
Graham Sanderson
f0a1ff3c03
Fixes for/found by documentation generation (#2099)
* fix errors breaking extra_[cmake_]configs.py
* remove trailing whitespace which is confusing asciidoctor
* fix rp2xxx-specific -> rp2xxx_specific
* add missing xip_cache funcs to the combined docs
* Revert "fix errors breaking extra_[cmake_]configs.py"
* Fix typo in #define name
* Allow optional whitespace at the start of "commented out" config lines

Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2024-11-25 12:30:55 -06:00
graham sanderson
bb916f4704 start 2.1.1-develop 2024-11-25 00:44:24 -06:00
graham sanderson
95ea6acad1 SDK 2.1.0 release 2024-11-24 23:44:29 -06:00
graham sanderson
beb2449622 Update picotool dependency to 2.1.0 (not strictly required, but we prefer people to be on the latest) 2024-11-24 23:43:46 -06:00
graham sanderson
2a1e1af6af Add missing CYW43_DEFAULT_PIN_WL_CS to pimoroni_pico_plus2_w_rp2350.h 2024-11-24 20:33:51 -06:00
Gonzalo Larralde
b7e255d18d
Add board file for Pimoroni Pico Plus 2 W (#2092)
* Add board pimoroni_pico_plus2_w_rp2350.
2024-11-24 20:04:39 -06:00
yh-sb
58e253ce04
Fix implicit declaration warning (#2093)
pico-sdk/src/rp2_common/pico_flash/flash.c:155:33: warning: implicit declaration of function 'make_timeout_time_ms'
pico-sdk/src/rp2_common/pico_flash/flash.c:156:77: warning: implicit declaration of function 'time_reached'
2024-11-24 19:44:36 -06:00
Graham Sanderson
5f607a9829
Comment out CMake cyw43 vars which aren't really that useful in general i don't think (#2090) 2024-11-24 11:27:10 -06:00
Graham Sanderson
a6ae2e6e4a
Fix compilation warnings (#2089) 2024-11-23 13:41:51 -06:00
yh-sb
3c39eecea3
Fix CMake build. (#2088)
hardware_watchdog depends from pico_bootrom due to header pico/bootrom.h

BUILD.bazel also has this dependency.
2024-11-23 13:02:57 -06:00
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