Commit Graph

69040 Commits

Author SHA1 Message Date
Enjia Mai 8ae7fd7bd9 tests: board: esp32: move the cache_coex test to new ztest API
Migrate the testsuite tests/boards/espressif_esp32/cache_coex/
to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-26 14:27:12 +00:00
Tom Burdick 4c20403629 spi: callback API for asynchronous transcieve
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>
2022-08-26 09:29:48 -04:00
Herman Berget 096fc3b826 Bluetooth: Increase RX thread stack size
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>
2022-08-26 12:52:22 +02:00
Krzysztof Chruscinski bb74b4f028 lib: os: cbprintf: Renamed flags used for conversion function
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>
2022-08-26 12:52:08 +02:00
Kumar Gala f3ff449524 tests: devicetree: device: Rename gpio@0 to avoid name conflict
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>
2022-08-26 12:51:45 +02:00
Jeremy Bettis 562b291704 twister: Set stdin explicitly on stty calls
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>
2022-08-26 12:51:28 +02:00
Jakob Krantz 605d8c85d8 Bluetooth: Host: Fix invalid sync term callback params
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>
2022-08-26 12:51:05 +02:00
Andy Ross 7f5e1904cc samples: Add fuzz sample
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>
2022-08-26 11:57:46 +02:00
Andy Ross 65d657685e arch/posix: Add libfuzzer support
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>
2022-08-26 11:57:46 +02:00
Andy Ross bb950b2d63 boards/native_posix: Unwrap main loop to expose external event API
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>
2022-08-26 11:57:46 +02:00
Gerard Marull-Paretas 038ce40c7a doc: add nitpicky mode ignores
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>
2022-08-26 11:57:26 +02:00
Meng xianglin cd288ff907 tests: settings: functional: move to new ztest API
All test cases in tests/subsys/settings/functional are moved
to new ztest API.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-08-26 11:56:51 +02:00
Meng xianglin 96484695e7 tests: settings: move to new ztest API
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>
2022-08-26 11:56:51 +02:00
Erik Brockhoff 7719bc6785 Bluetooth: controller: llcp: fix unhandled rsp in periph phy upd proc
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>
2022-08-26 11:56:33 +02:00
Emil Gydesen 70dfbb6747 Bluetooth: Audio: Add missing NULL checks when looking up audio_iso streams
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>
2022-08-26 11:56:15 +02:00
Wei-Tai Lee 2ac6eafe66 boards: riscv: adp_xc7k_ae350: add Kconfig options for hwinfo driver
Add Kconfig options to support hwinfo driver on adp_xc7k_ae350.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2022-08-26 11:55:55 +02:00
Wei-Tai Lee 00b97feb56 drivers: hwinfo: add Andes hwinfo driver
Add hwinfo driver for Andes.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2022-08-26 11:55:55 +02:00
Jimmy Zheng 86b04c8a33 boards: riscv: adp_xc7k_ae350: support Andes atcpit100 counter driver
Support counter driver on Andes adp_xc7k_ae350.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2022-08-26 11:55:36 +02:00
Jimmy Zheng b24c3b9fe9 dts: riscv: andes_v5_ae350.dtsi: add PIT prescaler property
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>
2022-08-26 11:55:36 +02:00
Jimmy Zheng 94e1c09a31 dts: bindings: timer: add Andes atcpit100 yaml
Add Andes atcpit100 yaml file.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2022-08-26 11:55:36 +02:00
Jimmy Zheng a2cc4b702f drivers: counter: add Andes atcpit100 counter driver
atcpit100 counter driver support 4 32-bit PIT channel, using channel 3 as
the default counter.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2022-08-26 11:55:36 +02:00
Martí Bolívar 88aa873fbc twister: improve logging of cmake commands
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>
2022-08-26 08:53:14 +02:00
Diego Herranz 66d47cae04 doc/develop/getting_started: update for Ubuntu 22.04
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>
2022-08-25 23:39:23 -07:00
Martí Bolívar 6c03cb9fb4 MAINTAINERS: remove my doc collaborator status
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>
2022-08-25 18:30:07 -07:00
Martí Bolívar f739b85c8d MAINTAINERS: remove redundant files entry
The dts/bindings/test/ entry is already covered by dts/bindings/
above.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-08-25 18:30:07 -07:00
Kumar Gala f1660f4d51 edtlib: allow const arrays
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>
2022-08-25 18:11:27 -07:00
Torsten Rasmussen 4cb2ef83bf cmake: kconfig: preserved quotes for Kconfig string values
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>
2022-08-25 17:53:11 -07:00
Kumar Gala 8a5d568a79 dts: Standardize string token names for arrays
Use the same postfixes for string arrays as we use for strings.  Keep
just the _STRING_*_TOKEN) variants.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-25 15:00:24 -07:00
Kumar Gala 04adb949d1 soc: xilinx: zynq7000: move to using DT_STRING_UPPER_TOKEN_BY_IDX macro
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>
2022-08-25 15:00:24 -07:00
Gerard Marull-Paretas 18fe7bc630 tests: drivers: pinctrl: nrf: test disconnected pins
Update test to cover disconnected pins.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-25 14:38:26 -07:00
Gerard Marull-Paretas 223cc3c6bd drivers: pinctrl: nrf: add support for disconnecting a pin
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>
2022-08-25 14:38:26 -07:00
Andrei Emeltchenko 7c81ee9d18 pcie: shell: Add help and argument check
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>
2022-08-25 21:14:51 +00:00
Andrei Emeltchenko d46c7595d9 pcie: shell: Verify command parameters
Exit on wrong parameter for pcie ls command.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-08-25 21:14:51 +00:00
Sylvio Alves 7e9e3116e4 dtsi: esp32c3: add missing wifi node
Add ESP32C3 wifi entry in dtsi file.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-08-25 21:12:08 +00:00
Andrei Emeltchenko e224e4c4fe i2c: shell: Fix SHELL_CMD_ARG() parameter count
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>
2022-08-25 21:08:20 +00:00
Haruki Obuchi 653eb93593 doc: Fix interface quantity
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>
2022-08-25 21:06:45 +00:00
Francois Ramu f106465741 drivers: flash: ospi driver erase command on 24bits in SPI mode
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>
2022-08-25 21:05:27 +00:00
li biao 7e9b3a9744 tests: subsys: logging: move log_backend_init to new ztest API
Fix missing to https://github.com/zephyrproject-rtos/zephyr/issues/49004

