Commit graph

99144 commits

Author SHA1 Message Date
Sebastian Kwaśniak
7f6210af81 boards: riscv: neorv32: Add platform and model name
NEORV32 doesn't provide platform and model name in it's dts file.
This makes hard for some tools to determine with what board they're
working with. Fixed it by adding model and platform name in it's dts file.

Signed-off-by: Sebastian Kwaśniak <skwasniak@internships.antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2024-07-27 15:14:46 +03:00
Olivier Lesage
de147d1ce8 samples: bluetooth: minor logging changes in PAwR samples
Some minor logging improvements based on my user experience

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-07-27 15:14:37 +03:00
Olivier Lesage
94d86b9501 samples: bluetooth: fix periodic_sync_rsp sample connection
Was broken after BT_LE_ADV_OPT_USE_NAME and
BT_LE_ADV_OPT_FORCE_NAME_IN_AD were deprecated.

The periodic_adv_rsp sample
looks for the string "PAwR sync sample" and connects based on that.

So, the periodic_sync_rsp sample needs to advertise this string.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-07-27 15:14:37 +03:00
Flavio Ceolin
5822267c23 serial: uart_async_rx: Avoid possible division by zero
Ensures that config->but_cnt is not zero.

Fixes #66800
CID #338107

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-07-27 15:14:26 +03:00
Daniel Berlin
08e44f9dae bl5340_dvk: Move MIPI_DBI interface back to spi4
Commit 3dbbb73 accidentally changed the MIPI_DBI spi interface from
spi4 to spi2 for this board during conversion to use the MIPI_DBI wrapper.

This does not work, and this change reverts it back to spi4.

Tested on actual boards (bl5340, bl5340pa).
Before this change LVGL demo displays nothing, after this change it works
fine again.

Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
2024-07-27 15:14:15 +03:00
Manuel Argüelles
ec7289039b soc: s32k3: fix RAM retention
Initialize TCM and SRAM contents only after a destructive reset (e.g.
PoR reset). SRAM retains content during functional reset through a
hardware mechanism, therefore accesses do not cause content
corruption errors.

Fixes #75912

Signed-off-by: Manuel Argüelles <marguelles.dev@gmail.com>
2024-07-27 15:14:01 +03:00
Emanuele Di Santo
271ef88e05 drivers: mbox: nrf_bellboard: only clear events that raised the IRQ
The current implementation is such that if two or more events are
generated in quick succession, only one is handled. This would
have happened as follows.

At the beginning of the ISR, the contents of INTPEND are read.
Then, the ISR unconditionally clears all events that are set.

When two (or more) events are generated in rapid succession,
it may happen that by the time we enter the ISR, INTPEND is set
only for one event, but while we process the ISR, EVENTS_TRIGGERED
will be set for more than just that one event (more events are
generated).

By unconditionally clearing all events, we can potentially lose
all events that are generated during ISR processing.

This patch changes the ISR so that it only clears those events
that have a corresponding bit set in INTPEND at the time it is read.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2024-07-27 15:13:45 +03:00
Gerard Marull-Paretas
4ba5ad99cc drivers: i3c: fix/improve Doxygen
- Use references whenever possible instead of literals (e.g. `@c`)
- Remove incorrect usages of `@see`
- Fix incorrect usage of INTERNAL_HIDDEN blocks
- Detail Kconfig-dependent options with `@kconfig{}`
- Other minor enhancements

Ref. https://www.doxygen.nl/manual/autolink.html

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-27 15:13:27 +03:00
Gerard Marull-Paretas
003244e069 drivers: i3c: avoid duplicating BCR/LVR docs
Instead use Doxygen anchors to reference to a single source of truth.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-27 15:13:27 +03:00
Gerard Marull-Paretas
6f0b470bba drivers: i3c: use GENMASK/FIELD_GET if possible
This avoids the need to define a position shift macro, and makes code less
verbose.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-27 15:13:27 +03:00
Gerard Marull-Paretas
6ce0b0aab2 drivers: i3c: improve/fix include list
Include what is strictly needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-27 15:13:27 +03:00
Robert Lubos
bfe958a7f1 net: sockets: tls: Fix poll update event check
In case POLLIN is set, and no new application data has been detected,
the ztls_poll_update_ctx() should only return -EAGAIN if no other events
are available for the socket. Otherwise, the function may end up
busy-looping, in case for example POLLOUT is also monitored for the
socket.

Current check verifying that was wrong, as it caused to function to
return -EAGAIN even if some other events could've been reported for the
socket.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:13:17 +03:00
Vidar Lillebø
9b7c9ea720 dts: nordic: nrf54l15: Fix secure GPIOTE IRQn
Updates dts files to use the same GPIOTE interrupt lines as NRFX
for zephyr when TF-M is used.

