Commit Graph

89201 Commits

Author SHA1 Message Date
Ian Morris 74468ebc09 dts: arm: renesas: ra: fix incorrect node name for sci devices
The sci devices described in the device tree source for RA MCUs are
incorrectly specified as being UARTs when they should be SCIs (serial
communication interfaces) which can not only operate as UARTs but also
as I2C, SPI etc.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-01-04 21:51:35 +00:00
Christopher Friedt 80e3f4aee6 tests: posix: common: rwlock: remove overspecified pthread_attr_t
Much of tests/posix/common still overspecifies pthread_attr_t
options.

Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.

This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 15:13:47 -05:00
Christopher Friedt e14f362547 tests: posix: common: sem: remove overspecified pthread_attr_t
Much of tests/posix/common still overspecifies pthread_attr_t
options.

Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.

This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 15:13:47 -05:00
Christopher Friedt 90021b81d5 tests: posix: common: pthread: do not overspecify pthread_attr_t
Much of tests/posix/common still overspecifies pthread_attr_t
options.

Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.

This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.

This is only a partial cleanup for pthread.c

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 15:13:47 -05:00
Christopher Friedt d9cffcfc36 tests: posix: common: mutex: remove overspecified pthread_attr_t
Much of tests/posix/common still overspecifies pthread_attr_t
options.

Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.

This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 15:13:47 -05:00
Christopher Friedt bfb4a5141c tests: posix: common: mqueue: remove overspecified pthread_attr_t
Much of tests/posix/common still overspecifies pthread_attr_t
options.

Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.

This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 15:13:47 -05:00
Christopher Friedt aefbbe2788 tests: posix: common: key: remove overspecified pthread_attr_t
Much of tests/posix/common still overspecifies pthread_attr_t
options.

Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.

This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 15:13:47 -05:00
Fabio Baltieri 2a99432695 input: kbd_matrix: fail gracefully if changing an undefined key mask
Add a check to input_kbd_matrix_actual_key_mask_set() to return an error
if trying to change a key mask but the device does not define a keymask
in the first place.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-04 18:40:10 +00:00
George Beckstein 603c3af895 drivers: flash : stm32: STM32L4P5xx fix page calculation from offset
This fix adds the STM32L4P5xx to the list of devices that have an
offset-to-page shift calculation of 12 bits. Previously, the driver
would only shift the offset by 11 bits when calculating the page to
erase.

This would prevent the driver from erasing the correct page.

Signed-off-by: George Beckstein <george.beckstein@ampaworks.com>
2024-01-04 15:33:42 +01:00
Petr Hlineny 0ed8f10d8a drivers: rtc: stm32: Updated scope of hsem
This commit updates the scope of  hsem.

Signed-off-by: Petr Hlineny <development@hlineny.cz>
2024-01-04 15:32:47 +01:00
Petr Hlineny 784a5b82e7 drivers: rtc: stm32: Replaces Enter init mode function with LL function
Use LL_RTC_EnterInitMode and LL_RTC_DisableInitMode instead
of rtc_stm32_enter_initialization_mode and
rtc_stm32_leave_initialization_mode.

Signed-off-by: Petr Hlineny <development@hlineny.cz>
2024-01-04 15:32:47 +01:00
Petr Hlineny 4a4543569e drivers: rtc: stm32: Fixes RTC issues related to device runtime pm
When device runtime pm is enabled, Backup Domain protection is active
most of the time. RTC driver need this protection to be disabled in
order to set the time or calibration. This fix disable the protection in
set time and set calibration functions.