Signed-off-by: li biao <biao1x.li@intel.com>
2022-08-25 21:04:58 +00:00
li biao edf3fe8a64 tests: subsys: logging: move log_backend_init to new ztest API
Move test subsys/logging/log_backend_init to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-08-25 21:04:58 +00:00
Kumar Gala 2030f658b5 I2S: remove defconfig/proj setting of I2S drivers
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>
2022-08-25 15:03:11 -05:00
Kumar Gala 1314d73104 I2S: remove Kconfig.defconfig* setting of I2S drivers
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>
2022-08-25 15:03:11 -05:00
Kumar Gala 324ee290f8 drivers: i2s: Update drivers to use devicetree Kconfig symbol
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>
2022-08-25 15:03:11 -05:00
Aastha Grover 8a730b818b samples: kernel: Add README for simple condition variable sample.
Add README for simple conditional variable kernel sample.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-08-25 13:24:14 -05:00
NingX Zhao 2ce20e5df6 tests: kernel: mheap: migrate mheap testcases
Move testcases to new ZTEST API.

Signed-off-by: NingX Zhao <ningx.zhao@intel.com>
2022-08-25 13:12:04 -04:00
Yves Vandervennet 9ecf1d3529 doc: lpcxpresso55s36 evk: documentation update
Added on-SoC flash to the list of supported features

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2022-08-25 10:24:41 -05:00
Yves Vandervennet 8d96cc42b6 nxp: lpcxpresso55s36 evk: enabling flash partitions.
Sample paritions added to the flash memory device node.

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2022-08-25 10:24:41 -05:00
Yves Vandervennet 6b66d7f266 flash: nxp: enabling lpc55s36's FMC
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>
2022-08-25 10:24:41 -05:00
Carles Cufi 80b4df8839 blobs: Document the submission process
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>
2022-08-25 11:10:53 -04:00
Gerard Marull-Paretas 056734bea8 soc: riscv: ite: remove pinmux/pinctrl dead code
Remove unused definitions coming from the pre-pinctrl era.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-25 13:55:47 +00:00
Stephanos Ioannidis 7253fb0f56 west.yml: Update ST HAL to pull GCC 12 warning fixes
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>
2022-08-25 22:29:49 +09:00