Commit graph

94605 commits

Author SHA1 Message Date
Jamie McCrae ff823c63ee doc: build: flashing: Add documentation
Adds documentation on the new flashing configuration system

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00
Jamie McCrae 4b2d19f147 soc: nordic: Add run once and deferred reset configuration
Adds configuration that allows nRF53 and nRF91-based boards to be
flashed through west using sysbuild for multiple images with the
recover or erase options and prevent running those commands for
each image being flash, which would make the device unbootable.
Also defers reset whilst all images for the cores of these SoCs
are flashed.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00
Jamie McCrae 8b62a16b57 soc: nordic: Reformat soc.yml file
Reformats the soc.yml file to have uniform 2-space indentation

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00
Jamie McCrae a0267d2f48 west: runners: Add run once commands and deferred reset
This adds supports for flashing images with sysbuild where there
are multiple images per board to prevent using the same command per
image flash which might cause issues if they are not ran just once
per flash per unique board name. A deferred reset feature is also
introduced that prevents a board (or multiple) from being reset if
multiple images are to be flashed until the final one has been
flashed which prevents issues with e.g. security bits being enabled
that then prevent flashing further images.

These options can be set at a board level (in board.yml) or a SoC
level (in soc.yml), if both are present then the board configuration
will be used instead of the SoC, and regex can be used for matching
of partial names which allows for matching specific SoCs or CPU cores
regardless of the board being used

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00
Sylvio Alves 568e777b84 twister: update overflow section name regex
esp32 platforms can overflow its dram0_0_seg and dram0_1_seg.
So update current dram section to meet both cases.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-04-29 17:41:15 +01:00
Alberto Escolar Piedras ec5d127f1f ci: coverage: typo fix in platform list
Fix quemu => qemu

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-29 17:40:56 +01:00
Øyvind Rønningstad 4be7a4de65 qemu_malta_qemu_malta_be.yaml: Fix 'identifier' typo
qemu_malta//be -> qemu_malta/qemu_malta/be

This caused the board not to work with Twister.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-04-29 17:40:47 +01:00
Pieter De Gendt 79b8285c6b doc: releases: 3.5: Fix COFNIG typo
Fixing a typo for a `Kconfig` option.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-04-29 17:40:39 +01:00
Peter Mitsis a3c7152f92 kernel: Update thread cpu in z_get_next_switch_handle()
Updates z_get_next_switch_handle() to set the new thread's base.cpu
value as it is done in do_swap(). This helps to ensure that the
last CPU on which the thread executed remains current.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-04-29 17:40:28 +01:00
Yong Cong Sin 4363a787b1 posix: uname: increase version name length
to 70 to prevent overflowing the char array.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-04-29 17:40:16 +01:00
Lukasz Mrugala 83db378dc5 scripts: twister: Remove Handler atavisms
Removed following fields from relevant Handlers,
as they were unused in code:

* Handler's state
* Handler's generator
* BinaryHandler's call_west_flash
* QEMUHandler's results
* QEMUWinHandler's results

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-04-29 17:40:06 +01:00
François Baldassari 3f78ca9873 ARC: fault: Fix uninitialized memory access
Found via static analysis. In fault path when checking for stack
overflows, if CONFIG_MULTITHREADING is not set, `guard_end` is left
uninitialized and is subsequently used in a comparison.

The solution is to simply return `false` in this configuration as stack
guards are not configured in the first place.

Signed-off-by: François Baldassari <francois@memfault.com>
2024-04-29 17:39:57 +01:00
Nicolas Lebedenco 6837ca808b cmake: Revert breaking change to CMAKE_SYSTEM_NAME
This commit reverts a breaking change in CMAKE_SYSTEM_NAME introduced by
"Zephyr" back to "Generic") and removes the file
`cmake/modules/Platform/Zephyr`.

Both changes in the aforementioned PR were only introduced to ultimately
modify the value of the global CMake property TARGET_SUPPORTS_SHARED_LIBS
for the special case of building for Xtensa with LLEXT.

The modification of CMAKE_SYSTEM_NAME is considered a breaking change
because it has the potential to alter the build of any non-trivial project
that previously checked for the "Generic" system identifier as
corresponding to Zephyr - for example by doing
`if (CMAKE_SYSTEM_NAME STREQUAL "Generic")`. Such builds may now break in
many ways including silently when there is no `else()` clause with a
`message()` to alert the user that a whole configuration block had been
skipped.

