These functions don't work with buffers that do have fragments, instead
this replaces their usage with net_buf_{put,get}.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
ATT_PENDING_SENT does severely impact the throughput since multiple
packets no longer can be scheduled at same time, so instead of always
setting it regardless of the bearer/channel it is now only used for
EATT since that cannot set its own callbacks.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
bt_l2cap_send_cb may fail if there are no context available which means
that the request would not be sent, also due to the use of custom
callback it cannot be queued either so the only option is to return the
error and let the application handle it.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Since the TX semaphore is used for all types of PDUs a request may have
to be put on the request list while there is no pending request pending
which means no response will be generated to trigger att_process,
previously this condition was handled by setting the request as
currently pending and append its buffer to tx_queue but this is no
longer efficient since there could be more than one channel active the
code should try all of them before queueing back to request list.
To fix this the request list will now be processed each time a PDU has
been sent.
Fixes#26070
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
ATT channel sent callback shall not be overwritting until the
operation completes as it can result in breaking flow control when
CONFIG_BT_ATT_ENFORCE_FLOW is enabled.
Fixes#25964Fixes#26071
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Allow to configure, how long before registration timeout should the
Registration Update be sent. The fixed 6 seconds used so far, might
not be enough in slower networks (like NB-IoT), resulting in frequent
re-registrations at LWM2M level.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Since this is an experimental API and MACRO_MAP() was deprecated in
favor of FOR_EACH() in zephyr v2.3.0, we are within our rights to just
remove it without notice now. Do so and mention it in the release
notes.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This file contains definitions for macros which are integral to
significant Zephyr use cases, such as CONTAINER_OF() and various
macros used by devicetree.h internally.
As such, in practice we expect at least advanced (if not intermediate)
users to understand it, so the fact that it's not formally documented
as an API with a stability level is a problem.
Fix that by giving the docstrings a once-over and adding new ones
where they are missing. Move all the remaining non-API macros to
util_internal.h.
Add a Sphinx API page for this header, and include it in the API
overview at "experimental" stability level.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Move the repetitive definitions used to add and subtract 1 at
preprocessor time into their own file. Make the behavior consistent,
so that you can invoke UTIL_INC(x) for any x you can invoke
UTIL_DEC(x) on.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Passing TX messages from sockets was reworked for openthread
thus tests need to be created/updated in order to pass.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
OpenThread API is not thread-safe.
Moved creation of otMessage to the Thread task and created api
for passing it properly.
This way it should be less possible for an issue to occure eg.
during message buffer allocation.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
If we get a page fault in early boot context, before
main thread is started, page faults were being
incorrectly reported as stack overflows.
z_x86_check_stack_bounds() needs to consider the
interrupt stack as the correct stack for this context.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Previously, DTS specification of physical RAM bounds did not
correspond to the actual bounds of system RAM as the first
megabyte was being skipped.
There were reasons for this - the first 1MB on PC-like systems
is a no-man's-land of reserved memory regions, but we need DTS
to accurately capture physical memory bounds.
Instead, we introduce a config option which can apply an offset
to the beginning of physical memory, and apply this to the "RAM"
region defined in the linker scripts.
This also fixes a problem where an extra megabyte was being
added to the size of system RAM.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
There were two spots where CONFIG_TIMEOUT_64BIT wasn't being correctly
honored, leading to the possibility of long timeouts overflowing
internally and doing weird stuff.
Fixes#26248
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
ppp does not populate the lladdr fields in the received packet.
To enable routing for packets received on the ppp interface, the check
of the link layer addresses in the packet must be skipped.
Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
Create macro for TCR_PS_BITS instead of programmatically looking up
a static value based on a CONFIG option. Moving to macro
removes logically dead code reported by Coverity static analysis tool.
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Bluetooth interacts with real-world hardware and thus requires the QEMU
target to follow wall time, and not have a free running timer that is
much faster than actual wall time.
Diable the QEMU icount mechanism when Bluetooth is enabled.
Fixes#26242
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
With latest SDK release v0.11.3 basic SMP support for HSDK
board was introduced in OpenOCD. Lets enable smp in openocd.cfg,
so using west we would be able to run Zephyr on all 4 cores.
Signed-off-by: Evgeniy Didin <didin@synopsys.com>
Disables the Debug-Access-Port of the microcontroller after flashing.
If not disabled, the DAP consumes ~1.6mA until the debugger disables it
or a hard power cycle is applied.
The DAP is typically automatically disabled after flashing, but if other
instances of JLink software are running (not connected), it will not be.
The added command resets the value of the CTRL/STAT register of the DAP.
This clears the CSYSPWRUPREQ and CDBGPRWUPREQ bits, leaving the debug
hardware free to power off the appropriate hardware. In no way does it
hinder the ability to later connect to the device for debugging.
This resolves the jlink portion of #26139
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Implement stubs for ARM CMSIS intrinsics,
to be used locally for nrf52_bsim builds.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Fix k_sem_take called with a timeout value other than K_NO_WAIT from
isr.
This happens when tty_irq_input_hook calls tty_putchar with the `~`
character to give the user a clue that input was lost.
This resulted in the following assert in sem.c:
ASSERTION FAIL @ WEST_TOPDIR/zephyr/kernel/sem.c:140
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Disable the controller advertising extension feature default setting
until the feature is complete. The zephyr host requires the
LE Advertising Set Terminated event to function.
Without this event a peripheral connection cannot pair because the
local on-air address is not set, and the advertising state will not be
cleaned up, so advertising cannot be started again.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
The frnd->last buffer can potentially be NULL if friend_clear is called
after the adv.c buf->busy check, but before the adv_start callback.
The current design is based on the adv.c thread being cooperative, and
therefore not yielding between the busy check and the adv_start
callback, but as the bt_le_adv_start call has to acquire a semaphore,
there's a possibility for friend_clear being called inbetween.
Fixes#26177.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Added automatic strdup for RAM %s parameters. Postponed format
processing to idle time. Automatic parameters counting during
compilation. Very fast execution for up to three parameters.
Signed-off-by: Tomasz Konieczny <tomasz.konieczny@nordicsemi.no>
Introduced interface for efficient logging from external logsystems:
Added handling of vaargs and automatic strdup to macros intended
to be used in logging interface function. Fast path to less then 4
arguments to speed up the execution. Made log_count_args external,
if external logsystem cannot count arguments.
Signed-off-by: Tomasz Konieczny <tomasz.konieczny@nordicsemi.no>
A hardcoded path lenth of 80 will not be able to suppor the full length
of 255 when LFN is enabled. This does produce a compiler error,
thankfully, this is only applicable to the test cases.
Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
Try to define MAX_FILE_NAME to the appropriate max length based on the
selected filesystm. Otherwise fallback to a standard filename of 12
(made up of 8.3 : <filename>.<extension>)
Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
The version as shipped in Newlib itself is coded a bit sloppily for an
embedded environment. We thus want to override it (and make it weak, to
allow user apps to override it in turn, if needed). The desired
properties of the implementation are:
1. It should call _write() (Newlib implementation calls write()).
2. It should be minimal (Newlib implementation allocates message
on the stack, i.e. misses "static const").
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Add warning about enabling the options below so that users are
aware that this is a security risk.
- CONFIG_BT_DEBUG_SMP
- CONFIG_BT_DEBUG_KEYS
- CONFIG_BT_OOB_DATA_FIXED
- CONFIG_BT_USE_DEBUG_KEYS
- CONFIG_BT_STORE_DEBUG_KEYS
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Provide a very simple model of the DSB ARM
instruction as no-operation. The implementation
is provided in a cmsis.h header file added
in the nrf52_bsim board directory.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Add a DSB before doing WFE in get_entropy_isr, to ensure
the memory transactions are complete.
Add a note clarifying a dependency for the existing solution
(dependency is satisfied by ARCH code but is good to state
clearly).
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
We need to clear the NVIC Pending bit for the RNG IRQ before
doing any WFEs and expect to wake up by RNG events. This is
because the event register will be set only if NVIC status
is changed from 0 to 1.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Since CONFIG_NET_BUF_USER_DATA_SIZE was not defined when
CONFIG_NET_BUF=n, compilation would fail on struct net_buf.user_data.
Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
The sample does not provide a way to verify its operation
and causes fails on nrf platforms. Added regex checks in sample.yaml
so the sample can be verified.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Appropriate WS can be loaded automatically if
the display controller has integrated temperature
sensor or an external sensor is connected.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Callback used mqtt_publish_qos1_ack but mqtt_subscribe called with
default 0 value (MQTT_QOS_0_AT_MOST_ONCE)
Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
After reviewing that test I found output looks too messy.
1. Remove words starting from capital letter in the middle of the
sentence.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>