Signed-off-by: Vidar Lillebø <vidar.lillebo@nordicsemi.no>
2024-07-27 15:13:00 +03:00
Fin Maaß
da090f1cb9 drivers: ethernet: phy: phy_mii: use no-reset option
the dts binding of the ethernet-phy has the option
"no-reset" and the according driver already has the
right logic to make use of it, but unfortunately
the connection between them was missing.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-07-27 15:12:49 +03:00
Emil Gydesen
f338bf6fae Bluetooth: Host: Discard advertising data if not explicit scanning
If the application is not explicitly scanning, then there is not
really any need to parse advertising reports nor send them to the
application.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-27 15:12:39 +03:00
Jimmy Zheng
421f81a243 arch: riscv: remove PMP stack guard for stack overflow handler
When RISCV_ALWAYS_SWITCH_THROUGH_ECALL is enabled, do_swap() enables PMP
checking in is_kernel_syscall.
If the PMP stack guard is triggered and do_swap() is called from the
fault handler, a PMP error occurs because the stack usage violates the
previous PMP setting.

Remove the stack guard setting during a stack overflow handler to allow
enabling PMP checking safely in fault handler.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2024-07-27 15:12:25 +03:00
Jimmy Zheng
58bda887ce arch: riscv: update PMP setting to privileged mode for fault handler
When RISCV_ALWAYS_SWITCH_THROUGH_ECALL is enabled, do_swap() enables PMP
checking in is_kernel_syscall.
If a user thread violates memory protection and do_swap() is called from
the fault handler, a PMP error occurs because the thread is in privileged
mode but still using the old user mode PMP setting.

Update the PMP setting to privileged mode for fault handler.
This also enables the stack guard for user thread's privileged stack in
fault handler.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2024-07-27 15:12:25 +03:00
Declan Snyder
9f56ff5d64 drivers: mdio: Clear interrupt signal in ISR
Apparently, disabling the intterupt is not enough,
because without clearing the flag, some errors are occurring.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-27 15:10:42 +03:00
Tom Burdick
5474b611cb icm42688: Fix divide by zero potential
There were code paths that could have lead to divide by zero given an
invalid scale setting for accel or gyro. In practice this should be an
invalid setup even before getting to these conversion functions. The
conversion functions now better show all valid values are accounted for
by using CODE_UNREACHABLE in the default case.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-07-27 15:10:27 +03:00
Vinayak Kariappa Chettimada
04e3d0081b Bluetooth: Controller: Fix Advertising PDU memory allocation
Fix Advertising PDU memory allocation for redundant Periodic
Advertising related PDU allocations. The buffer count
related to Periodic Advertising was included twice.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-07-27 15:09:39 +03:00
Maochen Wang
bf42164084 net: wifi: Fix the nm type check error
Fix the NM iface type check error, should use (1 << WIFI_TYPE_STA),
instead of WIFI_TYPE_STA. Same for WIFI_TYPE_SAP.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-07-27 15:09:20 +03:00
Anas Nashif
2a39132645 device: remove const qualifier from node label copy
k_usermode_string_copy does not accept const in its arguements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-07-27 15:09:10 +03:00
Anas Nashif
c5e6416a65 tests: device: test CONFIG_DEVICE_DT_METADATA=y
Looks like this option is not tested with userspace enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-07-27 15:09:10 +03:00
Rubin Gerritsen
2967bd847f Bluetooth: HCI: Expose bt_hci_conn_lookup_handle()
When implementing vendor specific HCI APIs and events,
we want to be able to convert between host objects,
handles and back again.

Exposing this API makes that possible

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-07-27 15:09:00 +03:00
Rubin Gerritsen
e28207d61b Bluetooth: HCI: Expose bt_hci_per_adv_sync_lookup_handle()
When implementing vendor specific HCI APIs and events,
we want to be able to convert between host objects,
handles and back again.

Exposing this API makes that possible.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-07-27 15:09:00 +03:00
Rubin Gerritsen
5b14748616 Bluetooth: HCI: Expose bt_hci_adv_lookup_handle()
When implementing vendor specific HCI APIs and events,
we want to be able to convert between host objects,
handles and back again.

Exposing this API makes that possible.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-07-27 15:09:00 +03:00
Robert Lubos
dd0a95ec15 tests: net: lib: http_server: core: Add test for RST_STREAM frame
Add test case verifying that stream is closed when RST_STREAM frame is
received.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
338e41a063 tests: net: lib: http_server: core: Add test for trailing header frame
Add test case covering a scenario when a client sends a trailing header
frame in a request.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
a99f70ce42 tests: net: lib: http_server: core: Add tests for continuation frame
Add test cases for continuation frame processing.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
71e0b9fac2 tests: net: lib: http_server: core: Add tests for header with priority
Add test cases verifying that request containing header frame with
priority flag set is processed properly.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
1da42b6626 tests: net: lib: http_server: core: Add tests for frames with padding
Add tests verifying that requests which include frames with padding are
processed correctly.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
d1ebddb110 tests: net: lib: http_server: core: Add tests for dynamic POST/GET
Add tests cases covering interaction with dynamic resources with
POST/GET requests.

