Usually the zephyr_get_* API returns values prefixed with tokens like
-I -system, -D. But sometimes we need the values without these
prefixes, so we introduce the optional SKIP_PREFIX argument.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This fixes a bug when calling net_pkt_append[_all] which uses
pkt->data_len as part of the maximum packet length calculation
when the net_context is set.
Without this change the maximum packet length is calculated as 0
(the value of pkt->data_len) and an ENOMEM error is returned.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Commit 753daa6 ("net: pkt: Compute TX payload data length")
removed the default packet setup on incoming packets when they
belong to the rx_pkt pool.
Let's restore this behavior, as MBEDTLS processing in net_app library
needs to use packet family to determine IP header length on
incoming packets.
NOTE: A future cleanup patch could set the IP header length based
on the context IP family. However, there are many places in the code
where this is being set, so care should be taken.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Add a comment that explains what the -P flag does. The explanatory
comment is useful when you want to find the flag so you can comment it
out while debugging the link stage.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This samples was failing to build with Ninja because Ninja detected
that libmylib.a was missing. Adding it as a BYPRODUCT in the
ExternalProject fixes the issue.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The linker script places kernelspace and userspace archives in
different sections. But the linker script itself does not determine
what archives are in what space, that is done by CMake.
CMake passes the list of kernelspace archives to the linker script
through defines, like this:
-DNUM_KERNEL_OBJECT_FILES=3
-DKERNEL_OBJECT_FILE_0=path/to/archive_a.a
-DKERNEL_OBJECT_FILE_1=path/to/archive_b.a
-DKERNEL_OBJECT_FILE_2=path/to/archive_c.a
These paths are relative, and since Ninja and Make invoke the linker
with different "working directories"[0], the relative paths need to be
different. This patch rectifies the relative path when using Ninja.
This fixes#5343
[0] https://gitlab.kitware.com/cmake/cmake/issues/17448
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
When building for Ninja we were accidentally using the wrong depfile
in the second pass. This commit moves the LINKER_SCRIPT_DEP logic into
the custom command function so that it can be linker-pass-aware and
set the depfile appropriately.
This should fix an issue where Ninja reported:
ninja: error: expected depfile 'zephyr/linker.cmd.dep' to mention
'zephyr/linker_pass2.cmd', got 'zephyr/linker.cmd'
But this has not been reproduced. It has however been confirmed that a
dependency issue with linker_pass2.cmd has been fixed because ninja no
longer regenerates linker_pass2.cmd on every build like this:
$ ninja
[1/79] Generating always_rebuild
Building for board qemu_x86
[2/3] Generating linker_pass2.cmd
[3/3] Linking C executable zephyr/zephyr.elf
Now:
$ ninja
[1/78] Generating always_rebuild
Building for board qemu_x86
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Construct the custom command for preprocessing the linker script with
a function to avoid copy-paste errors between linker passes.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The pre-commit hook was or'ing with true and therefore never
triggering when there were checkpatch errors.
Also;
Documented that the file needs to be made executable.
Made it more clear that the file is located in the zephyr git
directory.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
per the gcov man page:
You should compile your code without optimization if you plan to use
gcov because the optimization, by combining some lines of code into one
function, may not give you as much information .
Fixes#5548
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Build with coverage enabled for any other boards or applications is
useless at least right now. Make sure we only enable coverage for native
applications.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This adds commands to manage Friend node Subscription List.
Those will be used to add or remove and group/virtual address
from subscription list.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This command will be used to test if model can properly send
segmented and unsegmented messages to a given destination address.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
mbedTLS include directories will now default to be in the 'app'
include path when mbedTLS has been enabled.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Introduce Zephyr interface libraries to fix#5351.
From the documentation:
A Zephyr interface library is a thin wrapper over a CMake INTERFACE
library. The most important responsibility of this abstraction is to
ensure that when a user KConfig-enables a library then the header
files of this library will be accessible to the 'app' library.
This is done because when a user uses Kconfig to enable a library he
expects to be able to include it's header files and call it's
functions out-of-the box.
A Zephyr interface library should be used when there exists some
build information (include directories, defines, compiler flags,
etc.) that should be applied to a set of Zephyr libraries and 'app'
might be one of these libraries.
Zephyr libraries must explicitly call
zephyr_library_link_libraries(<interface_library>) to use this build
information. 'app' is treated as a special case for usability
reasons; a Kconfig option (CONFIG_APP_LINK_WITH_<interface_library>)
should exist for each interface_library and will determine if 'app'
links with the interface_library.
This API has a constructor like the zephyr_library API has, but it
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
ETH_MCUX_0 needs to be turned on when CONFIG_NET_L2_ETHERNET is enabled.
If CONFIG_NET_L2_ETHERNET is disabled (e.g. when configured for 6loble),
then ETH_MCUX_0 should remain disabled.
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
We have been passing around options from one function to the next making
it very difficult to add a new option easily and requiring changes to
man function prototypes.
This declated the parsed command line options global and renames args to
options. args is being used elsewhere and this was confusing.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This board doesn't support `make flash` way of programming.
So, remove that from documentation.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
I don't know why we have been passing "-serial none" to qemu but it
does not seem to be doing anything useful. So I propose we remove it.
According to the qemu documenation it should be disabling all serial
ports;
"-serial dev
Redirect the virtual serial port to host character device dev. The
default device is vc in graphical mode and stdio in non graphical
mode.
This option can be used several times to simulate up to 4 serial
ports.
Use -serial none to disable all serial ports."
But when we use "-serial none", we always combine it with "-serial
pipe", or "-serial unix", to redirect the serial port, so clearly it
is not disabling all serial ports as it attempting to do.
"-serial none" was first introduced to Zephyr in this commit:
0b54f984b8
As far I can tell, pinging an echo_server works fine without it, so I
suspect that our second -serial flag is overriding it and that it has
no effect.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This updates GAP, GATT, SM, L2CAP ICS values according to following
documents:
GAP.ICS.5.0.2
SM.ICS.5.0.0
GATT.ICS.5.0.1
L2CAP.ICS.5.0.1
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Do not reset net_context information in net_app_close. In case of
TCP behind the curtains connection might wait for some timers to
expire and send some messages (e.g. ACK). If we set source port to
'0', unexpected behaviour might happen with peer connection.
Only reset net_app context related information on net_app_close.
Let net_context_put will take care of proper connection closure.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Right now in FIN_WAIT1 state, if we receive FIN+ACK message, then
tcp state changed to FIN_WAIT2 on ACK flag and immediately on FIN
flag state changed to TIME_WAIT. Then final ACK is prepared and sent
(in queue at-least) to peer. Again immediately state changed to
TCP_CLOSED, where context is freed. net_context_put frees context
and releases tcp connection. Final ACK packet which is in queue
is dropped.
As a side effect of freed ACK packet, peer device keep on sending
FIN+ACK messages (that's why we see a lot of "TCP spurious
retransimission" messages in wireshark). As a result
of context free (respective connection handler also removed), we see
lot of packets dropped at connection input handler and replying with
ICMP error messages (destination unreachable).
To fix this issue, timewait timer support is required. When tcp
connection state changed to TIMEWAIT state, it should wait until
TIMEWAIT_TIMETOUT before changing state to TCP_CLOSED. It's
appropriate to close the tcp connection after timewait timer expiry.
Note: Right now timeout value is constant (250ms). But it should
be 2 * MSL (Maximum segment lifetime).
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
fin_timer will be started after sending FIN to peer. After successful
reception of FIN+ACK message in FIN_WAIT1 state, fin_timer should be
cancelled.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Using the '\$' technique to accept make variables corrupts Ninja build
systems, so avoid using it when generating Ninja files. Not using it
with Ninja means we need to come up with some other mechanism to
support build-time configuration of the QEMU CLI with Ninja.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Of these, only struct net_ipv6_nbr_data::send_ns is a descriptive
change:
send_ns is used for timing Neighbor Solicitations in general, not
just for DAD.
The rest are typo/grammar fixes.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Add implementation to consider differing Rx chain delays for
S2 and S8 Coded PHY PDU reception. These changes are
required to meet tIFS timings for transmission after a
reception on S8 coding.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>