* Improve error code description for some cyw43 connection methods
Fixes#2564
* Apply suggestions from code review
Put error description on separate lines for clarity.
Co-authored-by: Andrew Scheller <lurch@durge.org>
---------
Co-authored-by: Andrew Scheller <lurch@durge.org>
* hardware_flash: preserve QSPI pad state over flash access calls.
Add new function, flash_start_xip(), which explicitly performs a
first-time XIP setup (including initialising pads). This is mostly
useful for PICO_NO_FLASH=1 binaries where there is actually an attached
external flash.
Fixes#2333
* Address review comments
* miscellaneous cleanup:
* cleanup some #ifdefs which were slightly hacky when RP2350 was added; use HAS_ flags in preference to PICO_RP2040/RP2350
* make some dependencies more explicit - i.e. compile if the user doesn't want to include certain libraries
* cleanup some directory A -> directory B relative path names in CMakeLists.txt to be SDK root -> directory B
* Update mainpage.md
Re-wrote to be in line with style guidance and to be easier to read.
* Changed "adjust" to "refine" (previously "fine-tune").
* Updated first paragraph of the "SDK design" section.
* Minor fixes
* Minor grammatical updates
* Changed "adjust and refine" to "tweak"
* Default to allocating spacer sections (stack & heap), with PICO_CRT0_ALLOCATE_SPACERS config option to disable the behaviour
* Add pico_check_linker_script function to check for compatibility of custom linker scripts
* tweak error message
---------
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
* Fix powman_timer_use_gpio
Fixes#2471
* Fix docs for clock_gpio_init etc for RP2350
You can also use gpios 13 and 15 on RP2350
* macro-ify the mapping from GPI to ext_time_ref_source - note i kept this private for now, as it's a bit murky
---------
Co-authored-by: graham sanderson <graham.sanderson@raspberrypi.com>
* add pioasm --version, and print version number in generated files
* Hook up pio version string in Bazel build
---------
Co-authored-by: Armando Montanez <amontanez@google.com>
* Update makefsdata.py to support content encoding
changed makefsdata.py slightly to allow it to recognize files that have been manually gzipped (e.g. "mysite.css.gz") to send the proper Content-Encoding information in the response headers.
* Code review fix
---------
Co-authored-by: Peter Harper <peter.harper@raspberrypi.com>
* Provide an easy way to disable cyw43 logging
All cyw43 logging uses CYW43_PRINTF by default. To disable logging you
have to define this to do nothing. There's no simple way to achieve
this. Make it easier by adding PICO_CYW43_LOGGING_ENABLED which can be
set to zero to disable CYW43_PRINTF.
Fixes#2523
* teensy style change
---------
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
* Use platform/generator agnostic CMake commands
Change the README to use platform/generator agnostic commands to create and build the CMake project
* review fixup
* Apply suggestions from code review
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
* Whitespace fix
---------
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
The master SDK branch (and the SDK release tags eg 2.1.1) should point to specific picotool tags, to ensure you get a compatible picotool (note this is beyond the 2.1.1 tag in master, so will just fix this for users who check out the HEAD of master)
* Add action to check board headers when modified
* Fix invalid escape warning
* Check for more board header errors before exiting script
* Also run when action file changes
* Add back newline at end of check_all_board_headers.sh
* Remove python install step
* `e.__str__()` -> `str(e)`
* async_context_threadsafe_background: fix incorrect mutex assertion in cross-core execute_sync()
In multicore configurations, `async_context_threadsafe_background_execute_sync()`
contained an overly strict assertion used during cross-core calls:
```c
hard_assert(!recursive_mutex_enter_count(&self->lock_mutex));
```
This check fails whenever the `lock_mutex` is held — regardless of *who*
owns it — even in valid situations where the async core is processing background
work.
The assertion does **not check ownership**, only that the `enter_count` is zero,
which leads to false-positive failures on valid cross-core calls.
This patch replaces the enter-count check with a core-aware assertion:
```c
hard_assert(self->lock_mutex.owner != calling_core);
```
This ensures the current core does not recursively hold the mutex, preventing
deadlocks while allowing valid usage where the *other* core owns the lock.
The patch ensures that both `get_core_num()` and `hard_assert()` remain inlined
as in the original implementation, preserving the performance characteristics
under `-Os` and `RelWithDebInfo` builds.
Fixes#2527
Signed-off-by: Goran Mišković <schkovich@users.noreply.github.com>
* fix indents
* Update async_context_threadsafe_background.c
Use pre-existing mutex owner method; add a comment
* oops
* typo
* Update async_context_threadsafe_background.c
---------
Signed-off-by: Goran Mišković <schkovich@users.noreply.github.com>
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
* Add definition for the Waveshare RP2350-USB-A board
* Set XOSC startup delay multiplier for the RP2350-USB-A
* Update waveshare_rp2350_usb_a.h
Tweak to the PICO_DEFAULT_PIO_USB_DP_PIN define
---------
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
Add bin/uf2/dis/hex output files as byproducts, so they get cleaned up
This is only best-effort, because BYPRODUCTS doesn't support generator expressions, so everything must be evaluated at the time pico_add_extra_outputs is called
* async_context_freertos: Add support for configSUPPORT_STATIC_ALLOCATION
The implementation of async_context_freertos currently assumes that
FreeRTOS has been configured with `configSUPPORT_DYNAMIC_ALLOCATION`,
which causes it to allocate semaphores, timers and tasks from the heap.
However, some projects may prefer `configSUPPORT_STATIC_ALLOCATION`,
which requires memory to be allocated ahead of time. This change allows
async_context_freertos to support either static or dynamic allocation.
The way this works is when `configSUPPORT_STATIC_ALLOCATION` is enabled,
`async_context_freertos` struct will reserve extra space for the static
objects (e.g. `StaticSemaphore_t`) and it will prefer to use the static
creation functions (e.g. `xSemaphoreCreateBinaryStatic()`). For the task
creation, the user will be responsible for allocating the stack memory
and setting the task_stack field in `async_context_freertos_config_t`.
For convenience, The `cyw43_arch_init_default_async_context()` function
will reserve `CYW43_TASK_STACK_SIZE` words of stack space in static
memory.
* Assert that task_stack is set
* Add CYW43_NO_DEFAULT_TASK_STACK
In theory you can use your own async context therefore bypassing
cyw43_arch_init_default_async_context, which would leave
cyw43_async_context_freertos_task_stack unused.
Add a #define for this rare situation.
* Update documentaton for async_context_freertos_config.task_stack
---------
Co-authored-by: Peter Harper <peter.harper@raspberrypi.com>
* Adafruit Fruit Jam board
* add Adafruit Fruit Jam specific pins
* fix pin typos and errors
* update to Fruit Jam rev D, address #2510 review
* add additional PICO_DEFAULT_* pins
* add PICO_AUDIO_I2S_* pins
* Add action to check configs & defines
* Check for all errors before exiting scripts
* Add extract_cmake_functions to the checks
* Fix invalid escape sequence warning
* Bazel add default compliation args for opt and debug. Can be overriden
* Add docstrings for new compilation mode override flags
* Remove cc_args_list shims, which arent needed anymore for cc_feature
* Add Compilation mode overrides to the BAZEL_ONLY_ALLOWLIST, these dont exist in Cmake
* For completness add the fastbuild default options, and override flag
* Remove the default options for fastbuiild, as the bazel doc defaults didnt make much sense, nor work. Leaving these for completness and future addition
* Rename the config and constraint labels from OVERRIDE to REMOVE_DEFS
* Change naming of flags from PICO_COMPILATION_XXX_REMOVE_DEFS to PICO_COMPILATION_NO_XXX_ARGS for OPT, FASTBUILD & DEBUG variants
* Fixup spellling mistakes, and comments
* Fix typo PICO_COMPILATION_NO_FASBUILD_ARGS to FASTBUILD