Commit Graph

804 Commits

Author SHA1 Message Date
Maarten van der Schrieck
f5fea7f09b
pico_cyw43_driver/cyw43_bus_pio_spi.c: make SPI_PROGRAM_NAME and CLOCK_DIV configurable in makefile (#1499) 2024-06-21 14:35:51 -05:00
Peter Harper
5d36c90331
Make it easier to configure default baud rate (#1648)
To make stdio logging quicker it's probably a good idea to set the default
uart speed 921600, but it's only configurable by adding this define to
your project. Make it configurable from the cmake command line.
2024-06-21 14:31:52 -05:00
Pontus Oldberg
5118b4aae8
Adds support for the iLabs opendec02 decoder. (#1667) 2024-06-21 14:31:04 -05:00
Andrew Scheller
cea8211834
Fix FIFO size in Doxygen in hardware/adc.h (#1720)
See https://github.com/raspberrypi/pico-feedback/issues/357
2024-06-21 14:30:13 -05:00
Andrew Scheller
5be87f1e22
Clarify that DMA timer fraction must be <= 1 (#1723) 2024-06-21 14:29:47 -05:00
Andrew Scheller
0e5cef3ffa
Boards header updates (#1724)
* Add script to automatically validate board header files

* Fix small automatically-found inconsistencies in various board header files

* Tweak and add board header file from abandoned PR #1174
2024-06-21 14:26:45 -05:00
Hiroyuki OYAMA
333974fd6c
Corrects errors in returning constant labels (#1735) 2024-06-21 14:24:44 -05:00
Peter Harper
a567349aae
Update btstack v1.6.1 (#1736)
* Update btstack to v1.6.1

* Add build changes for btstack v1.6.1
2024-06-21 14:23:50 -05:00
Peter Harper
f193ed6bc9
Update cyw43-driver to fix build warnings (#1739)
This resolves kitchensink build issues
2024-06-21 14:22:14 -05:00
J
c526ec1c3d
custom_(un)lock_tcpip_core: link properly in C++ (#1738) 2024-06-20 09:07:32 -05:00
armandomontanez
6ff3e4fab2
Expand bazel build to include configuration options and broader support. (#1731)
* Add host Bazel build

Updates target_compatible_with across the repo to ensure that wildcard
builds for both host and rp2040 succeed.

* Get unit tests building

* Add Python script to identify build system differences

Uses the build system tags to make it easier to identify differences
between the CMake and Bazel builds.

* Temporarily disable pico divider test

* Support PICO_BARE_METAL in Bazel

* Support PICO_NO_GC_SECTIONS in Bazel

* Support boot2 configuration in Bazel

Adds support for PICO_DEFAULT_BOOT_STAGE2 and
PICO_DEFAULT_BOOT_STAGE2_FILE in the Bazel build.

* Allowlist some CMake-only options

* Support CXX configuration options in Bazel

* Move multiple_choice_flag.bzl

* Support all pico boards

* Support linking multiple stdio implementations

Changes the Bazel build so stdio implementations are no longer mutually
exclusive.

* Add PICO_BOOT_STAGE2_LINK_IMAGE

* Support PICO_CMSIS_PATH in Bazel

* Support PICO_USE_DEFAULT_MAX_PAGE_SIZE in Bazel

* Silence PICO_CMSIS_VENDOR and PICO_CMSIS_DEVICE differences

* Support PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS in Bazel

* Properly support version defines

* Support embedding binary info in Bazel

* Embed build type in binary

* Support different linker scripts in Bazel build

* Finish out missing PICO_BUILD_DEFINE in Bazel build

* Support PICO_NO_TARGET_NAME

* Reorganize initial configuration options in Bazel

Cleans up and reorganizes some of the initial configuration options
added to the Bazel build so everything is consistent.

* Add builds for pioasm and elf2uf2

* Use Python rules from rules_python

* Actually link in output formats in pioasm tool

* Make tools have public visibility

* Add UF2 Bazel aspect

* Add TODOs for pioasm/uf2 helpers

* Fix compile flag typo

* Update Bazel SDK configuration strings to match recent CMake changes

* Fix pico_divider test

* Clean up straggling TODOs

* Clarify pico_stdio_test compatibility

* Initial Bazel Pico W support

* Add new files from develop

* Clean up compatibility expressions in Bazel build

* Clean up rp2 constraint handling in Bazel

* More Bazel docs cleanup

* Format Bazel build files

* Consolidate transitions in the Pico SDK

* Make every _allowlist_function_transition explicit

* More docs cleanup

* Add a few missing defines

* Improve PICO_CONFIG_HEADER correctness in Bazel

* Minor docs clarifications
2024-06-13 09:50:04 -05:00
Peter Harper
0dc17e5149
Update cyw43_driver to v1.0.3 (#1732) 2024-06-13 09:03:46 -05:00
Christian Halter
a391f641b6
Added Newsan's Archi board (#1730)
Co-authored-by: Christian Halter <christian.halter@newsan.com.ar>
2024-06-12 13:42:25 -05:00
Peter Harper
a456964c19
Fix btstack compilation (#1726)
hardware/flash.h has been removed from pico/flash.h in the fix
for #1699. This breaks btstack compilation. Let's fix it.
2024-06-10 10:03:09 -05:00
Ahmet Kizilay
3ee062318f
set git tag for the SDK (#1630)
with this change we can use PICO_SDK_FETCH_GIT_TAG to specify a release tag for the Pico SDK to download.

example usage:
```
set(PICO_SDK_FETCH_FROM_GIT true)
set(PICO_SDK_FETCH_FROM_GIT_TAG "1.5.1")
include(pico_sdk_import.cmake)
```
2024-06-04 20:04:21 -05:00
Mykle
79977dbc4a
Update dma.h (#1678)
Fix inline doc for dma_timer_set_fraction()
2024-06-04 20:00:55 -05:00
J
e84eedff32
Remove unneeded includes from pico_flash. (#1699) 2024-06-04 19:59:59 -05:00
Andrew Scheller
115eae7c66
Add scripts to extract PICO_CMAKE_CONFIG and PICO_BUILD_DEFINE entries (#1708)
Tidy up a couple of PICO_CMAKE_CONFIG and PICO_BUILD_DEFINE entries
2024-06-04 19:59:28 -05:00
armandomontanez
abce1d427c
Introduce initial Bazel build (#1705)
* Build boot_stage2 with Bazel

Introduces the initial foundations of a Bazel build, including a
toolchain, critical generated headers, platform patterns, and enough
BUILD files to build boot_stage2.

* Bazel libraries to support picotool

* Move SDK defines to toolchain

* Switch to `archive_override` in MODULE.bazel

Uses archive_override where applicable to allow transitive bzlmod deps
to propagate.

* Multiplatform objcopy selection in Bazel build

Makes an objcopy alias that redirects to the objcopy tool for the
current exec platform, which allows boot_stage2 to build on Linux,
macOS, and Windows.

* Generate Bazel build files

Adds initial set of generated Bazel build files. Note that these do not
yet build, as dependency cycles are present.

* Fix dependency cycles in Bazel build

Fixes many dependency cycles, some were unintentionally created by the
build file generator, others are true dependency cycles that require
manual workarounds.

* Silence warning in pico_stdio Bazel build

Silences a stray warning in the Bazel build.

* Fix wildcard Bazel build

This makes `bazel build //...` succeed, and also prevents the fetching
of toolchains that aren't compatible with the current execution
environment (i.e. Windows computers will no longer try to download macOS
toolchains).

* Get the SDK working

Finishes out the remainder of the work required to successfully compile
a working blinky example.

* Fix UART stdio dependencies in Bazel build

Fixes some dependencies around pico_stdlib so that pico_stdlib links
properly and UART stdio works.

* Add linux support to Bazel build

* Get Bazel deps from registry

Adds external an external registry for resolving Bazel module
dependencies.

* Fix host configuration for picotool

Provides the appropriate defines for host builds to support the picotool
build.

* Remove -ffreestanding from Bazel toolchain

The -ffreestanding toolchain flag is quite strict, so remove it from the
Bazel toolchain.

* Remove unused .bzl file

* Reduce Bazel compiler flags

Cuts out most of the Bazel toolchain flags and only specifies the
bare-minimum set of flags. Also, adds wrapper linker flags for functions
the SDK wraps.

* Get USB serial working

Adds initial TinyUSB support and enough integration to get USB serial
working.

* Remove "Generated build file"

Removes comments that indicates BUILD.bazel files are generated. This
was used during initial bringup to indicate hand-crafted vs
automatically generated BUILD.bazel files.

* Do not build USB libraries unless configured

Prevents USB libraries from being built unless the build is properly
configured to use them.

* Switch to rules_cc toolchains

Moves toolchain configuration to use the new rules in rules_cc.

* Minor cleanup in parse_version.py

Cleans up trailing whitespace and runs the black formatter on
parse_version.py.

* Simplify constraint dimensions in Bazel build

Consolidates the class/chip constraint settings to be a single
constraint_setting with a config_setting that represents the rp2 class.

* Update pin of rules_cc in Bazel build

Includes a necessary fix for the target_compatible_with expression in
the cc_toolchain to work as intended.

* Move toolchains from pico.bzl to BUILD.bazel

Moves toolchain definitions from pico.bzl to BUILD.bazel to make them
easier to find and read.

* Run buildifier on Bazel build files

Fix trivial formatting issues by running buildifier on all BUILD.bazel
files.

* Make objcopy rule

Makes a simple objcopy rule to remove direct references to the ARM
toolchains.

* Fix link flags in Bazel build

Critical flags were not being applied to link steps. This applies -mcpu
and -mthumb to the link steps to make the produced binaries work again.

* Mention missing host build support

* Fix various Bazel library rules

* pico_bit_ops was incomplete.
* pico_double and pico_float were trying to link in the "none"
  implementation.

* Extend Bazel build documentation

Improves documentation and comments across the Bazel build.

* Clean up auxilary tools in Bazel build

Switches genrules to use skylib rules to simplify things. Reworks
version header generation to use the Bazel module version rather than
parsing CMake.

* Update boot_stage2 Bazel build file

Moves `includes` to be enumerated on the correct library.

* Add WORKSPACE version fallback

WORKSPACE Bazel projects don't support querying module version, so add a
fallback of '0.0.1-WORKSPACE' so the build can succeed.

* Fix malloc handling in Bazel build

* Fix Bazel dependency cycle in pico_malloc

* Prevent malloc from being linked into boot_stage2

Prevents Bazel from ever trying to link malloc into the boot_stage2
binary.

* Remove custom bootloader platform

A dedicated boot_stage2 platform introduces a lot of complexity that
needs to be more thought-through.
2024-06-04 18:50:32 -05:00
dthomas981
23dec9d38c
Correct clk_sys auxsrc definition for XOSC (#1571) 2024-05-21 13:37:43 +01:00
Agustín Mista
f81537d9e0
Add board definition for Cytron Maker Pi RP2040 (#1473) 2024-05-19 19:49:27 -05:00
Andrew Scheller
a6c65b426d
Small kitchen-sink fixes (#1707)
- tweak CMakeLists.txt and kitchen_sink.c to be in a more similar order
- add some "missing" headers to kitchen_sink.c
2024-05-19 19:26:30 -05:00
Andrew Scheller
dcc2241a16
Add a script to create a header file including all other header files (#319) 2024-05-19 17:44:03 -05:00
Mr. Jake
3f41d7d2ee
Added comments referencing spin-lock lock/unlock read/writes (#1501) 2024-05-19 17:03:32 -05:00
Patrick Plenefisch
7d238ea2cc
[pioasm] Fix build warning due to extra parameters (#1625) 2024-05-19 16:48:53 -05:00
Peter Harper
0d56f52b7b
Add some missing i2c function documentation (#1650)
Add i2c_get_index for consistency - just calls i2c_hw_index
2024-05-19 16:36:27 -05:00
Mr. Jake
f1f3bd6bf6
Disable FIFO IRQ when doing reset of core1 (same as with launching) (#1447)
* fifo irq disabled during core1 reset

* silence warning about unused variable in multicore.c
2024-05-18 19:53:37 -05:00
Joseph Bellahcen
5941969380
Improved const correctness of rtc functions (#1460) 2024-05-18 19:42:51 -05:00
Peter Harper
ac8f277e5a
Fix stdio_set_chars_available_callback for usb (#1649)
When you get a callback to tell you a character is available, you should
be able to call getchar_timeout_us, but it's not working for USB

Fixes #1603

Co-authored-by: Andrew Gordon <arg@gordondesign.ltd.uk>
2024-05-18 18:59:47 -05:00
Siarhei Volkau
fcd5333f6b
remove dead code in __aeabi_dcmpun (#1703)
two tail instructions were unreachable
2024-05-18 18:33:03 -05:00
Patricio Whittingslow
a0f4cd4096
Implement Pioasm for Go (TinyGo) (#1604)
Co-authored-by: Kenneth Bell <ken@netleap.io>
Co-authored-by: Christian Ege <ch@ege.io>
2024-05-07 17:39:28 -05:00
Nellie McKesson
b27f13b83b
reformatting doxygen comment markup (#1660) 2024-03-22 09:09:44 -05:00
J. Neuschäfer
0c65e1d755
pico/mutex.h: Fix typo in comment (#1637) 2024-02-15 08:45:35 -06:00
timg236
c9cce7a312
pico_generate_pio_header: Create OUTPUT_DIR (#1610)
Previously, if a custom OUTPUT_DIR was specified but didn't exist
then this command would fail.

Fixes: https://github.com/raspberrypi/pico-sdk/issues/1609
2024-01-19 08:57:16 -06:00
rppicomidi
f1c6fc8b6d
Fix #1442: Allow adding alternative .gatt file import paths (#1445)
* fix feature request #1442

* Do not require -I before each addtional path

* Fix pico_btstack_make_gatt_header warning

gatt header files are always made into the "generated" folder so you get
a warning if you have more than one target generating a gatt header with
the same name.

Also, simplify the expansion of ARGN

* Improve pico_btstack_make_gatt_header description

---------

Co-authored-by: Peter Harper <peter.harper@raspberrypi.com>
2024-01-16 09:43:57 -06:00
Peter Harper
62bb486f2a
Add tool for lwip httpd server (#1600)
It would be helpful to be able to use the lwip httpd server, but it
generates the content using a tool written in C. This is problematic as
it requires a native compiler to build the tools.

Add a python tool to generate the httpd content and a cmake function to
make use of it.
2024-01-16 09:20:17 -06:00
hubiscode
8353cb61e3
Fix spelling mistake, add documentation (#1444)
* USB descriptor string length.

Implement a mechanism to set the maximum string length used in
tud_descriptor_string_cb() by defining USBD_DESC_STR_MAX. If
USBD_DESC_STR_MAX is not defined, the behavior remains unchanged and the
previous default value of 20 is used. A compile time error is produced
if USBD_DESC_STR_MAX is higher than 127 since the length of the string
plus header is returned in a single byte as (2 * len + 2). Similarly, a
compile time error is generated if the length is defined as less than 17
in order to ensure that there is enough room for the 16-character serial
number plus header.

* Fix spelling mistake.

Renamed irq_hander_chain_free_slot_head to irq_handler_chain_free_slot_head
(added missing l).

* Add documentation for gpio_add_raw_irq_handler functions.

Added a note that irq_add_shared_handler() is used internally and that
the function will assert if the maximum number of shared handlers would
be exceeded.
2024-01-12 20:41:22 -06:00
Maarten van der Schrieck
4d19007607
rp2_common/pico_standard_link: linker script fixes (#1539)
The resulting elf binaries contained an unusual section that leads to an error
when objcopy attempts to update a section (e.g. when using the picowota
combined build mechanism).

This seemed to be due to the order of sections, where two RAM-only sections
were split by a RAM/FLASH section. By moving the RAM-only sections together,
this issue disappeared.
2024-01-12 16:18:42 -06:00
Andrew Scheller
73dce4e540
Doxygen comment typo (#1463) 2024-01-12 15:59:57 -06:00
Brandon Ros
6bb38a87fa
fix cybt_mem_read debug log typo (#1480) 2024-01-12 15:59:29 -06:00
Andre Zeps
ff2e2028ea
Fixes #1468 (#1497)
* Fixes shadowing of a global declaration

Required for GCC 12.2.1

* Change other function pointers to be _func to be consistent

---------

Co-authored-by: Andre Zeps <andre.zeps@googlemail.com>
Co-authored-by: Graham Sanderson <graham.sanderson@gmail.com>
2024-01-12 15:55:43 -06:00
Graham Sanderson
46bddd6b54
save about 100 bytes of code (release) size for simple UART usage (#1431) 2024-01-12 09:41:37 -06:00
Timo Kokkonen
3274cc8aec
Fix CWE-686 in tools/elf2uf2/main.cpp:132 (#1585)
* Fix CWE-686: This argument should be of type 'void *' but is of type 'unsigned int'.

* Switch %p to %08x.
2024-01-08 12:33:21 -06:00
Peter Harper
d7bbadb291
Add a cmake function for configuring IP addresses (#1424)
The fix for the following issue adds some macros to configure default
ip addresses. These are expressed in hex which is a bit non-obvious to
set. So add a macro to convert from a string to the hex representation.

https://github.com/georgerobotics/cyw43-driver/issues/41
2024-01-05 09:33:41 -06:00
Peter Harper
9f45e3c905
Freertos background asserts if IPv6 is enabled (#1591)
If LWIP_IPV6=1 a request to update the multicast list occurs in a
callback in the low priority interrupt.

This makes an ioctl call into the driver, at the end of which is a call
to cyw43_await_background_or_timeout_us (see CYW43_DO_IOCTL_WAIT).
It is attempting to delay until there's "some work to do".

For Freertos this fails an assertion as an attempt is made to acquire a
semaphore in interrupt context.

Fixes #1590
2023-12-21 07:51:21 -06:00
Paul Grayson
9ff8a98df6
Add board definition for upcoming Pololu Zumo 2040 Robot (#1475) 2023-12-15 13:49:19 +00:00
Andrew Scheller
538b901290
Add watchdog parameter-validation, and fix up misleading comments (#1567) 2023-12-15 13:48:02 +00:00
Ghorban M. Tavakoly
e5e30b40fd
CMake cmake_minimum_required Deprecation Warning (#1546)
* Add ...3.27 to the cmake_minimum_required, and make minimum 3.13 everywhere


Signed-off-by: Ghorban M. Tavakoly <gmt3141@gmail.com>
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2023-12-15 13:45:42 +00:00
Joshua H
01804acb0a
added weact studio board variants (#1437) 2023-12-15 13:40:43 +00:00
Stanislav Rubint
4e3951df26
added Xerxes RP2040 board to includes (#1459) 2023-12-15 13:39:16 +00:00