In essence, that CMAKE_SYSTEM_NAME modification was only introduced in
order to have CMake to load `cmake/modules/Platform/Zephyr.cmake` which in
turn adjusted the value of TARGET_SUPPORTS_SHARED_LIBS.

But the use of a CMake platform file like this is ineffective for
non-trivial projects where one or more top level CMake `project()` calls
may happen before the first call to `find_package(Zephyr)` because in such
cases CMAKE_MODULE_PATH will not have been modified yet to contain the
path to <Zephyr_ROOT>/cmake/modules and thus no platform file will be
include by CMake.

This patch moves the conditional override of TARGET_SUPPORTS_SHARED_LIBS
needed by some archs (e.g. Xtensa) into the `kernel.cmake` module which
is known to be the first call to `project()` that enables any language and
thus the one that must come before any artifact target can be defined.

Note commit 64e7d85 added a Kconfig to specify the object type of llext
being built, so it's not tied to the arch anymore but to the
CONFIG_LLEXT_TYPE_ELF_SHAREDLIB option.

Signed-off-by: Nicolas Lebedenco <nicolas@lebedenco.net>
2024-04-29 16:17:39 +02:00
Jamie McCrae 0408eee229 doc: release: 3.7: Add socs folder note
Adds release notes about the addition of a socs folder for
applications to store Kconfig fragments and devicetree overlays

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Jamie McCrae af467659de doc: build: Add details on SoC overlays
Adds details about Kconfig fragments and devicetree overlay files
that will be included in a build if they are found in the
``socs`` folder

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Jamie McCrae da3007e559 tests: cmake: overlays: Add soc_folder_overlay test
Adds a testcase for the new ``socs`` folder, with overlays

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Jamie McCrae 1ed6d89d13 tests: cmake: overlays: Add soc_folder_kconfig test
Adds a testcase for the new ``socs`` folder using Kconfig fragments

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Jamie McCrae 6ed5ac7111 cmake: modules: configuration_files: Add support for soc overlays
Adds support for SoC overlay files which go in a ``socs`` folder
in application folders and functions similar to the ``boards``
folder, but works for SoCs instead of boards

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Jamie McCrae 6f58159a72 cmake: Add support for socs folder and Kconfig fragments
Adds support for a new ``socs`` folder that can be placed in
application folders and functions similar to the ``boards``
folder, but works for SoCs instead of boards

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Jamie McCrae 43c323a835 cmake: modules: extensions: Fix documentation for zephyr_build_string
Fixes a missed entry and a wrong named variable in the
documentation for this function

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Patryk Duda 144a08c58c cmake: modules: Introduce FindThreads module
Some third-party modules uses 'find_package(Threads REQUIRED)' to check
if threads implementation is supported.

The original implementation tries to find threads library using various
methods (e.g. checking if pthread library is present or compiling
example program to check if the implementation is provided by libc), but
it's not able to detect pthread implementation provided by Zephyr.

Signed-off-by: Patryk Duda <patrykd@google.com>
2024-04-29 15:59:42 +02:00
Jamie McCrae acd14f8af2 scripts: module: Fix sysbuild module listing
Fixes an issue with zephyr modules not being listed in sysbuild if
they did not have a Kconfig file set

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 14:57:22 +01:00
Jonathon Penix 4d7fe771f1 linker: lld: riscv: Enable gp relaxation for lld
Unlike GNU ld, lld's gp relaxation is disabled by default and must be
explicitly enabled via `--relax-gp`. Pass this flag to enable gp relaxation
for lld when both linker relaxations and gp usage for RISC-V are enabled.

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-04-29 15:56:22 +02:00
Troels Nilsson 9b7d176b70 Bluetooth: Controller: Minor cleanup of struct proc_ctx
Remove unused collision field

Change type of done to uint8_t and move it to avoid padding bytes

Signed-off-by: Troels Nilsson <trnn@demant.com>
2024-04-29 15:55:13 +02:00
Andrej Butok c8f12c9273 doc: kconfig: fix HAS_CONFIGURABLE_FOO
Use HAS_CONFIGURABLE_FOO instead of wrong HAS_CONFIGURABLE.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-04-29 15:53:34 +02:00
Torsten Rasmussen de53c0d2db sysbuild: cmake: fix sysbuild_cache_set() function
The sysbuild_cache_set() supports setting variables in a dedicated
sysbuild image cache. When appending to a list, the list is checked for
existance of the variable to avoid appending it again on reruns.