Fixes: 62843
Signed-off-by: Petr Hlineny <development@hlineny.cz>
2024-01-04 15:32:47 +01:00
Henrik Brix Andersen 21e37498e3 Bluetooth: Audio: fix doxygen warnings
Fix doxygen warnings ("warning: found </em> tag without matching <em>")
from building the Bluetooth Audio API documention.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-04 13:55:12 +01:00
Bartosz Bilas cafe9a5632 drivers: regulator: max20335: fix unused-const-variable warnings
There can be a case where not all regulators are being used,
resulting in an unused-const-variable warning,
so let's add a __maybe_unused keyword to suppress it.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2024-01-04 13:52:02 +01:00
Emil Lindqvist ed6da68f5b i2s: stm32h7: add i2s support for stm32h7 mcu family
This commit modifies the I2S driver to work for STM32H7
family of MCU's. Currently only TX is working.

Tested on nucleo_stm32h743zi. Requires dma1 & dmamux1 to be enabled.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2024-01-04 13:48:28 +01:00
Aaron Ye c3e8b731ef soc: arm: ambiq: Remove the redundant configurations.
These non-cached SRAM size and base address configurations
are not needed now.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-01-04 11:06:37 +00:00
Jamie McCrae d142958fb6 doc: release: 3.6: Add retained memory changes
Adds a note about a new backend and API status upgrade

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-01-04 09:42:57 +01:00
Jamie McCrae dd48c2c240 doc: api: Change retained memory status to unstable
Changes the API support level of retained memory from experimental
to unstable, now that there are 3 drivers

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-01-04 09:42:57 +01:00
Ali Hozhabri ccc97125f8 drivers: bluetooth: hci: Fix uninitialized array index, issue #66806
Fix issue #66806, caused by PR #65172.

Return -EINVAL from bt_spi_get_header if op is neither SPI_READ nor
SPI_WRITE.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-01-04 09:42:50 +01:00
Hake Huang 3d783166f8 dts: fix frdm_kw41z ram size issue
frdm_kw41z ram size is 96k not 128k(starting from 0x20000000)

fixing: #66154

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-01-04 09:42:39 +01:00
Gaetan Perrot 68581caa74 kernel: need_swap zephyrproject-rtos#66299
Enhancement on void z_reschedule_irqlock(uint32_t key)
to avoid useless context switch

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-01-04 09:42:12 +01:00
Tomas Galbicka 89bd024a1c drivers: mbox: Add nxp mbox multi-channel support
Current implementation of NXP mbox driver mbox_nxp_imx_mu
is using only one channel 0.
This commit adds support for multiple mbox channels as is
indented by mbox drivers.

Change done in .send api signaling mode leveraging provided
channel id to select correct General Purpose Interrupt.
Another change done in IRQHandler to check and handle all
channels.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2024-01-04 09:42:04 +01:00
Rodrigo Peixoto 690460a06a doc: zbus: add priority boost documentation
Add priority boost documentation. Replace the ISR limitation since it is
not valid anymore.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-01-04 09:41:54 +01:00
Rodrigo Peixoto 01981910ec samples: zbus: add priority boost sample to zbus
This sample illustrates how to properly use zbus priority boost feature.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-01-04 09:41:54 +01:00
Rodrigo Peixoto 2cfd28e5ca tests: zbus: add HLP priority boost tests
Add the dedicated tests for HLP priority boost.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-01-04 09:41:54 +01:00
Rodrigo Peixoto fb7515e27b samples: zbus: fix samples to work with priority boost
Adjust the sample to work with the priority boost. It illustrates zbus
being used inside an ISR instead of into the main function.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-01-04 09:41:54 +01:00
Rodrigo Peixoto 73f0bcc7fc tests: zbus: fix unit tests to work with priority boost
The test considers using zbus inside ISR.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-01-04 09:41:54 +01:00
Rodrigo Peixoto c992707251 zbus: add priority boost feature
Replace mutexes with semaphores to protect the channels in conjunction with
a priority boost algorithm based on the observers' priority.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-01-04 09:41:54 +01:00
Sebastian Bøe c25ac487af tests: crypto: rand32: Check return code of sys_csrand_get
Check the return code of sys_csrand_get when testing the function.