Simplify HTTP2 request generation to facilitate adding more tests.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
938088641c tests: net: lib: http_server: core: Add test for connection close
Add test case verifying that the server keeps the connection open if no
Connection: close header is present in the request.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
a6d494b16f tests: net: lib: http_server: core: Clarify existing tests
Remove pointless helper functions, the test code can simply be included
in the test case w/o code duplication.

Clarify the naming of existing test cases. Backward compatibility simply
tests HTTP1. The upgrade test wasn't really testing HTTP upgrade, so
rename the test case too. Add a new test case actually verifying HTTP
upgrade.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
ff65815a3b tests: net: lib: http_server: core: Extend start/stop test
Ensure it's possible to restart the server w/o issues after a client
connected.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
5a23c2d602 tests: net: lib: http_server: core: Cleanup before adding more tests
Do some cleanup regarding naming used in the test suite to prepare it
for adding more test cases.

Extract common setup/teardown into respective before and after ztest
functions to simplify test code. Proper before and after functions also
ensure that individual test case failure does not disrupt other tests
operation.

Split the tests into two separate test suites, one for those which
require pre-setup and second for those which don't.

Finally, enable receive timeout on the client socket to ensure tests
won't stall in case of errors.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
1e2b2c79a5 tests: net: lib: http_server: Rename prototype test suite
"prototype" is ambiguous in this regard, as it doesn't really tell what
the test suite is testing. As tests in this test suite verify core HTTP
server functionality, rename it to "core".

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Gerard Marull-Paretas
a1de1d6cb3 modules: hal_nordic: nrf-regtool: enforce in-tree devicetree package
It looks like nrf-regtool depends on the
https://pypi.org/project/devicetree/ Python package, which contains an
old copy (https://github.com/zephyrproject-rtos/python-devicetree) of
the in-tree devicetree package.

Because no major changes have happened in the devicetree scripts, this
likely went unnoticed. However, realized today that such old package is
not able to parse bindings with multiple buses (e.g. in I3C, where we
have `bus: [i3c, i2c]`).

While a proper solution is discussed, inject `PYTHONPATH` with the
in-tree library.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-27 15:08:30 +03:00
Dmitrii Golovanov
c59412b1bf ztest: shell: Fix compilation error for NEWLIB_LIBC
Fix compilation error implicit declaration of function 'free'
in case of `CONFIG_NEWLIB_LIBC`.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-07-27 15:08:14 +03:00
Jordan Yates
56343079a4 samples: bt: ext_adv: don't terminate invalid conn
If the remote side has already terminated the connection (or the
connection failed to establish), don't attempt to terminate an invalid
connection object. Instead, start advertising again immediately.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-27 15:07:55 +03:00
Jordan Yates
a96b017e3e modules: mbedtls: rename MBEDTLS_PSA_CRYPTO_RND_SOURCE
Rename `MBEDTLS_PSA_CRYPTO_RND_SOURCE`->`MBEDTLS_PSA_CRYPTO_RNG_SOURCE`
as all other options use `RNG` for random number generator instead of
`RND` for random number.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-27 15:07:44 +03:00
Fin Maaß
27aa4bc988 drivers: ethernet: add get_phy function
add get_phy function to the ethernet drivers.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-07-27 15:07:26 +03:00
Fin Maaß
1f38d9dfef net: shell: iface: add infos from eth phy
add information about the ethernet
phy and the current link speed to the
net iface command.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-07-27 15:07:26 +03:00
Fin Maaß
2fb983a427 net: l2: ethernet: add way to access phy
add a way to access the ethernet phy
device via the ethernet device.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-07-27 15:07:26 +03:00
Manuel Argüelles
a8ebb05506 soc: nxp: s32k1: obtain system clock freq from dt
In S32K1 devices, Arm Systick clock frequency is equal to the
CPU core clock frequency, and its value can be obtained from
devicetree.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-07-27 15:07:00 +03:00
Johann Fischer
28b2051bda usb: device_next: add support for configuration string descriptor
Change USBD_CONFIGURATION_DEFINE macro to take the address of a string
descriptor node as an argument. This is a breaking change for macro
users, but quite convenient and easy to implement.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-07-27 15:06:09 +03:00
Johann Fischer
1540ba19d7 usb: device_next: remove unnecessary usbd_device_unlock()
Remove unnecessary usbd_device_unlock() in usbd_add_configuration().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-07-27 15:06:09 +03:00
Fin Maaß
ba5b4ae817 drivers: flash: spi_nor: doc: correct comment
the durations in the spi_nor_config struct
are in milliseconds not in microseconds.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-07-27 10:48:33 +03:00
Jamie McCrae
db5a5fa109 samples: tfm_integration: psa_crypto: Disable sample
Disables running this sample as doing so requires qcbor, which
is not apache licensed

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-07-27 10:48:23 +03:00
Emil Gydesen
34f4d2d496 Bluetooth: TBS: Add missing endian handling in TBS
TBS had 2 cases where 16-bit values were not properly
converted to LE before being sent over air.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-27 10:48:09 +03:00