Adds a new spi_transcieve_cb API which enables asynchronous
SPI transactions with callback notification.
The exist spi_transcieve_async API remains and uses the new
spi_transcieve_cb API to provide a k_poll_signal notifier.
The driver API changes to provide a callback and userdata
parameter to async transcieve. All drivers in the tree
have been updated to the change.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Normal usage for Bluetooth applications are getting close to or
already overflowing the default BT RX stack size of 1024.
For example:
- Discovery using the fixed ATT channel used 984 bytes.
- Discovery using an enhanced ATT channel used 1048 bytes,
which would lead to stack overflow using the default BT RX thread
stack size.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
At some point, package copy function was extended and renamed
to cbprintf_package_convert. However, flags used by this
function were not renamed and used contained COPY idiom.
Deprecating flags with COPY and replacing them with flags
with CONVERT idiom to match function which is utilizing them.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
There are some platforms like the lpcxpresso54114 that utilize gpio@0
so rename gpio@0 to gpio@ffff as this is a highly unlikely to conflict
with any real device.
Fixes#49439
Signed-off-by: Kumar Gala <galak@kernel.org>
stty operates on the file descriptor from stdin, but we want to operate
on stdout. If stdin and stdout are not the same tty then stty prints an
error.
Redirect stdout to stdin for stty calls.
Tested by running twister -T tests/subsys/shell </dev/null
Signed-off-by: Jeremy Bettis <jbettis@google.com>
When using periodic advertising list and receiving
hci_le_per_adv_sync_established event from controller with
an error code the bt_le_per_adv_sync_term_info would be
incorrectly populated with le_addr and sid. This is because
the current pending advertising sync object is not populated
with any le_addr and sid from bt_le_per_adv_sync_create as
those are not used when option
BT_LE_PER_ADV_SYNC_OPT_USE_PER_ADV_LIST is set.
Instead the bt_le_per_adv_sync_term_info shall be populated
with the le_addr and sid coming in the event from controller.
Signed-off-by: Jakob Krantz <jakob.krantz@u-blox.com>
This is a simple example of fuzz test integration with Zephyr apps
that displays LLVM libfuzzer's most important feature: it's ability to
detect and explore deep and complicated call trees by exploiting
coverage information gleaned from instrumented binaries.
See README.rst and the inline comments for details
Signed-off-by: Andy Ross <andyross@google.com>
Add support for LLVM's libfuzzer utility. This works by building an
executable with a "LLVMFuzzerTestOneInput()" entry point (which is
external to Zephyr, running in the host process environment!), which
it drives out of its own main() routine. The toolchain API is exposed
as just another sanitizer variant, which is clean.
Signed-off-by: Andy Ross <andyross@google.com>
Some applications of native_posix (libfuzzer in particular) want to
drive the native_posix environment from "outside" as a caller.
Unwrap the hwm_main_loop() utility into a callable hwm_one_event()
function instead, and move the loop into the main() function instead.
Likewise split out the initialization path into a API-visible
posix_init() function.
Finally adds a posix_exec_for() entry point which iterates over the
event interface for a given timeout.
Signed-off-by: Andy Ross <andyross@google.com>
The nitpicky mode warns about any broken reference. It is useful to keep
docs in good shape, however, there are some references that will never
be resolvable. Provide an initial list to decrease the number of
warnings that are not relevant/can't be fixed.
Note that the Sphinx nitpicky mode can be enabled by either setting
`nitpicky = True` in `doc/conf.py` or by setting the `-n` flag in
`SPHINXOPTS`.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
test cases in tests/subsys/settings/fcb, tests/subsys/settings/littlefs,
tests/subsys/setttings/nvs all depend on tests/subsys/settings/src and
tests/subsys/settings/fs, so update them in one commit.
Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
Re. peripheral phy update procedure: UNKNOWN_RSP from central was not
handled, leading to stall of procedure and subsequent procedure timeout
Proper handle and unit test for case added.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Multiple places we assumed that we could simply just do
sink_stream->iso == chan without checking if sink_stream
was NULL.
This commit fixes that by adding proper NULL checks for that,
as well as additional checks before defaulting to the
source_stream.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add prescaler property to prevent counter driver imprecise when CPU clock
is close to the PIT clock.
Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
With verbose output enabled, twister logs the cmake arguments as a
python array whenever it invokes cmake to generate a build system.
This is clunky output for manual reproduction, because it forces the
developer to manually join the arguments together for consumption by
the shell.
As an enhancement for this use case, use the standard library
shlex.join() function to produce a string that can be copy/pasted
directly into the shell on POSIX platforms.
We should use this function instead of str.join, because it correctly
handles things like shell quoting for options with spaces in them.
This function is not available on Windows, so we fall back on behavior
that is similar to the old one there.
The main difference on Windows is that the output now includes the
path to cmake as well, and not just its arguments. (This is the same
on POSIX, and is intended to help debug if multiple cmakes are
installed on the same machine.)
We are running cmake from a couple of different places, so doing this
cleanly requires adding a shared module with the platform abstraction.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
In Ubuntu 22.04 there is no need to add any extra repositories
to meet the minimum required versions for tools like cmake and dtc.
In fact, the Kitware repos don't even work in Ubuntu 22.04.
So, instructions updated to explain that step is only required for
Ubuntu versions older than 22.04.
Signed-off-by: Diego Herranz <diegoherranz@diegoherranz.com>
I am still interested in contributing to the documentation, but I am
tired of the spam I'm getting from zephyrbot whenever any pull request
touches anything in doc/.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Allow for having array types (array, uint8-array, string-array) be const.
This would allow for something like:
properties:
reg-names:
const: ["foo", "bar"]
To be supported.
Renamed function _check_prop_type_and_default to _check_prop_by_type
as part of this change and Moved the check for 'const' types into
_check_prop_by_type as its similar to the prop_type check and it was
easier to implement in _check_prop_by_type as we already extract
prop_type from the option in that function.
Signed-off-by: Kumar Gala <galak@kernel.org>
Fixes: #48950
Kconfig requires quoted strings in its configuration files, like this:
> CONFIG_A_STRING="foo bar"
But CMake requires expects that strings are without additional qoutes,
and therefore qoutes are stripped when loading Kconfig config filers
into CMake.
This is particular important when the string in Kconfig is a path to a
file. In this case, not stripping the quotes leads to an error as the
file cannot be found.
When users pass a string to Kconfig through CMake, they are expected to
pass it so that qoutes are correct seen from Kconfig, that is:
> cmake -DCONFIG_A_STRING=\"foo bar\"
In CMake, those qoutes are written as-is to Kconfig extra config file,
and then removed in the CMake cache.
After Kconfig processing, the Kconfig settings are read back to CMake
but without quotes. Settings that was passed through the CMake cache,
for example using `-D` are written back to the cache, but this time
without the qoutes. This results in Kconfig errors on sub-sequent CMake
runs.
Instead of writing the Kconfig value setting back to the CMake cache,
introduce an internal shadow symbol in the cache prefixed with `CLI_`.
This allows the CMake cache to keep the value correctly formatted for
Kconfig extra config creation, while at the same time keep existing
behavior for CONFIG_ symbols read from Kconfig.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Replaced hand coded use with DT_STRING_UPPER_TOKEN_BY_IDX. We should have
introduced the APIs when this was needed since the token values in
devicetree_generated.h should only be accessed via an API macro.
Signed-off-by: Kumar Gala <galak@kernel.org>
It was not possible to disconnect a pin using the nRF pinctrl driver.
That is, it was not possible to set PSEL to 0xFFFFFFFF (indicating pin
is not connected). This can be useful in certain scenarios, e.g. a
bootloader configures all signals of a certain peripheral but
application then needs to disconnect certain signals.
A new DT macro has been introduced to accomplish this:
NRF_PSEL_DISCONNECT. It can be used like this to explicitely disconnect
a peripheral signal:
```
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 1)>,
<NRF_PSEL_DISCONNECTED(UART_RX)>;
};
};
};
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Use SHELL_CMD_ARG() for argument check and add help, looking like:
...
$ pcie -h
pcie - PCI(e) device information
Subcommands:
ls :List PCIE devices
Usage: ls [bus:device:function] [dump]
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The command uses 1 optional parameter and this parameter can be at
maximum MAX_I2C_BYTES.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Since the interface quantity in the document of ESP32 C3
is different from the datasheet,
the quantity was corrected based on the datasheet.
Signed-off-by: Haruki Obuchi <dev@mail.nyarn.wtf>
When configuring the octo-flash in SPI/STR mode, the address size
must be on 24bits (and not on 32bits).
Despite the dev_data->address_width which is always seen as 4, the
erase command must reduce the AddressSize for this transfer mode.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Now that I2S drivers are enabled based on devicetree we can
remove any cases of them getting enabled by *.conf files.
Signed-off-by: Kumar Gala <galak@kernel.org>
Now that I2S drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.
Signed-off-by: Kumar Gala <galak@kernel.org>
Update I2S drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.
We remove 'depend on' Kconfig for symbols that would be implied by
the devicetree node existing.
Signed-off-by: Kumar Gala <galak@kernel.org>
This commit enables the SoC's flash memory controller.
- added lpc55s36 specific code in the NXP MCUX driver
to take advantage of the SoC's check-before-read
capability
- enabled the FMC node in the SoC's dtsi (iap)
- added the flash controller chosen node to the board's dts
Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
Add the missing piece of documentation for binary blobs: the submission
process. This follows the external source code process relatively close,
but it is relatively simpler.
The proposal includes a new issue template for requesting inclusion of
blob(s) for a particular module.
Fixes#7516.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit updates the ST HAL (hal_st) to pull in the fixes for the
warnings observed when building with the GCC 12.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>