Commit graph

87689 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada ca45155a23 Bluetooth: Controller: Fix NULL pointer dereferencing in Sync ISO
Fix NULL pointer dereferencing when Host supplies an out of
bounds BIG handle.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-25 08:47:00 -05:00
Christopher Friedt 87635dd34a posix: do not define _PTHREAD_CANCEL_POS
_PTHREAD_CANCEL_POS is an implementation detail and should not
be defined in the global scope. Furthermore, _PTHREAD_CANCEL_POS
uses a reserved identifier (underscore followed by capital
letter).

Adjust definitions so that the implementation detail is only
used in the implementation and not in the interface.

Additionally, modify naming so that the non-standard macro does
not use a reserved identifier.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-25 06:29:16 -05:00
Christopher Friedt d2e729233d tests: posix: headers: add verification tests for more constants
Ensure that the "headers" test checks that the following constants
are defined:

* PTHREAD_PROCESS_SHARED
* PTHREAD_PROCESS_PRIVATE
* PTHREAD_COND_INITIALIZER
* PTHREAD_MUTEX_INITIALIZER
* PTHREAD_CANCELED

They were already defined by previous commits, but the test had not
been updated.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-25 06:29:16 -05:00
Christopher Friedt 19ef279dc3 posix: define PTHREAD_CANCELED globally
Move the definition of PTHREAD_CANCELED from pthread.c to
pthread.h.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-25 06:29:16 -05:00
Christopher Friedt 505e9be2e1 tests: posix: headers: ensure pthread_condattr_getclock() exist
These calls were added some time ago, so ensure they are checked
for existence.

* pthread_condattr_getclock()
* pthread_condattr_setclock()

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-25 06:29:16 -05:00
Christopher Friedt 131220cb95 tests: posix: headers: check pthread_spin_lock() et al exist
The simple header test was not updated to verify that the
following functions were implemented even though they were
implemented some time ago.

* pthread_spin_destroy()
* pthread_spin_init()
* pthread_spin_lock()
* pthread_spin_trylock()
* pthread_spin_unlock()

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-25 06:29:16 -05:00
Christopher Friedt ad5441bbdd posix: pthread: move pthread_equal() closer to pthread_self()
* "identity" functions grouped more closely
* posix_thread_pool_init() should be adjacent to the SYS_INIT()

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-25 06:29:16 -05:00
Shahar Hadas cc6bf66345 auxdisplay: Enhance SerLCD auxdisplay driver
Added export of command and special command delays as configurable options.

Signed-off-by: Shahar Hadas <shaharhd@gmail.com>
2023-11-24 22:04:22 +00:00
Christopher Friedt 0e11bcf5a0 tests: posix: add tests to ensure pthread_key_delete() works
Ensure that the correct key is deleted via pthread_key_delete().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-24 10:47:28 -05:00
Christopher Friedt a89fa32dac posix: pthread: ensure pthread_key_delete() removes correct key
Previously, `pthread_key_delete()` was only ever deleting key 0
rather than the key corresponding to the provided argument.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-24 10:47:28 -05:00
Pieter De Gendt e3f5c96667 modules: nanopb: Let Nanopb search for protoc
The Nanopb cmake locates the protoc executable, verify the result
instead of doing it ourselves.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-11-24 15:37:37 +01:00
Dean Sellers 897b300b2e drivers: spi: esp32xx: Fix CS reset over split transaction
In the case where a transaction is spilt due to the rx buff len
being longer than the tx or the transaction buffer exceeding the
size of the requested buffer with non gpio CS, the chip select
would be de-asserted/asserted in the middle of the transaction.

Fixes: #57577

Signed-off-by: Dean Sellers <dsellers@evos.com.au>
2023-11-24 14:45:51 +01:00
Igor Druzhinin 2abf0314c2 toolchain: gcc: fix GCC < 11.0.0 build with -Wundef
When building using GCC version < 11.0.0, TOOLCHAIN_CLANG_VERSION is not
yet defined in gcc.h. Nevertheless, it's still needed due to reuse of
gcc.h in llvm.h.

Guard access to TOOLCHAIN_CLANG_VERSION to fix that.

