1098 Commits

Author SHA1 Message Date
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 89914870ae06b2418c8ecc7e21af00d2dd77f8cb

* 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
armandomontanez
0f38151002
[Bazel] Update version string to 2.0.1-develop (#1885)
Updates the Bazel module version string to match the current CMake
version string for the develop branch.
2024-09-10 18:49:04 -05:00
Graham Sanderson
398ac2baf9
Some small fixes/improvements for pico_minimize_runtime (#1919)
* add PANIC and AUTO_INIT_MUTEX to pico_minimize_runtime; fix build with PICO_PANIC_FUNCTION=

* add pico_minimize_runtime for host builds - does nothing

* Add ALL option to pico_minimize_runtime
2024-09-10 18:45:25 -05:00
armandomontanez
b49d4ec949
Fix Bazel build breakages (#1908)
* Fix Bazel build breakages

* Adds support for new PICO_DEFAULT_UART_BAUD_RATE option.
* Fixes issues related to Picotool and boot_picoboot_headers.
* Adds pico_float RISC-V pieces to the Bazel build (not yet fully
  tested).
* Adds the missing adafruit board header to the Bazel build.

* Exclude hazard3 float test in Bazel validation script

* Restore missing dependency in hardware_boot_lock
2024-09-10 18:44:55 -05:00
Koji KITAYAMA
3a79149d2c
Fix a compile error by using clang-x86_64-pc-windows-msvc (#1890) 2024-09-05 11:37:39 -05:00
will-v-pi
dfb573818f
Use lib instead of CMAKE_INSTALL_LIBDIR for pioasm install (#1865) 2024-09-03 16:26:43 -05:00
Dranoel
f13306c8a7
Fix typo in documentation of PICO_RAND_ENTROPY_SRC_TRNG (#1794) 2024-09-03 16:21:33 -05:00
graham sanderson
b3cadb7de2 fix RISC-V build 2024-09-01 09:45:02 -05:00
Sylwester
d957c738db
Add RP2350 PicoADK variant (#1787) 2024-09-01 09:33:41 -05:00
Andrew Scheller
b98970f71e
PIO doxygen typo (#1894) 2024-09-01 09:31:41 -05:00
Nhan Cao
3bc866395c
Adding I2C Burst Reading/Writing feature (#1495)
* Adding I2C Burst Reading/Writing feature

* Add functions to header file.

Fixing: https://github.com/raspberrypi/pico-sdk/pull/1495

* Some missing changes

Rename the functions. Lose the "mode" and "blocking" needs to be at the
end.
Just set restart_on_next in the caller rather than adding a parameter.

---------

Co-authored-by: anhnhancao <nhan@earable.ai>
Co-authored-by: Peter Harper <peter.harper@raspberrypi.com>
2024-08-30 12:55:25 -05:00
Stefan Kerkmann
3cb21c8134
pico_bootrom: bootrom.h: fix -Wstrict-prototypes (#1888)
The refactoring of these functions removed the (void) in the function
declarations - thus compiling with -Wstrict-prototypes will yell at us
at compile time.

Signed-off-by: Stefan Kerkmann <karlk90@pm.me>
2024-08-30 11:45:58 -05:00
Luke Wren
d886df6eb0
Add fast single-precision add/sub/mul for Hazard3 (#1883)
* Add fast single-precision add/sub/mul for Hazard3

* Make test output less noisy. Map -nan to -inf in vector gen. Move random vectors to separate files.

* Re-disable USB stdout for pico_float_test by default...

* Disable pico/float.h exports on RISC-V as these functions aren't implemented

* Add hazard3 instructions to asm_helper. Split hazard3.h to support this.

You can still include hazard3.h to get everything. This just allows you
to pull in less.
2024-08-30 11:36:30 -05:00
Graham Sanderson
876f331033
bump picotool to the develop branch (#1886) 2024-08-29 19:14:50 -05:00
Graham Sanderson
ff5401f3b2
separate actual shared bootrom header into boot_bootrom_headers, as pico_bootrom which is focused on calling the bootrom now has non trivial dependencies like pico_flash (#1881) 2024-08-29 19:07:23 -05:00
Graham Sanderson
91864a0d6e
fix bug in sm_config_set_in_pin_count (#1880)
* fix bug in sm_config_set_in_pin_count

* comment updates
2024-08-29 11:17:06 -05:00
graham sanderson
2d60604b6e Revert "bootrom build includes pico_bootrom but not bootrom.h which is the only thing which requires pico_flash... slightly hacky fix to not include pico_flash if not available"
This reverts commit 4bbf701b4b11c955d2609408aa4b1feebe36381f.
2024-08-28 18:51:10 -05:00
graham sanderson
4bbf701b4b bootrom build includes pico_bootrom but not bootrom.h which is the only thing which requires pico_flash... slightly hacky fix to not include pico_flash if not available 2024-08-28 12:40:14 -05:00
will-v-pi
a2a4c2041e
Don't run coprodis on Risc-V or RP2040 binaries (#1875) 2024-08-27 11:22:15 -05:00
Graham Sanderson
dd4aacbd1c
fix linker script bug using ALL of RAM (#1872) 2024-08-27 11:13:28 -05:00
Andrew Scheller
d639292fea
Update extract configs (#1845)
* Update config-extraction scripts to work with multiple chips

* Standardise wording between common options

* Various config-related fixes

* Update pico_rand to use correct busctrl_hw struct-name

* Don't start config descriptions with "The ..."
2024-08-27 11:11:42 -05:00
Andrew Scheller
a700b7784b
Small pico_pre_load_platform.cmake tweak (#1867)
Make one of the messages more accurate, in the event that the user changes `PICO_DEFAULT_RP2350_PLATFORM`
2024-08-24 15:03:54 -05:00
will-v-pi
a46addba7b
Fix stdio_usb with reset interface disabled on Windows (#1857)
* Only use bcdUSB = 0x0200 with MS_OS_20 descriptor enabled

* Add comment
2024-08-24 14:54:44 -05:00
will-v-pi
bc598fff27
Fix #1861 - MAX_EXCEPTION_NUM is the highest number, so check should be > not >= (#1866) 2024-08-24 14:54:06 -05:00
Andrew Scheller
7d5d9276a8
Workaround gcc/newlib issue on Ubuntu 24 (#1863) 2024-08-23 10:59:36 -05:00
Peter Harper
aa8cf17732
Fix assert in gpio_set_irq_enabled (#1864)
* Fix assert in gpio_set_irq_enabled
2024-08-23 10:58:38 -05:00
Taylor Cramer
7dc10d7aad
Bazel: disable link_extra_lib when building bootloader (#1854)
Fixes #1853
2024-08-22 11:56:51 -05:00
will-v-pi
9b16c797b4
Reorder pins in bi_pins_with_names to work with mask (#1858) 2024-08-22 11:56:16 -05:00
will-v-pi
598ba01ec8
Add build-essential to README command line install (#1859)
* Add build-essential to README command line install

* Update README.md
2024-08-22 11:43:52 -05:00
J
4cb5c1ccf1
bazel build: Fix compilation bugs for Pico-W support (#1797)
* Add @pico-sdk prefix to bazel/config in lwip.BUILD

Without this, we're trying to refer to a subpackage of
the lwip directory called bazel/config, which doesn't
exist. See similar references in this file.

* bazelbuild: Fix compilation errors with pico_lwip and freertos

This fixes two general problems.

* pico_lwip_contrib_freertos misspelled several things
  (omitted contrib/ dir prefix, didn't have @pico-sdk in front of
  out references to pico-sdk targets)

  This is fixed simply by fixing the spellings.

* Circular dependency between pico_lwip_core and pico_lwip_contrib_freertos.
  In NO_SYS=0 mode, lwip wants to include sys_arch.h. But sys_arch.h
  is defined in pico_lwip_contrib_freertos. sys_arch.c in turn wants
  to include lwip's opt.h and arch.h, among other things. So it needs
  to depend on pico_lwip_core.

  This is fixed by extracting all the headers into a common rule which
  can be depended on by both targets, then depending on it in the
  relevant targets.

Additionally, for the LWIP+FreeRTOS build to work correctly, we need
to actually depend on the pico_lwip_contrib_freertos rule from
pico_lwip_core. This the purpose of the select in the deps of
pico_lwip_core.

* bazel+cyw43: Fix compilation errors.

This fixes issues with the cyw43 driver
build rules in Bazel:

* Before this, the btstack would always be included
  even if it could not be used. If the user did not
  specify a btstack config, this would cause a
  compilation error. Now, we condition the linking
  and building of the btstack on whether there is
  a config for it.
* Before, the btbus was not properly linked.

* Implements code review feedback
2024-08-22 11:30:26 -05:00
will-v-pi
4a272778cd
Disable interrupts while doing flash_op, explicit_buy, and chain_image (#1835)
* Disable interrupts for some rom functions

* Use flash_safe_execute

* Inline and rename helpers
2024-08-22 11:29:35 -05:00
Graham Sanderson
eba6adb4e1
#1851 fix signature of hardware_alarm_get_irq_num (#1852) 2024-08-20 13:26:08 -05:00
Scott Shawcroft
19d5f4c0d7
Add board definition for Adafruit Feather 2350 (#1784) 2024-08-20 13:12:17 -05:00