Commit graph

81263 commits

Author SHA1 Message Date
Adam Wojasinski 6f201f03f6 drivers: pwm: pwm_nrfx: Revert workaround for stopping PWM instance
This reverts commit 36f4226b2f.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-07-13 13:21:41 +02:00
Adam Wojasinski 2460967c5b manifest: hal_nordic: Update hal_nordic revision
Pull in nrfx 3.1.0 release

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-07-13 13:21:41 +02:00
Andrey VOLKOV abfd234060 tests: gpio: add tests for GPIO_DT_RESERVED_RANGES_NGPIOS et al
Added basic test coverage for the:

   * GPIO_DT_RESERVED_RANGES_NGPIOS,
   * GPIO_DT_RESERVED_RANGES,
   * GPIO_DT_INST_RESERVED_RANGES_NGPIOS,
   * GPIO_DT_INST_RESERVED_RANGES,
   * GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC,
   * GPIO_PORT_PIN_MASK_FROM_DT_NODE,
   * GPIO_DT_INST_PORT_PIN_MASK_NGPIOS_EXC and
   * GPIO_PORT_PIN_MASK_FROM_DT_INST macros.

Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
2023-07-13 12:16:44 +02:00
Andrey VOLKOV 9e526dba97 gpio: add "gpio-reserved-ranges" support to GPIO_PORT_PIN_MASK_XX
Updated the implementation of the GPIO_PORT_PIN_MASK_FROM_DT_NODE and
GPIO_PORT_PIN_MASK_FROM_DT_INST macros to support
"gpio-reserved-ranges" device tree property.

Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
2023-07-13 12:16:44 +02:00
Andrey VOLKOV 6587fccd65 drivers: gpio: add "gpio-reserved-ranges" property support
Added

   * GPIO_DT_RESERVED_RANGES_NGPIOS(node_id, ngpios),
   * GPIO_DT_RESERVED_RANGES(node_id),
   * GPIO_DT_INST_RESERVED_RANGES_NGPIOS(inst, ngpios) and
   * GPIO_DT_INST_RESERVED_RANGES(inst)

as DT gpio's "gpio-reserved-ranges" property missing support.
The array of pins range pairs as shown below now works.

Also implemented paired extended versions of
GPIO_PORT_PIN_MASK_FROM_NGPIOS macro:

   * GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(node_id, ngpios) and
   * GPIO_DT_INST_PORT_PIN_MASK_NGPIOS_EXC(inst, ngpios)

with reserved (ie EXCluded) pins support too.

The implementation constraint is inherited from common DT limitations:
a maximum of 64 pairs can be used, i.e. theoretically no more than
128-bit gpio ports are supported (but resulted bitmask is actually
limited by the size of gpio_port_pins_t type).

Usage example:
The reserved mask, defined in the device tree as:
    gpio0: gpio0 {
       ....
       ngpios=<32>;
       gpio-reserved-ranges = <0 8>, <9 5>, <15 16>;
       ....
    };

and used in driver configuration as:
    {
     ...
     .gpio_reserved = GPIO_DT_RESERVED_RANGES(DT_NODELABEL(gpio0)),
     .pin_port_mask = GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(
				DT_NODELABEL(gpio0),
				DT_PROP(DT_NODELABEL(gpio0), ngpios)),
     ...
    }