Signed-off-by: Igor Druzhinin <igord@xilinx.com>
2023-11-24 14:45:08 +01:00
Johan Hedberg f89c5ddd1a samples: chre: Fix format strings for size_t types
The correct printf format specifier for size_t is %zu. Without this
change the sample generates warnings like this:

warning: format '%u' expects argument of type 'unsigned int', but
argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-24 13:10:24 +02:00
Jun Lin 3f9d24e4c0 mgmt: ec_host_cmd: shi_npcx: support the enhanced mode
The original SHI module only has one output FIFO buffer. It costs a lot
when the driver has to send/change the protocol control code because it
must fill out all 128 bytes of output FIFO. In npcx4, we introduce
another output buffer in 1-byte depth. These two buffers can switch back
and forth during the transaction. We can use the single-byte buffer
to send the control code and the 128-byte FIFO to send the data payload.
It helps improve the SHI driver's efficiency.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-11-24 11:45:13 +01:00
Jun Lin 717a7835bb mgmt: ec_host_cmd: shi_npcx: add pm_policy lock
Implement the pm_policy lock to prevent the chip enters the deep slepp
mode while shi transaction is ongoing.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-11-24 11:45:13 +01:00
Jun Lin ba38a54faa dts: npcx: shi: support two version of shi hardware
The shi module in npcx4 supports the enhanced buffer mode.
Add a new compatible string "nuvoton,npcx-shi-enhanced" for it.
Then the shi driver can determine if it should use the enhanced buffer
mode based on the compatiable string.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-11-24 11:45:13 +01:00
Jun Lin 74f07b04ff soc: npcx: shi: add new registers for npcx4
Add the SHI enhanced buffer mode register definition for npcx4.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-11-24 11:45:13 +01:00
Lukas Streitenberger 10a167f6c1 Bluetooth: TBS: Added missing callState notifications
Changes of call state were not notified. Fixed by calling notify_calls
in respective functions.

Signed-off-by: Lukas Streitenberger <lukas.streitenberger@wsa.com>
2023-11-24 11:39:34 +01:00
Jeppe Odgaard 05025e6b7c cmake: add initlevels to usage
Fix missing `initlevels` entry in the `usage` command.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-11-24 11:39:21 +01:00
Benjamin Cabé 199743de01 ci: hotfix: Use latest version of greetings action
This fixes a bug with the action's Docker container apparently not being
able to run Node correctly anymore...

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-24 10:38:25 +00:00
Yong Cong Sin ecb2df0444 scripts/checkpatch: add __unused to the $Attribute list
Add `__unused` to the `$Attribute` family along with its
`__maybe_unused`, `__always_unused` & `__used` brothers, so
that:

```c
__unused int ret;
```

is recognized as variable declaration, and doesn't raise
`LINE_SPACING` warning in CI.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-24 09:27:39 +00:00
Torsten Rasmussen 13f3c6d0bd sysbuild: introduce Kconfig setting for controlling HCI IPC inclusion
Follow-up: #64704

Introducing NET_CORE_IMAGE_HCI_IPC Kconfig setting to control inclusion
of HCI IPC image when building through sysbuild.

