Packets shall never fail to be sent now that they are queued, so if an
error occured there is no point in keep the channel connected.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This offloads the processing of tx_queue to a work so the callbacks
calling resume don't start sending packets directly which can cause
stack overflow.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Drop packets received while disconnecting since they would most likely
be flushed once peer respond there is no gain in keeping them on a
queue.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This prevents disconnect request packets to not being sent due to lack
of buffers normally caused by flooding or congestion.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If NET_L2_BT is enabled we need enough acl_in_pool needs to be big
enough to contain a full IP packet since that is no longer processed by
RX thread buffer would be queued to syswq to reassemble the SDU.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When NET_L2_BT the memory pressure for fragments can be quite high
since that would be transfering IP packets which are considerable big
so this makes our frag_pool to be of the same size as NET_BUF_TX_COUNT.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This enable chaning the function and line number making it easier to
debug where a buffer allocation is blocking.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When a segment could not be allocated it should be possible to resume
sending it later once previous segments complete, the only exception is
when there is no previous activity and we are unable to alocate even the
very first segment which should indicate to the caller that it would
block since that only happens on syswq the caller might need to defer to
another thread or resubmit the work.
Fixes#20640
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Now using only Path and PurePath in zephyr_modules.py to handle module
processing.
This make the code cleaner as well as remove an issue where a module
name would become an empty string when module path contained trailing
path separators.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Functions like `setup_ipv4` or `setup_ipv6` might already use the
`counter` semaphore, therefore it should be initialized before these
functions are called.
As a result of this issue, the network stack could stall until timeout
under certain circumstances (e.g. when OpenThread was used).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add command to print all existing connections. Useful for verifying that
connections are actually released when debugging.
More information can be retrieved with `bt info <addr>` using the
address printed by this command for each connection.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add command to print all existing bonds. Useful for verifying that bonds
are actually cleared when debugging.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix implementation for the missing reset of version
information procedure request state value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
An expired IPv6 router would cause an infinite loop where
iface_router_run_timer() repeatedly scheduled a work item. In some
conditions it would schedule with negative delay, in other conditions
the infinite loop wouldn't happen until a router was added again.
Get rid of the router from active_router_timers when it is removed.
Fixes#21339
Signed-off-by: Jonas Norling <jonas.norling@greeneggs.se>
Add initial Atmel at86rf2xx transceiver driver. This driver uses device
tree to configure the physical interface. The driver had capability to
use multiple transceiver and systems with multiple bands can be used.
With this, 2.4GHz ISM and Sub-Giga can be used simultaneous.
Below a valid DT example. This samples assume same SPI port with two
transceivers.
&spi0 {
status = "okay";
label = "SPI_RF2XX";
cs-gpios = <&porta 31 0 &porta 30 0>;
rf2xx@0 {
compatible = "atmel,rf2xx";
reg = <0x0>;
label = "RF2XX_0";
spi-max-frequency = <7800000>;
irq-gpios = <&portb 2 0>;
reset-gpios = <&porta 3 0>;
slptr-gpios = <&portb 3 0>;
status = "okay";
};
rf2xx@1 {
compatible = "atmel,rf2xx";
reg = <0x1>;
label = "RF2XX_1";
spi-max-frequency = <7800000>;
irq-gpios = <&portb 4 0>;
reset-gpios = <&porta 4 0>;
slptr-gpios = <&portb 4 0>;
status = "okay";
};
};
At the moment driver assume two transceiver are enouth for majority of
appications. Sub-Giga band will be enabled in future.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
In addition to not assuming all pointers fit in a u32_t,
logic is added to find the privilege mode stack on x86_64
and several error messages now contain more information.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This test has a problem, specifically in the scenario for
test_mem_domain_remove_partitions. A low priority thread (10)
is created which is expected to produce an exception. Then
the following happens:
- The thread indeed crashes and ends up in the custom fatal
error handler, on the stack used for exceptions
- The call to ztest_test_pass() is made
- ztest_test_pass() gives the test_end_signal semaphore
- We then context switch to the ztest main thread which is
higher priority, leaving the thread that crashed context
switched out *on the exception stack*
- More tests are run, and some of them also produce exceptions
- Eventually we do a sleep and the original crashed thread is
swapped in again
- Since several other exceptions have taken place on the
exception stack since then, resuming context results in
an unexpected error, causing the test to fail
Only seems to affect arches that have a dedicated stack for
exceptions, like x86_64. For now, increase the priority of
the child thread so it's cleaned up immediately. Longer-term,
this all needs to be re-thought in the test case to make this
less fragile.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The requests are somewhat larger on 64-bit since we
are allocating structs with pointer members. Increase
these to a larger multiple of the minimum block size.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
These are not C strings, just pointers to kernel objects.
Improves output when working with a debugger.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We need a format code for struct packing that fits in
a pointer value, "I" is fixed at 32-bit.
The conversion of string to pointer value now prints
8 bytes. This works for 32-bit since the leading
4 digits are always zero.
The replaced length check uses sizeof(void *) and not 4.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
64-bit systems generate some compiler warnings about
data type sizes, use uintptr_t where int/u32_t was being cast
to void *.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We need a size_t and not a u32_t for partition sizes,
for 64-bit compatibility.
Additionally, app_memdomain.h was also casting the base
address to a u32_t instead of a uintptr_t.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Configure as GPIOs pins that by default are not GPIOs
Enable pinmux for port F
Enable ADC, PWM drivers by default, but keep SPI disabled.
Swap I2C instances since I2C0 is multiplexed with UART2
Select VTR3 as 1.8V
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
The numbered list for installing toolchains on macOS and Windows is not
formatted correctly.
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Doxygen 1.8.15 or greater has a number of warnings of the form:
warning: argument 'net_idx' from the argument list of
bt_mesh_health_period_set has multiple @param documentation
sections
This is due to the use of @copydetails bt_mesh_health_period_get
which ends up copying all of the details from
bt_mesh_health_period_get which has some of the same @params as
bt_mesh_health_period_set. To make the generated docs look clean
the easiest is to remove the @copydetails and just copy the
comment.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Builds of docs with doxygen 1.8.16 has a number of warnings of the form:
'warning: unbalanced grouping commands'. Fix those warnings be either
balancing the group command or removing it.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Filter out warnings generated by newer sphinx versions by
'struct bt_mesh_model_pub' having bitfields for
doc/reference/bluetooth/mesh/access.rst
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Older versions of sphinx produced something like:
file_system/index.rst:58: WARNING: Duplicate declaration.
Newer versions produce:
file_system/index.rst:58: WARNING: Duplicate declaration, fs_statvfs
Change the regex to handle both conditions.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The unnamed unions inside json_obj_descr struct causes issues
with the initializer macros due to bug described here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676
The issue is that for GCC < 4.6, it cannot handle unnamed
fields in initializers. So apply the workarounds described
in the bug report.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
I ran into issue #1205 earlier today and realized the fix was to simply
provide the proper casts. The issue is that C++ is less permissive than
C here, erroring when trying to implicitly convert from `void *` to
`struct gpio_driver_api *`. The same cast is done in
include/drivers/gpio.h, which is why I did that here as well.
This fix was validated by compiling my C++ application successfully and
also successfully running my app on my board, interacting with sensors.
Signed-off-by: Brooks Prumo <brooks@prumo.org>
In order to make technical progress possible, some stable APIs
may sometimes need to be modified in a non backwards-compatible way.
Describe the process for integrating such changes in the documentation.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add the relevant sections for Stable API Changes so that the release
notes can be populated during development.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The example should work on the cc3220sf_launchxl by following the same
flow as on other boards, ie. by connecting with plain http by default
and use TLS only when an overlay is specified. We update the
configuration for cc3220_launchxl to not use TLS by default and the
README to point users to the right overlay file to use.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Severely memory constrained systems with known allocation patterns can
benefit from providing their own implementation of malloc with
specifically tuned bucket sizes. Provide a switch to allow users to
replace the default malloc implementation with their own.
Signed-off-by: Josh Gao <josh@jmgao.dev>
Assuming that fs_seek has been successful; in case when fs_write
would be unsuccessful and fs_close, that follows, would be successful,
the success code would have been returned for the entire procedure,
although it has failed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
It appears that ninja 1.6.0 or greater don't seem to send SIGTERM down
to the child processes and thus we don't terminate correctly. This
causes a hang with renode simulations.
Change terminate call to 'self.try_kill_process_by_pid()' when test
state is updated (i.e. done running with either passed or failed), in
order to explicitly send a SIGTERM to the simulator process before
sending a SIGTERM to ninja.
Refactor the terminate code so we encapsulate the behavior in one place
for a BinaryHandler.
Based on change from Stephanos Ioannidis <root@stephanos.io>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We do compiler flag compatibility tests to be able to support many
different toolchains and flags in a scalable way. But the test is not
perfect and in these situations we we will need to hardcode whether a
flag is compatible or not.
To support this we have zephyr_compiler_check first check if the flag
is covered by a hardcoded test before testing it.
Currently the only hardcoded compatibilty is that -Werror=implicit-int
is not supported for CXX.
This fixes#21229
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>