In the timeout order test, the usage of k_poll() assumes that it
only returns after all events are ready. However, that is not
the case, as k_poll() returns when non-zero number of events are
ready. This means the check for all semaphore being ready after
k_poll() will not always pass. So instead of using k_poll(),
simply wait a bit for timers to fire, then check results.
Also add some bits to clean up at the end of test.
Fixes#34585
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Update OpenThread revision, to introduce fixes for the OpenThread
configuration cache variables behaviour, making them up-to-date
with the actual Kconfig configuration.
Fixes#34233
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Similar to commit c6ff61220e, use a
harness config to limit execution of the adafruit_2_8_tft_touch_v2
sample variant to boards that have this shield attached.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The PR fixes the pwm_led sample:
- now test doesn't rely on any specific device name
- Logs which are scanned with regex in the test are printed
only after a command passes (before failures were not
affecting the test verdict)
- If 1 sec cycle is not supported appropriate info is printed
and won't cause the test to failed
- Changed second "Turned off" msg so regex doesn't mix it with the
the first one.
Fixes#35524
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
some mwdt compiler options not support cmake function
check_c_compiler_flag, let's add mwdt compiler options for
hsdk boards without check.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
As per description of the sys_clock_elapsed() function, "the kernel
will call this with appropriate locking, the driver needs only provide
an instantaneous answer". Remove then the unnecessary locking from the
function, as it only adds an undesirable delay.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Correct the way the relative ticks value is calculated for an absolute
timeout. Previously, elapsed() was called twice and the returned value
was first subtracted from and then added to the ticks value. It could
happen that the HW counter value read by elapsed() changed between the
two calls to this function. This caused the test_timeout_abs test case
from the timer_api test suite to occasionally fail, e.g. on certain nRF
platforms.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The scheduler has historically had an API where an application can
inform the kernel that it will never create a thread that can be
preempted, and the kernel and architecture layer would use that as an
optimization hint to eliminate some code paths.
Those optimizations have dwindled to almost nothing at this point, and
they're now objectively a smaller impact than the special casing that
was required to handle the idle thread (which, obviously, must always
be preemptible).
Fix this by eliminating the idea of "cooperative only" and ensuring
that there will always be at least one preemptible priority with value
>=0. CONFIG_NUM_PREEMPT_PRIORITIES now specifies the number of
user-accessible priorities other than the idle thread.
The only remaining workaround is that some older architectures (and
also SPARC) use the CONFIG_PREEMPT_ENABLED=n state as a hint to skip
thread switching on interrupt exit. So detect exactly those platforms
and implement a minimal workaround in the idle loop (basically "just
call swap()") instead, with a big explanation.
Note that this also fixes a bug in one of the philosophers samples,
where it would ask for 6 cooperative priorities but then use values -7
through -2. It was assuming the kernel would magically create a
cooperative priority for its idle thread, which wasn't correct even
before.
Fixes#34584
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
As we don't use memory allocated in test_calloc, test_no_mem_malloc,
and test_no_mem_realloc. malloc call can be optimized away (that really
happens with ARC MWDT toolchain). That breaks the test. So disable
optimization for these functions.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
If we receive any data in FIN_WAIT_1, then ack it even if we
are discarding it.
Fixes#33986
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Jim Paris <jim@jim.sh>
The k_fifo_ prefix is meant for kernel API functions, and
not to our socket helper. So remove the k_ prefix in order
to avoid confusion.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we are waiting all the data i.e., the MSG_WAITALL flag is set,
then if we have not yet received all the data at the end of the
receive loop. We must use the condition variable to get the signal
when the data is ready to be received. Otherwise the receive loop
will not release the socket lock and receive_cb will not be able
to indicate that data is received.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fix a regression when application is waiting data but does
not notice that because socket layer is not woken up.
This could happen because application was waiting condition
variable but the signal to wake the condvar came before the
wait started. Normally if there is constant flow of incoming
data to the socket, the signal would be given later. But if
the peer is waiting that Zephyr replies, there might be a
timeout at peer.
The solution is to add locking in socket receive callback so
that we only signal the condition variable after we have made
sure that the condition variable is actually waiting the data.
Fixes#34964
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fix deadlock when db_hash_commit has to wait for the delayed work to
finish. This creates a deadlock if the delayed work for database hash
calculation needs to store the hash since the settings API is locked
when calling the commit callback.
Remove call to k_work_cancel_delayable_sync from db_hash_commit in order
to avoid the deadlock. Instead move comparing of the stored hash to the
delayed work and reschedule the work with no wait.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
If there are no sockets in the system, then do not drop the
packet immediately as there can be other L2 network handlers
like gPTP in the system. This will also allow ICMP messages
to pass to local handler.
Fixes#34865
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
There is a comment which needed to be rephrased for inclusive
language. This commit replaces it with the recommended
replacement.
Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
File userspace.c contains dead code in function char *otype_to_str()
Remove "return NULL" and replace with "ret = NULL".
Found as a coding guideline violation (MISRA R2.1) by static
coding scanning tool.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
Add missing introduction to queues which are basically FIFOs and in
zephyr are used to implement both FIFO and LIFO objects.
Fixes#35199
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Removes the requirements.txt from the training directory of the
magic wand sample as it is causing issues in CI. Updates README.md
to explicitly state the Python packages listed in requirements.txt.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Do not get the mainmenu title from SOF by splitting Kconfig the same way
we do it in Zephyr.
Fixes#35553
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When CONFIG_TFM_BL2 is enabled on the LPC55S69 there isn't
enough memory left for TF-M to perform a debug build. Exludes this
platform from this specific test case.
Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
USB audio class samples are generic and can be built for any
board that supports USB device and isochronous endpoints.
Add app.overlay that uses aliases and remove board specific overlays.
Note: USB audio is still experimental and even though the sample can
be built for specific platform, it does not mean that it can be run
on it without issues.
Fixes: #25313
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
USB devicetree nodes in Zephyr have different names,
mostly derived from the designations in data sheets.
We also have an USB audio sample which has a kind of
experimental approach to configure audio devices, that
are not real hardware, via devicetree.
Sample itself is generic and can be run on any board with
USB device controller and isochronous endpoints support.
Add usbd0 alias to specific USB node to allow generic
USB audio sample to be build on nRF and i.MX RT boards.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Replace suffix ull to ULL to increase code readability and prevent
unexpected behaviours, because the lowercase character l shall not be
used in a literal suffix
Found as a coding guideline violation (MISRA R7.3) by static
coding scanning tool.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
This needs to use 'main' for its default now.
Without this patch, GitHub redirects to main, but displays a banner
that says 'Branch not found, redirected to default branch' at the top.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Remove dead code enum tracing_log_id
Not used anywhere in the code. Also it caused MISRA rule 8.12
violation.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
This board uses an old bootloader version. The bootloader
always relocate code due to flash bootloader. This imply
a wrong behaviour when using --offset. This is fixed using
bossac legacy mode.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Add compatibility mode with old sam-ba flash bootloaders that don't have
offset capabilities. These bootloaders flash to a pre-defined flash
region. At end, bossac will suppress --offset parameter.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Coverity detected that a zero divisor can be passed to
ll_create_connection() without parameter sanitization. Conditionally
check the connection creation parameters according to spec.
Fixes#35343.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Treat warnings as errors. Since we already disable warnings for
undocumented members (the major source of warnings), reported warnings
are in all cases real problems that should be fixed.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
1. functions can only belong to one group, use arch-timing (already
defined)
2. group was not properly terminated
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
On sending write request we should check write response.
If data prepaired to be written by peer or offset are not equal
to the data and offset we sent, we shall send Execute Write
Request with Request Flag set to 0x00 (Cancel All Prepared Writes).
This was affecting GATT/CL/GAW/BI-32-C and GATT/CL/GAW/BI-37-C
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Fix the missing HCI event data len limit check when encoding
incomplete advertising data report.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Max data length has to be adjusted for subevent code, otherwise we'll
hit an assert when trying to add data to event due to insufficient
free space.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
After system reset (SETETHRST) interrupt enable register (EIE)
has the default value 0x8010 and global interrupt enable flag (INTIE)
is set. This is not desired and the INTIE flag should be set only at
the end of the initialization.
Disable INTIE flag and set desired interrupts sources in
a single write command just right after system reset.
Resolves: #35091
Reported-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The controller has several interrupt sources which are signaled
via a single INT pin. Only the interrupt sources that are explicitly
switched on during controller initialization may generate an interrupt
signal. Currently there are only PHY Link Status Change Interrupt
and RX Packet Pending Interrupt enabled. So there is no other reason why
an interrupt can be triggered.
Terminate interrupt handling thread on unknown interrupt
only when debugging, as there are concerns that stopping
thread in the field is going too far.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>