Commit graph

87677 commits

Author SHA1 Message Date
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
Andrej Butok 84955951ef boards: lpcxpresso55Sxx: Make Jlink a default runner.
Make Jlink a default runner for lpcxpresso55Sxx.
The LinkServer runner command line tool does not support .hex flashing.
This feature is planned for LinkServer v1.6 (July 2024).

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-23 10:02:56 +01:00
Krzysztof Chruściński c143daf98d tests: logging: log_backend_uart: Disable backends other than UART
Test expects that there are no other backends enabled and some
may be enabled by default.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-23 10:02:45 +01:00
Francois Ramu f442c03a20 samples: subsys: nvs on nucleo_g431 requires 6kB for storage partitions
Add the overlay for running the samples/subsys/nvs/ application
on the nucleo_g31rb. Define a 6kB storage_partition at the end
of the 128kB flash.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-11-23 10:02:33 +01:00
Andrzej Głąbek c949018d36 tests: drivers: flash: Use fixtures for tests requiring external chips
Several scenarios in this test require specific external flash chips
to be connected to the nRF52840 DK. Specify proper fixture for them
so that they are not performed on the board without those required
external components connected.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-11-23 10:02:22 +01:00
Andrzej Głąbek 4a262c3947 tests: drivers: flash: Update nrf52840dk_mx25r_high_perf.overlay
This is a follow-up to commit 7a83724e0f.

This overlay uses an alternative connection (via spi2) for the external
flash present on the nRF52840 DK and it needs to use one of the QSPI
pins as GPIO, to get CS line control in the SPI communication. To make
it possible, that GPIO must be removed from those marked as reserved.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-11-23 10:02:22 +01:00
Bartosz Bilas e7c7c5a769 doc: zbus: add missing timeout arg for zbus_chan_add/rm_obs funcs
zbus_chan_add_obs and zbus_chan_rm_obs functions require
a timeout as their third arg.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2023-11-23 10:02:13 +01:00
Marcio Ribeiro 468890d70f drivers: clock_control: clock_control_esp32 assert remotion
No longer necessary assert removal

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2023-11-23 10:02:05 +01:00
Daniel Leung 40ba4015e3 kernel: mm: only include demand_paging.h if needed
This moves including of demand_paging.h out of kernel/mm.h,
so that users of demand paging APIs must include the header
explicitly. Since the main user is kernel itself, we can be
more discipline about header inclusion.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-23 10:01:45 +01:00
Daniel Leung 062fc2242a sys: arch_interface: include arch/syscall.h if USERSPACE
Due to arch_syscall_invoke are declared static, if there are
no corresponding definition, compiler will complain. It has
been working fine so far because arch/syscall.h is included
indirectly through some other headers (especially through
generated syscall stubs). However, with enough header files
shuffling this becomes an issue. So include arch/syscall.h
in arch_interface.h explicitly.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-23 10:01:45 +01:00
Flavio Ceolin b43271dc2d doc: vuln: Disclose information about CVE-2023-5055
Information about CVE-2023-5055

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-11-23 10:01:30 +01:00
Joakim Andersson 2ad6dda9fd tfm: Remove limitation of enabling FP when build TF-M NS application
Remove limitation of enabling FP when building TF-M NS application.
FP support have been fixed in the tf-m-tests repository for NS
application.
Board support for NS executable may still be lacking for some boards.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-11-23 10:01:22 +01:00
Joakim Andersson 1ab669e3d0 tfm: Remove SFN model FP limitation
Despite what the TF-M documentation says about SFN model not supporting
Floating Point, it does support it, according to TF-M developers.

Remove SFN limitation not supported with FP Hard ABI.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-11-23 10:01:22 +01:00