correctly converts to:

    .gpio_reserved = 0x7fffbeff, 0b01111111 11111111 10111110 11111111)
    .pin_port_mask = 0x80004100, 0b10000000 00000000 01000001 00000000)

Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
2023-07-13 12:16:44 +02:00
Andrey VOLKOV c35d97534f include: util_internal: add Z_SPARSE_LIST_{ODD|EVEN}_NUMBERS
Add auxiliary lists Z_SPARSE_LIST_ODD_NUMBERS and
Z_SPARSE_LIST_EVEN_NUMBERS. These lists were originally created for
GPIO_DT_RESERVED_RANGES_NGPIOS macro, but may be useful for others
applications too.

Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
2023-07-13 12:16:44 +02:00
Andrzej Głąbek 41c33d7f32 drivers: flash: nrf_qspi_nor: Fix writing from unaligned RAM buffers
Flash API states that drivers should support write requests without
any restrictions on location or alignment of the source buffer.
Due to hardware limitations of the QSPI peripheral, the nrf_qspi_nor
driver currently fails to perform a write from a RAM buffer that is
not word-aligned. Fix this by using in such case the same mechanism
that is used when the source buffer is located in the internal flash
(copy data to a buffer located on stack).
Also correct the length parameter for writes from this stack-based
buffer to be the actual data chunk length, not always the size of
the buffer (as for CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE > 4
this may lead to overwriting of some data located next in the flash).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-07-13 12:09:02 +02:00
Alberto Escolar Piedras 9be7b59b4a ctf tracing: native/host backend: Refactor to support embedded C libraries
Split this tracing backend in a top and bottom to enable
building it with embedded libCs with the native simulator.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-13 05:47:08 -04:00
Loic Poulain df7749129f samples: cdc_acm: Add 96b_carbon to usbd-next board
This board can rely on udc_stm32 usbd-next driver.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2023-07-13 10:44:42 +02:00
Loic Poulain e8e2b53849 drivers: usb: udc: add STM32 UDC driver
Add UDC driver for STM32 based MCU, relying on HAL/PCD.
This has been tested with cdc_acm sample on the following boards:

- 96b_carbon (STM32F4)
- disco_l475_iot1 (STM32L4)
- nucleo_wb55rg (STM32WB)
- nucleo_h723zg (STM32H7)
- stm32f3_disco (STM32F3)

This fails at runtime for the following:

- b_u585i_iot2a (STM32U5)

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2023-07-13 10:44:42 +02:00
Joakim Andersson 82024ad5cf tests: arch: arm: Use a more common SHA algorithm
The profile type "not set" uses the "default crypto config" header.
However platform may set their own crypto configuration headers.
SHA-512 algorithm is not the most common algorithm to support and
are for example disabled in profile types medium and small.

Change to SHA-256 which is much more common and is even needed
internally by TF-M for protected storage and sub-key derivation.