This allows users with custom netcore applications to avoid inclusion
of the default HCI IPC image.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-24 09:27:43 +01:00
Bartosz Bilas 20acd64a1b doc: zbus: fix msg subscriber thread signatures
Fix the thread function signatures to match k_thread_entry_t.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2023-11-24 09:27:10 +01:00
Jonas Remmert 108f7bde83 tests: build_all: sensor: fix i2c duplicate address
Fix address for hs300x driver in dts file for test.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
2023-11-24 09:26:58 +01:00
Aleksandr Khromykh 3d37549bac Bluetooth: Mesh: allocate mesh max required buffer number
Since sending of public key was moved into system
work (https://github.com/zephyrproject-rtos/zephyr/pull/62331)
it uses the same context as a Host Tx buffer
allocator for gatt sending. Host cannot wait for
free buffer anymore. Mesh requires 4 buffers
to send max size frame(public key) during
provisioning.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-11-24 09:26:37 +01:00
Wojciech Sipak 60dc8dd410 boards: Use unique names for boards in the YAML files
There are duplicated names specified in per-board YAML files.
This change will allow distinguishing boards in software that
presents the pretty names and not the raw names of boards.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-11-24 09:26:28 +01:00
Wojciech Slenska b39816a111 drivers: i2c: stm32: fix compilation for PM_DEVICE_RUNTIME
Added clk variable which is needed when CONFIG_PM_DEVICE_RUNTIME
is enabled.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
2023-11-24 09:25:43 +01:00
Yong Cong Sin d1fc5fe2ae boards: riscv: hifive_unmatched: add Renode simulation support
Add Renode simulation support for `hifive_unmatched`, the
script is basically copied over from `hifive_unleashed`, with
very minor edits.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-24 09:25:31 +01:00
Arnaud MAZIN 1378c90a93 driver: display: sdl: Introduce SDL_DISPLAY_ZOOM_PCT
This option modifies SDL window size and help with readability of very
small screens

Signed-off-by: Arnaud MAZIN <arnaud.mazin@gmail.com>
2023-11-24 09:25:22 +01:00
Jędrzej Ciupis 0bad09c7fa drivers: ieee802154: nrf5: support raw mode
When CONFIG_IEEE802154_RAW_MODE is set there is no network interface
that could provide pointer to the device the interface is running on top
of. The current implementation of nRF5 ieee802154 driver implicitly
assumes that such an interface is always present, which leads to crashes
when raw mode is enabled.

This commit adds support for IEEE802154_RAW_MODE in nRF5 ieee802154
driver by latching pointer to the ieee802154 device on initialization if
needed so that it doesn't have to be retrieved using the network
interface in run-time.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-11-24 09:25:11 +01:00
Martin Gritzan 86cf5829a4 dts: arm: stm32: add stm32f303xb bindings
The STM32F303xB is very similar to the xC, the only difference being the
RAM and flash sizes.

Signed-off-by: Martin Gritzan <martin.gritzan@gmail.com>
2023-11-24 09:24:14 +01:00
Marcio Ribeiro 05df6830b7 boards: dts: add missing code partition into ESP32 based boards
zephyr,code-partition added to ESP32 based board files

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2023-11-24 09:23:58 +01:00
Armando Visconti 88d91fb82f drivers/sensor: lsm6dsv16x: fix DT configuration read for int1/int2
Since lsm6dsv16x may be multi-instantiated, triggers must be enabled
and configured on DT basis and not only thru CONFIG_LSM6DSV16X_TRIGGER
macro; if either int1-gpios of int2-gpios (or both) are configured
in DT, the flag trig_enable is set to 'true' for that instance.
The previous implentation was lacking the check of those two Device
Tree properties, so trig_enabled was always true for all instances.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-11-24 09:23:47 +01:00
Yong Cong Sin e9fa6f8b4a drivers: intc: plic: add shell cmd to get irq stats for debugging
Introduced `CONFIG_PLIC_SHELL` to enable the build of shell
debugging command to get the hit count of each interrupt
controller's IRQ line. This is especially useful when working
with dynamically installed ISRs, which will be the case for
`plic_sw`.

Example usage:

```
uart:~$ plic stats get interrupt-controller@c000000
   IRQ        Hits
==================
    10         177

uart:~$ plic stats get interrupt-controller@c000000
   IRQ        Hits
==================
    10         236

uart:~$ plic stats clear interrupt-controller@c000000
Cleared stats of interrupt-controller@c000000.

uart:~$ plic stats get interrupt-controller@c000000
   IRQ        Hits
==================
    10          90

```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Maxim Adelman <imax@meta.com>
2023-11-24 09:23:33 +01:00
Yong Cong Sin 8342d87478 drivers: intc: plic: brackets for if-conds & use explicit comparison
if-conditionals should have brackets according to Zephyr's
coding standard, and explicitly compares `edge_irq` against 0.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-24 09:23:33 +01:00
Krzysztof Chruściński 465446e5aa logging: Add string validation to detect %p misuse
Logging shall not use character pointers with %p because in
certain configurations it may lead to memory faults. A compile
time detection is added. If faulty usage is detected then
message is replaced with error message which indicates which
message failed and what shall be done (casting to a pointer
of different type).

Validation is enabled only for configurations which remove
strings from binary as otherwise it may impact CI execution
time.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-24 09:23:18 +01:00
Krzysztof Chruściński aa2e315ab0 tests: unit: cbprintf: Add tests for string validation
Add tests for Z_CBPRINTF_NONE_CHAR_PTR_COUNT, Z_CBPRINTF_P_COUNT
and Z_CBPRINTF_POINTERS_VALIDATE.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-24 09:23:18 +01:00
Krzysztof Chruściński f9a547558a sys: cbprintf: Add macro for validating strings for packaging
When cbprintf package is created statically then only argument
types are taken into account and not the format string. It means that a
character pointer is always interpreted as %s and not %p. When %s is
found then string from rw location is copied into the package.
Copying unexpected data may lead to memory faults so it must
be avoided. User shall cast an argument to a pointer of a different
type.

Patch adds macros which can at compile time determine if %p is
used with char *. Result cannot be passed to static assert because
compiler sees it as non-constant (even though calculated at compile
time) but a runtime logging error message can be added instead of
original message.

Z_CBPRINTF_NONE_CHAR_PTR_COUNT counts number of none character
pointers in the arguments list.
Z_CBPRINTF_P_COUNT counts number of %p occurrences in the format
string. If results of both macros are equal it means that string
is ok.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-24 09:23:18 +01:00
Jamie McCrae 2a9f914db2 doc: mgmt: mcumgr: Add list of libraries/tools
Adds a list of tools and libraries that are available

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-24 09:22:44 +01:00
Benjamin Cabé cce77c8902 doc: latex: enable pdflscape package
Enable the pdflscape package (available in the Latex distros recommended
 for Zephyr) to allow for some pages to be rendered in landscape mode.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-24 09:22:44 +01:00
Jamie McCrae 5afaa38e67 drivers: led_strip: ws2812: Remove scratch selection for non-GPIO
The WS2812 LED strip driver does not use a scratch byte, therefore
free up a byte per pixel which was unused except in the GPIO-based
driver whereby it is used

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2023-11-24 09:22:24 +01:00
Anisetti Avinash Krishna e76ace4647 drivers: serial: ns16550: Condition added for dma_callback
Enable a condition as define dma_callback function only if
any one instance of ns16550 has dmas parameter in dts.
This resolves conflict of dma_callback function defined but
not used warning in case of UART_ASYNC_API enabled but dmas
parameter is not provided to any ns16550 UARTs dts instances.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-24 08:30:04 +01:00
Anisetti Avinash Krishna 69d62add98 drivers: serial: ns16550: Fixed few bugs causing CI failure
Removed if (IS_ENABLED()) and used #if as they are causing CI failures
and removed LPSS related functions which are not under LPSS config.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-23 17:21:20 +01:00
Henrik Brix Andersen 67ec329a70 tests: kernel: mem_protect: mem_map: fix wrong include
This test needs to include zephyr/kernel/mm/demand_paging.h, not
zephyr/kernel/mm.h, due to its use of k_mem_pin().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-23 15:17:44 +01:00
Juliane Schulze eeb6bf7dd9 input: make short-inputs optional
By making short inputs optional, the user can bypass short-events all
together if necessary (e.g. custom button-press listener).

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2023-11-23 09:51:57 +00:00
Andy Sinclair c3a54ae1c3 drivers: regulator: Fixed reference counting during enable
Reference counting was broken when adding the enable delay.
Now reverted to previous pattern.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-11-23 09:51:39 +00:00
Mulin Chao 64cce4866f MAINTAINERS: add Nuvoton collaborators for Nuvoton NPCX Platforms
Add Nuvoton guys, TomChang19 and alvsun, in collaborators of Nuvoton
NPCX Platforms and remove MulinChao and ChiHuaL since they are already
the maintainers.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-11-23 09:41:10 +00:00
Benjamin Cabé d4c1e8ef67 lorawan: include: add missing Doxygen comments
Added missing comments to various structs and enums in the lorawan.h
header.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-23 10:05:42 +01:00
Grzegorz Chwierut a1698b691d twister: pytest: Add --pytest-args to Twister command line
Extend Twister command line with --pytest-args. This parameter
is passed to pytest subprocess. It allows to select a specific
testcase from a test suite.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-11-23 10:03:11 +01:00