Ignoring it is bad practice and can also be a security issue if users
copy-paste this test code.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2024-01-03 23:57:13 -06:00
Christopher Friedt 67a74e4350 tests: posix: test_realtime: improve test reliability
Previously posix_apis.test_realtime was failing (very)
frequently in CI, and in particular, when running on Qemu,
POSIX, or SMP targets.

We are using CLOCK_REALTIME for this test, which incurs an
additional syscall overhead above CLOCK_MONOTONIC. The act
of sleeping itself also incurs a syscall overhead.

The latency from one iteration to the next of the internal
loop is a bit of a random process due to scheduler or clock
noise (although the noise itself is still bounded).

In order to make this test robust against such noise, assert
only on the average time from one iteration to the next,
rather than the instantaneous time.

Rather than calculating a sample mean, use a running average
(aka Cumulative Moving Average) to save some bytes.

Report results, including low and high watermarks before
asserting that the average iteration time within expected
range.

==============================================================
START - test_realtime
I: n: 20, sleep: 100, margin: 10, lo: 110, avg: 110, hi: 110
 PASS - test_realtime in 2.198 seconds
==============================================================

Expect to see the low and high watermarks change more on
Qemu and POSIX platforms when running several jobs in parallel
with twister (such as in CI).

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 08:27:29 +09:00
Christopher Friedt 95a22b1217 posix: clock: clock_gettime() should not be a syscall
We try to implement Zephyr's POSIX API as regular library
functions, so remove the __syscall annotation from
clock_gettime() and implement the syscall portion of it under
the hood.

This also adds a bit of a micro-optimization in that
we can do a lot of processing outside of the system call.

In fact, processing CLOCK_MONOTONIC likely does not
require any syscall other than k_uptime_ticks().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 08:27:29 +09:00
Christopher Friedt e0383a6f9d posix: clock: check for invalid ns in clock_settime()
The clock_settime() function should not accept an input timespec
with nanosecond values < 0 or >= NSEC_PER_SEC.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 08:27:29 +09:00
Christopher Friedt 1695b5a0b2 tests: unit: util: add array for-each tests
Add tests for the following two macros

* ARRAY_FOR_EACH(array, idx_var)
* ARRAY_FOR_EACH_PTR(array, ptr_var)

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 08:27:29 +09:00
Christopher Friedt 42335036b7 include: util: add array for-each macros
AFAIK, we do not have array for-each loops. Seemed like an
obvious gap to fill, so introduce two variants:

* ARRAY_FOR_EACH(array, idx_var)
* ARRAY_FOR_EACH_PTR(array, ptr_var)

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-04 08:27:29 +09:00
Maciej Baczmanski 11613e08e7 net: openthread: increase TCAT stack size
Running TCAT with PSA crypto API  causes stack overflow.
Increased stack size.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-01-03 19:01:05 +00:00
Torsten Rasmussen 9981e69b91 cmake: update description of board_runner_args() function
Update description of board_runner_args() function so that it is
described that app_set_runner_args macro must be defined before the call
to `find_package(Zephyr)`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-01-03 19:00:49 +00:00
Jukka Rissanen fa0e04e2ed tests: net: dhcpv6: Adjust the source address of test pkt
We would drop the received packet if the source address is our
address so tweak the test and make source address different.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-03 19:00:33 +00:00
Jukka Rissanen 155e2149f2 tests: net: ipv6: Adjust the source address of test pkt
We would drop the received packet if the source address is our
address so tweak the test and make source address different.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-03 19:00:33 +00:00
Jukka Rissanen 8d3d48e057 net: ipv6: Check that received src address is not mine
Drop received packet if the source address is the same as
the device address.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-03 19:00:33 +00:00
Robert Lubos 48601fde96 tests: net: socket: tls: Make sure sockets are closed on test failure
Add after() function for the test suite, which does cleanup on still
open sockets. Otherwise, an individual test case failure affects all
other test cases, blurring the test suite results.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-03 19:00:15 +00:00
Robert Lubos f70715eeb3 tests: net: socket: tls: Add more tests covering poll()
Add new test cases, covering TLS/DTLS socket poll() functionality.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-03 19:00:15 +00:00
Robert Lubos 898aa9ed9a net: sockets: tls: Align DTLS connect() behavior with regular TLS
DTLS socket is not really connection-less as UDP, as it required the
DTLS handshake to take place before the socket is usable. Therefore,
align the DTLS connect() behavior with regular TLS.
The change is backward compatible. connect() call is still optional for
DTLS socket (the handshake can still take place from send()/recv()) and
a socket option was provided to disable DTLS handshake on connect().

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-03 19:00:15 +00:00
Robert Lubos c0d5d2fbd5 net: sockets: tls: Allow handshake during poll()
When using DTLS socket, the application may choose to monitor socket
with poll() before handshake has been complete. This could lead to
potential crash (as the TLS context may have been left uninitialized)
and unexpected POLLIN reports (while handshake was still not complete).
This commit fixes the above - POLLIN will only be reported once
handshake is complete and data is available

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-03 19:00:15 +00:00
Robert Lubos 0a1bee48bf net: sockets: tls: Improve POLLERR error reporting
In case a socket error was caused by TLS layer, it was not reported with
POLLERR. This commit fixes this.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-03 19:00:15 +00:00
Robert Lubos 5b3b462eed net: sockets: tls: Add flag indicating that session is closed
In case TLS session is closed at the TLS level (and thus recv() reports
0 to the application) a certain race occurs between consecutive recv()
call, and TCP session teardown. As mbedtls_ssl_read() only reports
session close upon receiving CLOSE alert, consecutive non-blocking
recv() calls would report EAGAIN instead of connection closed, if called
before underlying TCP connection was closed.

Fix this, by storing the information that TLS session has ended at TLS
socket level. The new flag will be checked before attempting further
mbed TLS actions, so that connection status is reported correctly.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-03 19:00:15 +00:00
Robert Lubos 1dc9028316 net: sockets: tls: Add function to obtain underlying ssl context
For test purposes only. Should not be used in regular applications.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-03 19:00:15 +00:00
Tomasz Lissowski 61cb7d4358 adsp: hda: accept 16 byte alignment for HDA buffer size
HDA DMA driver uses an excessive value of 128 bytes as required alignment
for DMA buffer size. This may result in the correct buffer size (e.g.
32-byte aligned, which is DT-compliant) being silently truncated before
writing it into DGBS register. This patch changes the requirement to the
value implied by DGBS register format (effectively reduces to 16 bytes).

Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com>
2024-01-03 18:59:55 +00:00
Ryan McClelland 4d9ad941d7 manifest: zscilib: update revision for double promotion fix
Update zscilib, this is needed for the double promotion fix

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-03 18:59:32 +00:00
Andy Sinclair b3fdb7477b drivers: regulator: fixed: Removed pin state setting from init
The setting of initial state in handled by the common driver,
which calls the enable function for any regulator that has
regulator-boot-on set, and is not already enabled.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2024-01-03 18:59:12 +00:00
Bjarki Arge Andreasen 48fa603da3 modem: cmux: Patch resync mechanism
The CMUX resync mechanism can get stuck between states
MODEM_CMUX_RECEIVE_STATE_RESYNC_0 and
MODEM_CMUX_RECEIVE_STATE_RESYNC_1 if the resync flags, which are
sent only once in state MODEM_CMUX_RECEIVE_STATE_SOF, are not
responded to, or the response is lost.

This patch ensures resync flags are sent from states
MODEM_CMUX_RECEIVE_STATE_SOF, MODEM_CMUX_RECEIVE_STATE_RESYNC_1
and MODEM_CMUX_RECEIVE_STATE_RESYNC_2 if its determined that the
resync flags are not being responded to.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-03 18:58:39 +00:00