Update the QEMU icount setting to make the interrupt occur during
the secure call to TF-M.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-07-13 10:44:08 +02:00
Wei-Tai Lee f2e0f787bf drivers: i2c: add error handling
Return errors when failing at consecutive transactions and
missing targets.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2023-07-13 09:23:39 +02:00
Wei-Tai Lee fc89a85c29 drivers: i2c: add thread-safe semaphore
Add a semaphore to ensure that only one transaction
happens at a time when threads want to transfer
simultaneously.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2023-07-13 09:23:39 +02:00
Mariusz Skamra 1ca75e3b6e Bluetooth: audio: ascs: Fix invalid memset of QoS parameters
This fixes invalid memset of QoS parameters that may happen if Config
Qos operation is requested on ASE in QoS Configured state. In such case
if the requested parameters have been rejected, the ASE QoS parameters
shall remain unchanged (were memset instead). Otherwise, the stack shall
send QoS Configured state notification with cleaned up parameters (all
zero's) which was not done.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-13 09:23:24 +02:00
Jordan Yates 1c2dba2107 drivers: modem: cache delimiter string length
Cache the delimiter string length in `parse_params`, instead of
calculating it on each character in the match buffer.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-13 09:23:05 +02:00
Jordan Yates 76c1a2019a drivers: modem: skip quoted delimiters
Given the following response: `+CIPSTA:ip6ll:"FE80::EDC:7EFF:FEDD:110C"`

The response delimiter is `:`, but there is also a quoted string that
contains the delimiter character. These delimiters should not be
considered when searching for the end of a parameter.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-13 09:23:05 +02:00
Wilfried Chauveau 965d30537f arch: arm: cortex_m: fault: Improve handling of fault escalation on armv6-m
The current implementation causes a lockup of the core when the exception
originates from an invalid/unreachable pc. This fix first verifies on
armv6-m and armv8-m.base that pc was in an expected runnable region,
namely:

- .text
- .ramfunc
- .itcm

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2023-07-13 09:22:46 +02:00
Marcel Krüger f2ba0b7ae2 drivers: fuel_gauge: max17048: Remov unused var
Remove the unused variable 'data' from function
max17048_emul_transfer_i2c()

Signed-off-by: Marcel Krüger <marcel.krueger@ithinx.io>
2023-07-13 09:21:52 +02:00
Gerard Marull-Paretas 4c4e2c5213 drivers: spi: fix spi_config structure documentation
`@param` can't be used to document struct fields. Inline each field
documentation and improve it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-13 09:21:45 +02:00
Gerard Marull-Paretas 2c3165d187 drivers: spi: add opaque type to encode SPI operation flags
Since flags can use either 16/32-bit depending on
CONFIG_SPI_EXTENDED_MODES, add a new opaque type that uses the correct
bit-width depending on that option. This allows us to simplify the
structure layout.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-13 09:21:45 +02:00
Gerard Marull-Paretas 8ce048b8e1 drivers: spi: fix CS documentation
`spi_cs_control` `cs` field is no longer a pointer, but a struct member.
Clarify it must be zero-initialized if not used. Remove confusing
comment about the need to use `device_is_ready()` on `cs` field,
`spi_is_ready_dt()` is the only thing users need to do.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-13 09:21:45 +02:00
Dawid Niedzwiecki cf3b0381ae mgmt: ec_host_cmd: fix init of npxc shi backend
Make sure not to access not assigned pointer at the begining of the
initialization.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-07-13 09:21:08 +02:00
Benjamin Cabé 5fe47c255b include: sys: util_macro: Add UTIL_DEC(x) doc
Added missing Doxygen documentation for UTIL_DEC(x) macro.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-13 09:21:00 +02:00
Benjamin Cabé 262b72a2fa include: sys: util_macro: remove duplicate DEFINEs
Some UTIL_INC_*** DEFINEs were incorrectly appearing twice.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-13 09:21:00 +02:00
Benjamin Cabé 3544e9163d include: sys: util_macro: fix bogus UTIL_X2 defs
Fixed some invalid defines in the UTIL_X2_*** series.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-13 09:21:00 +02:00
Benjamin Cabé 986d0c9e89 doc: doxygen: Enable Doxygen autobrief
Enable Doxygen AUTOBRIEF feature for both Javadoc and Qt style
documentation blocks. This treats the first sentence of a documentation
block as a brief description even when no @brief tag is present. This makes
the overview sections of the generated documentation much more useful.

See https://www.doxygen.nl/manual/config.html#cfg_javadoc_autobrief and
https://www.doxygen.nl/manual/config.html#cfg_qt_autobrief

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-13 09:20:51 +02:00
Gerard Marull-Paretas 7c418a065c doc: requirements: update Sphinx and rtd theme
rtd_theme 1.2.x is required when using Sphinx >= 6.0, otherwise certain
features like search are broken. Note that jQuery support needs to be
enabled manually now using `sphinxcontrib.jquery` extension. Also update
Sphinx to latest 6.x release, 6.2 as it contains some fixes.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-07-12 19:59:03 -04:00
Florian Grandel 390b119885 doc: release-notes: document cc13/26xx timer change
Documents the changes to the naming of the cc13/26xx timer compatible
and Kconfig options.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-12 19:57:25 -04:00
Florian Grandel 8d2b461e6c doc: release-notes: remove typo
Removes a misplaced heading from the driver API list.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-12 19:57:25 -04:00
Florian Grandel 74dcbaba32 dts: ti: cc13xx_cc26xx: align binding file name
Aligns the filename of TI's CC13/26xx system timer peripheral devicetree
binding to its compatible string.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-12 19:57:25 -04:00
Ryan McClelland f1a992c87a drivers: sensors: bmi08x: add initial support for bmi08x
This adds support for the bosch bmi085 and bmi088. This also includes
support for data sync mode.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-07-12 14:53:16 -05:00
Kacper Dalach f9773859c4 drivers: clock_control: stm32h5: boot_clock_assert_fix
When the image is chain-loaded, clocks may already by initialized.
The driver was lacking support for already configured HSE and
PLL sources. When CONFIG_ASSERT=y get_startup_frequency was
failing since it did not recognize these sources.

It's the same issue that was addressed in #58109 for stm32u5.

Signed-off-by: Kacper Dalach <dalachowsky@gmail.com>
2023-07-12 21:11:00 +02:00
Thomas Stranger ce74b60d77 drivers: sensor: adxl362: coverity: 316152 unchecked return value
Check and propagate two return values.
Don't need to check return of the part id request, but make
sure that the value is initialized before the comparison.

Fixes #58575
Coverity-CID: 316152

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2023-07-12 10:53:56 -05:00
Thomas Stranger 7c6a340413 drivers: sensor: tmd2620: coverity 316443 unchecked return value
The return value is consciously not checked, because the operation
is expected to fail. And the real request is executed afterwards.

Fixes #58593
Coverity-CID: 316443

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2023-07-12 10:53:56 -05:00
Benjamin Cabé ae22ff648c emul: doc: Fix SBS Gauge emulator doc typos
Capitalized group name to preserve alphabetical order in device driver APIs
list, and fixed minor typo (backed->backend)

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-12 16:39:31 +02:00
Jaxson Han 8c81cc7179 tests: subsys: rtio: Reset the spsc before the test starts
The test case test_spsc_throughput reuse spsc without reset. Fix it by
resetting the spsc before the test case starts.

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2023-07-12 14:27:40 +00:00
Gerard Marull-Paretas 7f9215da0e doc: move requirements to doc/
Zephyr scripts do not require documentation dependencies, so let's
move them from scripts/ to doc/.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-12 09:13:49 -04:00
Gerard Marull-Paretas b990a5fdb6 doc: update sphinx/docleaf requirements
Update Sphinx and docleaf. Note that Sphinx 7 is not an option because
rtd_theme requires <= 6 (see
https://github.com/readthedocs/sphinx_rtd_theme/issues/1463).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-12 09:13:49 -04:00
Gerard Marull-Paretas d3d93d4399 doc: enable Sphinx tracebacks
When something goes wrong in Sphinx or extensions, we'll get a detailed
traceback, so we can easily debug issues in CI.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-12 09:13:49 -04:00
Gerard Marull-Paretas 2c89bf5798 doc: add cmake SPHINXOPTS_EXTRA option
Add a new CMake option to append options to SPHINXOPTS. This allows us
to easily extend default SPHINXOPTS. This patch also restores the "-j
auto" option in CI (now that we use a custom runner).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-12 09:13:49 -04:00
Gerard Marull-Paretas 85ec85384a doc: add -W --keep-going to the default SPHINXOPTS list
Run Sphinx in warnings as error mode, but keep going so that all issues
are reported to the user.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-12 09:13:49 -04:00
Gerard Marull-Paretas a211469734 ci: doc-build: use zephyr-runner-linux-x64-4xlarge
This should allow us to observe faster build times when using
parallelization.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-12 09:13:49 -04:00
Marcel Krüger 8d6f74ad1f pm: Supplement pm_device_is_powered doc
Supplement the documentation pm_device_is_powered()
adding that a device is assumed powered in case
the device does not support PM or is not on a power domain.

Signed-off-by: Marcel Krüger <marcel.krueger@ithinx.io>
2023-07-12 14:53:59 +02:00
Jordan Yates 83b1a983a9 net: lib: tls_credentials: earlier initialisation
The TLS credentials libraries are purely software constructs with no
external dependencies, run them immediately after the kernel setup to
allow other initialisation functions to add credentials without the
requirement to run in the back half of the `APPLICATION` priority.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-12 14:50:09 +02:00
Anders Storrø 8c7ffac4a6 Bluetooth: Mesh: Fix err in mod_app_list packing
Fixes erroneous packing/unpacking of model app list messages
in the configuration client and server. According to the mesh 1.1
protcol spec (4.3.1.1) two app indexes shall be packed in a 3 octet
interleaved format. The current implementation packs them in 4 octets.

This commit also provide a helper function for unpacking key indexes
as public API to facilitate future config model callback API.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-07-12 14:37:23 +02:00
Andy Sinclair 910d43805b drivers: watchdog: npm1300: Added watchdog driver
Added watchdog driver for nPM1300

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-07-12 14:36:56 +02:00
Andy Sinclair 4048348e3e drivers: gpio: gpio_npm1300: Added reset and power loss modes
Added configuration of nPM1300 GPIO pins as reset or
power loss warning.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-07-12 14:36:56 +02:00
Andy Sinclair c793764549 drivers: mfd: mfd_npm1300: Added timer configuration function
Timer configuration function added

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-07-12 14:36:56 +02:00
Franciszek Zdobylak 81c584e3e7 dts: arm: silabs: Fix efr32bg22 usart node
Remove duplicated property and unnecessary newlines.

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
2023-07-12 14:36:38 +02:00
Emil Gydesen b9c16c9cdd Bluetooth: ISO: Add comment for peripheral SDU size
Adds a comment stating the state of the peripheral SDU size
and why it is being assigned the PDU size on CIS established.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-12 14:36:28 +02:00