This was done be checking with `string(FIND ...)`, but that will also
return an index on a partial match.

A much safer approach is to use the `if(<val> IN_LIST <list>)` approach
to check for existance.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-04-29 15:53:17 +02:00
Luis Ubieda 7fb75780df snippets: nus-console: Redirect Shell to nus-console
To allow easily building samples using the shell, without needing to
specify additional configurations. Tested with:
```
west build -b nrf52840dk/nrf52840 \
           -S nus-console` \
           samples/subsys/shell/shell_module
```

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-04-29 15:49:53 +02:00
Rafał Kuźnia 8ec1e0cdaf drivers: spi_dw: add HSSI register layout
The Synopsys Designware SPI peripheral exists in two versions with
slightly different register layouts. Added a Kconfig option that makes the
driver compatible with the HSSI register layout.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-04-29 15:44:22 +02:00
Chris Friedt 35429debb6 doc: posix: add visualization diagram for aep, si, pse51-pse53
Add a diagram that was first created for eoss 2024 to help
visualize the relation between the different application
environment profiles of IEEE 1003.13-2003.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 14:08:59 +02:00
Chris Friedt c0dc8d1426 doc: posix: aep: condense aep documentation
The POSIX Application Environment Profiles are additive and
offer incrementally more features over the System Interfaces.

For example, PSE51 includes all of the features of the Minimal
Realtime System Profile plus all of the System Interfaces.
PSE52 includes all of the features of the Realtime Controller
System Profile, plus the features of PSE51, plus the System
Interfaces, and so on.

It makes sense to take advantage of that and to condense the
AEP documenation.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 14:08:59 +02:00
Chris Friedt 37462aec6d doc: posix: option_groups: additional options and option groups
Define additional options and option groups for PSE51 to PSE53.

The options groups added in this commit are:

POSIX_SIGNAL_JUMP
POSIX_FILE_SYSTEM
POSIX_PIPE
POSIX_FILE_LOCKING

The options added in this commit are:

_POSIX_MEMLOCK
_POSIX_MEMLOCK_RANGE
_POSIX_MONOTONIC_CLOCK
_POSIX_SHARED_MEMORY_OBJECTS
_POSIX_THREAD_CPUTIME

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 14:08:59 +02:00
Chris Friedt 57ff7c9f7e doc: posix: conformance: reorder _POSIX_THREAD_CPUTIME
_POSIX_THREAD_CPUTIME was listed out of alphabetical order.

Move it to the correct location.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 14:08:59 +02:00
Chris Friedt ee2c2f6488 doc: posix: overview: add missing :ref: in subprofiles section
Previously, some links were not resolving properly since they
lacked the :ref: prefix, so it was added.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 14:08:59 +02:00
Arkadiusz Cholewinski a1cdf27610 CI: Fix coverage analysis
Add mps2/an385 and unit_testing to the simulator
criteria while parsing testsuites. Now the testsuit
will count as a simulator only where the platform
is quemu*, native*, unit_testing, mps2/an385.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2024-04-29 12:52:25 +02:00
Patryk Duda ef258166ba posix: Introduce getentropy() function
The function writes random data to the provided buffer. Maximum
permitted buffer size is 256 bytes. On success the function returns 0,
otherwise it returns -1 and sets errno to appropriate value.

Signed-off-by: Patryk Duda <patrykd@google.com>
2024-04-29 11:46:06 +01:00
Ajay Parida 1542140e4e net: wifi: Unicast frames statistics
Unicast RX stats
It represents total number of unicast (any type data, action or
any other unicast frames) frames received at firmware level.
The actual frames passed to host will be different as firmware
may drop packets or some packets may be dropped because of
errors.

Unicast TX stats
Transmission side the unicast packets count states the packets
handed over to firmware. The stats taken at firmware level.
Actual packets transmission may vary depending upon various factors.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-04-29 12:17:18 +03:00
Emil Gydesen 65e787be58 Bluetooth: BAP: Shell: Add USB out support for the BAP shell
Add USB out support for the BAP shell, so that decoded LC3
data can be sent to the host (e.g. a PC).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-29 11:04:09 +02:00
Emil Gydesen 55ea78f30b Bluetooth: VCP: Remove bad busy flag set for vol ctlr
The volume controller always set the busy flag in
bt_vcp_vol_ctlr_set_vol, where it should only set it
if the GATT operation succeeds.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-29 11:02:29 +02:00
Chen Xingyu 979cd1dfe8 drivers: display: st7789v: Add support to disable inversion mode
For historical reasons, inversion mode is enabled by default in the
current implementation. This commit introduces an `inversion-off`
boolean DTS property, allowing it to be disabled if necessary.

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2024-04-29 11:02:20 +02:00
Chris Friedt 28a69a8e80 doc: posix: mark asyncronous io as being supported
Mark the _POSIX_ASYNCHRONOUS_IO headers as supported, and note
the deviation that they return -1 and set errno to ENOTSUP.

At some later date, it might be possible to implement the
standard functions with other Zephyr API calls.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 11:02:11 +02:00
Chris Friedt 6e7be16118 tests: posix: add tests for functions and structs in aio.h
Add tests to ensure that the aio.h header exists, the
structures are declared, and that the functions are present.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 11:02:11 +02:00
Chris Friedt cdb1193f3e posix: add stubs for asynchronous io
Add stubs for POSIX asynchronous io that return -1 and set
errno to ENOTSUP.

The functions and structures in aio.h are required by the
_POSIX_ASYNCHRONOUS_IO Option as detailed in Section E.1 of
IEEE-1003.1-2017.

The _POSIX_ASYNCHRONOUS_IO interface is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise mandatory
for any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 11:02:11 +02:00
Théo Battrel 83f090a710 Bluetooth: Test: Update hci_prop_evt
Accept LE Read Max Advertising Data Length command during HCI
initialization.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-29 11:02:02 +02:00
Théo Battrel 8ba0ebab12 Bluetooth: Test: Add long AD test
Test that the Host give back the correct error when we try to set too
big advertising data. And ensure that long advertising data are
correctly transmitted.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-29 11:02:02 +02:00
Théo Battrel a0198fe420 Bluetooth: Host: Check max adv data len from ctrl
Send a `READ_MAX_ADV_DATA_LEN` command to the controller at the
initialization of the host to fetch the maximum advertising data length
the host can accept.

This is done because even if the Zephyr controller provide the
`CONFIG_BT_CTLR_ADV_DATA_LEN_MAX` Kconfig symbol, other controllers may
not have such Kconfig symbol. So this is a way for the host to be more
controller-agnostic and provide useful feedback to the users.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-29 11:02:02 +02:00
Johan Hedberg d590bcb5e0 Bluetooth: Remove BT_HCI_RESERVE and BT_HCI_RAW_RESERVE
In most cases these were defined as 1. Saving one byte for the rest
doesn't really justify the added complexity that comes with these
options. Removing them also simplifies the interface between HCI
transports/drivers and the host stack, which in turn helps pave the way
for having HCI as a proper Zephyr driver API.

Fixes #71907

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-04-29 11:01:27 +02:00
Wilfried Chauveau 2332bf0311 maintainers: add ithinuel as collaborator to TF-M and related modules
This adds ithinuel (myself) as collaborator to :
- tfm
- tfm-tests
- tfa
- PSA
- mbedtls

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-04-29 11:01:17 +02:00
Wilfried Chauveau d21f728511 maintainers: add ithinuel as maintainer for the ARM Platforms
The aim will be to maintain at least fvp_base* and mps* boards.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-04-29 11:00:34 +02:00
Aleksandr Khromykh dad7c31e7f Bluetooth: Mesh: use bt_rand instead of sys_rand
Commit adds using host\controller based random number
generator instead of zephyr driver.
No mesh dependency anymore on zephyr system
random driver.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2024-04-29 11:00:00 +02:00
Rubin Gerritsen 0a19c18f85 Bluetooth: Host: Document bt_le_scan_update()
This function is used in many places, but just by reading its
name it is not obvious why it is needed.
By adding some documentation it will hopefully become a bit more
clear that this function is mainly used for auto connection
establishment.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-04-29 10:59:28 +02:00