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
Ensures the async worker is unregistered from the context before releasing the
blocking thread. This prevents the `sync_func_call_t` stack object from being
accessed after it goes out of scope, avoiding a use-after-return condition
in multicore `async_context_execute_sync()` scenarios.
Fixesraspberrypi/pico-sdk#2433
Signed-off-by: Goran Mišković <schkovich@users.noreply.github.com>
* Don't include the picobin end block when signing, as picotool will add a new end block anyway
* small whitespace fix
---------
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
This raises a warning with recent CMake versions, and isn't required due to the `pico_add_link_depend` already added for these files
Fixesraspberrypi/picotool#235
* Call enable_interrupts when initialising IRQs
Fixesraspberrypi/pico-examples#584, supercedes raspberrypi/pico-examples#588
* move enable_interrupts to the end though it doesn't make much difference
* guard enable_interrupts by !RP2040 as it isn't needed there
---------
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
* Fix issue 2454 flash safe execute lockout
The lockout state is controlled by a shared variable. The FIFO
is used to begin a lockout and acknowledge it (i.e.
multicore_lockout_handshake works as before) but the end
of the lockout is now signalled by updating the shared variable.
This ensures that timeouts are recognised reliably by the victim core.
__wfe and __sev are used to signal updates to the shared variable
in order to avoid polling.
* Update documentation for multicore_lockout_end functions
* Simplification, remove magic number (not required)
* Review improvements
* Restore use of non-zero magic number
* Add support for wiznet_w5100s_evb_pico2
This board has an RP2350 and a smaller 2MB flash
Signed-off-by: Sergio R. Caprile <scaprile@gmail.com>
* update to new syntax
Signed-off-by: Sergio R. Caprile <scaprile@gmail.com>
* fix missing definition
Signed-off-by: Sergio R. Caprile <scaprile@gmail.com>
---------
Signed-off-by: Sergio R. Caprile <scaprile@gmail.com>
* Minor fixups to compile with TF-M
TF-M requires c99 compatibility, which throws errors at these lines
This patch fixes those errors and is currently applied by TF-M when cloning the SDK, but it would be better to get it into the SDK by default so that patch isn't needed
* #ifdef only on __STRICT_ANSI__
Also fix devinfo type
This prints out the location of the picotool executable being used
For example:
* `Using picotool from /usr/local/bin/picotool` for a system install
* `Using picotool from /home/name/pico-examples/build/_deps/picotool/picotool` for a picotool fetched by the SDK
Since cyw43_spi_reset() may be executed from an async context, we
should use cyw43_delay_ms() instead of sleep_ms(). This is particularly
a problem when using the async_context_threadsafe_background backend,
because sleep_ms() will assert in an ISR.
The mbedtls methods have dropped the "_ret" from the function names in
mbedtls 3.x. Use the new function names but support the old names if
mbedtls 2.x is used.
You can deinitialise cyw43 and btstack by calling btstack_cyw43_deinit
but its pending and timeout workers are not removed which means they can
keep running, whcih causes a crash.
Add a btstack_run_loop_async_context_deinit method and call this from
btstack_cyw43_deinit.
* Rework use of pico_cmake_set in board headers to make it slightly less magic/confusing
- prefer "pico_cmake_set(var, value)" over "// pico_cmake_set var = value"
- prefer "pico_cmake_set_default(var, value)" over "// pico_cmake_set_default var = value"
- move these inside the header include guards as CLion complains
Note that the macros are defined in "pico.h" however that is not explicitly included by the board headers; this
will probably confuse some VS code syntax highligting, so lets see how it looks - i'd prefer to avoid having
to include a header just for this
* Update check_board_header.py with the new pico_cmake_set formats
* Add brackets back around `PICO_FLASH_SIZE_BYTES` settings
The python script checks for an exact match between the #define and the pico_cmake_set_default, so fails without the brackets
* Rename to pico_board_cmake_set and pico_board_cmake_set_default
* Fix support for old versions
---------
Co-authored-by: William Vinnicombe <william.vinnicombe@raspberrypi.com>
The workaround for errata RP2350-E10 overwrites the last block in flash.
This will overwrite the BT flash storage causing a paired BT connection
to fail. Move the default flash storage location to 3 sectors from the
end of flash for RP2350 where A2 support is required.
This will require existing BT pairings to a Pico device to be removed
and readded.
Fixes#2322