The log_backend_swo_init function sets the CYCCNTENA bit of the DWT
register to 0, disabling the counter (which is necessary for the timing
functions.
Avoid overwriting the CYCCNTENA bit.
Do not try to set read-only bits.
Fixes#34341
Signed-off-by: Andrés Manelli <am@toroid.io>
Fixes a typo where the BT_GAP_PER_ADV macros had MAX twice,
as well as adding a MIN timeout macro and check.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix ECC thread stack size which is to small to account for the worst
case scenario. When an interrupt happens at the point where the ECC
thread is at the highest stack size usage pushing the thread context
to service the ISR causes a stack overflow.
Increase the ECC thread stack size by atleast the size of the basic
stack frame of 32 bytes aligned on 8 byte for ARM architectures.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
By default ztest thread is running at the priority `-1`. This value is
invalid when the testcase is running in cooperative mode only. Set
default ztest thread priority to `-2` if this is the case. The fix is
modeled on the approach used to define the default
`MAIN_THREAD_PRIORITY`.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
So far we only have log_msg_timestamp_get() function, which returns
internal timestamp representation. This is either clock cycles or uptime
in ms, depending on main clock precision.
Introduce log_output_timestamp_to_us() helper function, which allows to
convert internal logging timestamp to us.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This aligns the error handling of send function to never unref the
buffer in place so the caller retain the ownership of the buffer
whenever there is an error.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds a new flag, BT_LE_ADV_OPT_FORCE_NAME_IN_AD, which can be used
to force the Bluetooth GAP device name to appear in the advertising
data rather than the scan response data of an advert with scan response
data.
Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
Just renaming the function parameter fix two violations, one is
caused because the parameter name is different from the declaration
the other violation is because the identifier was starting with
underscore.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The virtual_iface is already NULL checked by net_if_get_by_iface()
at the beginning of the function so no need to do it here too.
Coverity-CID: 220535
Fixes#34006
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Simplifying the loop in order to remove dead code (ctx_up is
always NULL after the slist loop.
Coverity-CID: 220538
Fixes#34003
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Move cmsis OS api headers under include/portability. Those are not
libraries and only serve to provide a level of abstraction using the
CMSIS OS APIs to existing Zephyr interfaces.
Removed one level and put them directly under include/portability.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move cmsis OS apis under subsystem/portability. Those are not libraries
and only serve to provide a level of abstraction using the CMSIS OS APIs
to existing Zephyr interfaces.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Wait for MAC operations to complete when transmitting. Unconfirmed
messages still open receive windows and can cause error conditions,
which are currently dropped.
It is also possible for a second send to be requested before the first
one has finished processing, which results in `LORAMAC_STATUS_BUSY`.
Empty frames (due to insufficient payload space) now also block until
the MAC layer is ready to accept new commands.
This change means the application no longer needs to guess-and-check
when it is possible to send unconfirmed messages.
Fixes#33456.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
If the telnet client operates in a character mode, it may send
individual characters in packets. Such packets were dropped in the
telnet shell backend instead of being process by the shell engine.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Added implementation of log_msg2 which is creating log messages
using cbprintf packaging and storing them in circular ring buffer
(mpsg_pbuf).
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Logging v2 is using _Generic keyword for detecting type of
log message arguments. Apparently, it does not support handling
of pointers to forward declared structures. Added casting to void *.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Logging v2 is using _Generic keyword for detecting type of
log message arguments. Apparently, it does not support handling
of pointers to forward declared structures. Added casting to void *.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Fix a missing encryption procedure state check which allowed
out of order receive of START_ENC_RSP PDU, which made the
controller to believe its already in an encryption procedure
in progress state.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Do not make the first object added to the object transfer server the
current (=selected object). This leads to the server having no
current object until one is selected by the client.
This solves a startup issue where the selected callback is not called
by the server if the first object selected by the client happens to be
the same object as the object that was first added to the server. In
that case, the user of the OTS does not know which object is selected,
and therefore may not be able to supply the correct data later.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Avoid using sizeof to access ULL and LLL struct members.
Based on the alignment requirements of structures, due to
padding between structure members, use of sizeof of previous
struct member to access next struct member is incorrect.
Continue to use explicitly stored parent pointer to access
ULL context. Combine event header and ULL header so that
the parent pointer point directly to the combined ULL
struct.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing initialization of reference count in
ull_hdr_init function.
This has not caused issues so far, but when the ref member
of the struct ull_hdr if placed in the beginning of a
context that is allocated using mem_acquire function then
first few bytes used would make the ref member to have
uninitialized value when such context is allocated by
mem_acquire. First few bytes are the next pointer and free
count stored by the mem module.
The issue was discovered in subsequent commits that
restructure the ULL context structures.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the auxiliary scan context release to be performed in
the disabled_cb callback after the ULL reference count is
decremented.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix conn_cleanup to be performed in the event done. The
regression was introduced in
commit 5412f61ac6 ("Bluetooth: controller: Introduce
separate done memq").
Now that done event is handled asynchronously outside the
handling of the terminate node rx type, it is necessary that
terminate node rx type is generated after the done event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Consolidate Kconfigs for ISO roles to make compilation guards more
concise. Just introduces aliases, does not change functionality.
Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
The previous implementation assumed that the dst pointer was always
aligned to a 4-byte boundary in platforms that require alignment for
storage of 32-bit integers. Since this is required for certain platforms
(eg. Arm Cortex-M0), use memcpy() instead, which always takes
alignment into account.
Fixes#33969.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Moves the beacon_enabled check in the beacon work handler to check the
beacon flag before sending anything, in case a cancel call fails.
Split out from #33782.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Ignore peer keypress notifications as a responder, allowing the pairing
procedure to continue instead of being aborted.
The Bluetooth LE specification does not specify a behavior, the
implementation has the choice of ignoring or aborting.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
The Transport layer implements some checks surrounding the
lpn_msg_received call, with an accompanying comment that explains the
logic. Move this inside the msg_received call instead.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Switch to the new delayed work API. Puts the scheduling for the next
poll in the response_received function instead of cancelling it, then
optionally scheduling it again later.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>