One of the tests closed the underlying TCP connection right after
establishing one. This caused a certain race between incoming TLS
handshake data and entering FIN1 state (experienced on nrF52840), where
the TLS handshake data could be received after the FIN1 state was
entered, causing the server side to send RST packet. This disrupted the
test flow, as graceful TCP connection teardown was expected.
Fix this, by adding a small delay for such case to avoid the race.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
* Convert png figures to svg
* Remove app.png and the paragraph which elaborated on it.
(It was very specific to some particular
user case, and having it did not improve understanding)
* Correct all references to "native_posix drivers" to
the be just "emulated drivers"
(they are not native_sim specific)
* Correct path for a file which was moved
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Limit the content of this page to only cover the bus
emulators and their peripherals.
Until now, there was some out of place references to
emulators of a completely different type which did
not match the descriptions in this page.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Created new emulators page, and moved the
current page to be a page dedicated to bus emulators.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>