Commit graph

1189 commits

Author SHA1 Message Date
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 4bbf701b4b.
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
David Goffredo
eaaa4a5ab3
typo in documentation of __time_critical_func (#1792)
I was reading through my PDF copy of the SDK docs, and I think that there's a typo in this example. The macro is `__time_critical_func` but the example spells it `__time_critical`.
2024-08-20 13:03:46 -05:00
Ikko Eltociear Ashimine
fa88c125b8
Update aon_timer.h (#1809)
specifed -> specified
2024-08-20 12:48:45 -05:00
Andrew Scheller
9a41722dd3
More board header checks (#1814)
* Modify check_board_header.py to work with both RP2040- and RP2350-based boards

* Tweaks to the board-header files so that they pass check_board_header.py

* Update tools/check_board_header.py
so that it handles pico_cmake_set_default the same way as cmake/generic_board.cmake does
2024-08-20 12:47:20 -05:00
Andrew Scheller
1bdd006c8d
Small doxygen fixes (#1828) 2024-08-20 12:41:49 -05:00
will-v-pi
7be79e8abe
Fix picobin inclusion from assembler with NO_PICO_PLATFORM (#1832)
Needs to copy the _u(x) definition from platform_defs.h
2024-08-20 12:40:52 -05:00
Nikhil Dabas
789ea75c63
Ensure makefsdata.py generates valid variable names (#1841)
* Ensure makefsdata.py generates valid variable names

* Use mimetypes library in makefsdata.py

* Avoid generating duplicate variable names
2024-08-20 12:31:45 -05:00
graham sanderson
e930bf3261 Deprecate copro_dis.py - keep for now as it is used by bootrom build 2024-08-20 09:48:50 -05:00
graham sanderson
9430469e18 Revert "Delete tools/copro_dis.py (#1833)"
This reverts commit b271208071.
2024-08-20 09:48:50 -05:00
Graham Sanderson
fab47c8071
Fix Cmsis irq regression (#1821)
* #1817 fix regression with CMSIS interrupt renaming
2024-08-20 08:52:41 -05:00