Do not enable hash algorithms except SHA-256 by default.
This unnecessarily inflates the final code size even if not all the
enabled hash algorithms are actually used.
SHA-256 is (for now) kept enabled by default because many configurations
across the code base assume that there is some hash algorithm
available without needing to enable it.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Adds test coverage for the case where the host starts the
scanner automatically upon sync creation.
This test covers there bug where we previously did not start
scanning on Coded PHY.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
We didn't have test coverage for the scenario where the host
starts scanning automatically.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
As documented in bt_le_scan_update(), the host may start scanning
automatically for various reasons.
Until now scanning was only done on 1M PHY, making it impossible
to use auto-connect/sync establishment if the advertiser was using
Coded PHY as its primary PHY.
Auto-connection would never work. Sync establishment would work if
the scanner was started by the application.
This commit fixes this by instructing the controller to scan on
both 1M and Coded PHY if the controller supports Coded PHY.
The application may see increased power consumption as a result
of this change as the controller may now spend 2*scan_window
listening for advertising packets.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
In rare cases, the I2C driver runs the N==2 logic
for I2C receives when N>2. This change breaks early
when handling the last 2 bytes for transactions with N>2
Signed-off-by: Mikhail Skobov <skobovm@meta.com>
The length parameter from `i2s_write` is not used correctly by
i2s_ll_stm32.c. E.g. `i2s_write(dev, block, 0)` would work.
Use the length from `i2s_write` in `dma_reload` to fix the issue.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
With the current code, when three separate monochrome LEDs are defined
in DT, only the information from the first LED is checked during driver
initialization. This patch fixes the code to verify the information of
each LED.
Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Close parentheses and braces in the reverse order they are opened.
Fixes commit f91d4731af ("pm: use braces for .pm_base inside anonymous
union initializer")
I have no idea how no compiler caught this!?
I tested very carefully with two different gcc versions and one clang
version and generated binaries are strictly identical before and after
this commit. Fix the code anyway because C macros are painful enough to
debug already, so no need to add more confusion.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fix condition in pin number check so that PA15, PB15, etc. can be properly
accessed..
Co-authored-by: Денис <baden.i.ua@gmail.com>
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Change the character used to indicate immediate operands from '$' to '#'
to resolve an "invalid instruction" error when building with clang.
For arm, binutils allows either '#' or '$' to indicate immediate operands.
clang seems to accept '$' for arm in other instances
(my build accepts 'subs r0, r0, $0x02', for example), but in this case it
produces an error that this is an invalid instruction due to the "$0x02"
operand.
Given clang's inconsistent behavior, I'm guessing this is a bug in clang
somewhere, but:
1. '#' for immediate operands seems to be more standard for arm in
general and seems to be what is used throughout the rest of Zephyr's
arm asm code.
2. Switching out '$' for '#' shouldn't negatively impact other
toolchains.
As such, switch out the character used to unblock clang builds until this
can be fixed in clang.
Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
Add an asterisk to make the comment for `k_poll_signal_reset()` appear
in documentation and move an @brief down by one line.
Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
The test uses DT_CHILD_NUM and DT_INST_CHILD_NUM to get the number of
child nodes of a given node from generated macro.
The test uses DT_CHILD_NUM_STATUS_OKAY and DT_INST_CHILD_NUM_STATUS_OKAY
to get the number of child nodes of a given node which children's status
are "okay" from generated macro.
Signed-off-by: Swift Tian <swift.tian@ambiq.com>
Add a generated macro for the number of child nodes of a given node.
Add a generated macro for the number of child nodes of a given node which
children's status are "okay".
Signed-off-by: Swift Tian <swift.tian@ambiq.com>
Checks the behavior of configuration of channels mask for LoRaWAN.
Are passed wrong masks sizes as argument, NULL pointer instead channels
mask buffer and the right case to validate the expected returns.
Signed-off-by: Jeferson Fernando <jeferson.santos@edge.ufal.br>
Add channels mask configuration for LoRaWAN, creating a request for
LoRaMAC. This change is needed because using LoRaWAN with ABP
activation without configuring channels mask will provide no acceptable
channels on data transmit, causing data loss.
Signed-off-by: Jeferson Fernando <jeferson.santos@edge.ufal.br>
The gnss_publish incorrectly uses a spinlock for mutual
exclusion when publishing data and satellites. Update it to
use a binary semaphore.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Use semaphore instead of spinlock for mutual exclusion. The
spinlock is improperly used for mutual exclusion, leading to
timeouts and other unintended behavior as ISRs are disabled.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The overlay for the mimxrt1062 boards gnss alias is pointing
to the uart node rather than the gnss node. Adjust gnss alias
and node naming.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
LOG which IRQn line is triggering on spurious IRQs as this makes it
much easier to debug spurious IRQs.
The new logs with this patch looks like:
<err> os: Unhandled IRQn: 227
<err> os: >>> ZEPHYR FATAL ERROR 1: Unhandled interrupt on CPU 0
<err> os: Current thread: 0x20032c20 (unknown)
<err> os: Halting system
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
hawkbit is rebooting automatically after installing a new update,
reflect that change in the docs.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Although not documented in the HX8394 datasheet, it seems that the
display fails to initialize if MIPI HS mode is used to send
configuration commands. Therefore, we must make sure all initialization
commands are sent with the MIPI_DSI_MSG_USE_LPM flag set.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
In 42c6f3311b (boards: stop using kscan for LVGL touch input), GT911
node label was renamed for rk055hdmipi4ma0 shield. The node label rename
was missed in the RT595 EVK overlay, fix this.
Fixes#69302
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Indicate macro and enum changes with respect to new inclusive
term in eSPI specification 1.5.
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
1) Replace master/slave in API for new terms in eSPI spec 1.5
2) Reflect eSPI VW change and macro changes across eSPI drivers
3) Update terms in eSPI driver sample and eSPI test driver
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
Adds a test to verify that a series of k_thread_abort() issued from
ISRs do not cause a deadlock.
Filtered on x86 as the x86_64 irq_offload() implementation isn't
SMP-safe. See #72172
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
The previous abort-lifecycle fix missed a case: other threads can
enter k_thread_join(), see that the thread is already dead, and then
need to call z_thread_switch_spin() to wait for a context switch. But
the new "dummification" code was (by design!) terminating the thread
such that no context would be saved to it. So switch_handle stayed
NULL and if you hit that timing case correctly[1] you'd deadlock
waiting for a switch that would never come.
Fix is just to set switch_handle when dummifying to any non-NULL
value.
Also add an assertion to catch the obvious case that a thread is
actually dead on the exit path of k_thread_abort() to make sure the
variant path continues to set flags correctly
[1] CI was doing it fairly reliably via tests/kernel/smp_abort on
qemu_cortex_a53 only. Only one of my dev systems could see it,
and then only about 15% of the time.
Signed-off-by: Andy Ross <andyross@google.com>
We've had threads spinning on the thread state bits, but weren't being
careful to ensure that those bits were the last things seen to change
in a halting thread. Move it to the end, and add a barrier for
correctness.
Signed-off-by: Andy Ross <andyross@google.com>
Nicolas Pitre points out that since these thread structs are just
dummies for the context swtiching, they can be presumed to be "write
only" and thus there's no point in having one per CPU, everyone can
share the same one.
The only gotcha is that we never really documented (nor really have a
place to document) that rule, so it's not theoretically impossible for
an architecture to read back what it might have written underneath
arch_switch(). Leave this in a separate commit for bisection
purposes, but the risk seems very low.
Signed-off-by: Andy Ross <andyross@google.com>
There's a easily-tripped-upon free memory write condition in the arch
layers where they will write to a cached _current pointer after that
thread has been aborted. Detect this by clobbering the thread data
after the return from k_thread_abort() and validating that it's still
clear after the ISR returns.
Note that the clobbering of the thread struct requires the removal of
a k_thread_join() that (obviously) requires that it see a DEAD flag
set. Joining aborted threads isn't actually legal, but does still
work as long as app code doesn't reuse the memory. Basically we can't
test both cases here, and we have join coverage elsewhere already.
Signed-off-by: Andy Ross <andyross@google.com>
After a k_thread_abort(), the resulting thread struct is documented as
unused/free memory that may be re-used (for example, to respawn a new
thread).
But in the special case of aborting the current thread from within an
ISR, that wasn't quite happening. The scheduler cleanup would
complete, but the architecture layer would still try to context switch
away from the aborted thread on exit, and that can include writes to
the now-reused thread struct! The specifics will depend on
architecture (some do a full context save on entry, most don't), but
in the case of USE_SWITCH=y it will at the very least write the
switch_handle field.
Fix this simply, with a per-cpu "switch dummy" thread struct for use
as a target for context switches like this. There is some non-trivial
memory cost to that; thread structs on many architectures are large.
Pleasingly, this also addresses a known deadlock on SMP: because the
"spin in ISR" step now happens as the very last stage of
k_thread_abort() handling, the existing scheduler lock works to
serialize calls such that it's impossible for a cycle of threads to
independently decide to spin on each other: at least one will see
itself as "already aborting" and break the cycle.
Fixes#64646
Signed-off-by: Andy Ross <andyross@google.com>