Commit graph

91 commits

Author SHA1 Message Date
Piotr Szkotak a6b0a3a263 net: openthread: make diag compile
Fix compilation error when the DIAG module is enabled.
All core functionalities are provided.

Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
2020-07-20 14:40:29 +03:00
Gerson Fernando Budke 7b4bdf3bc7 samples: net: echo_server: Enable atmel_rf2xx tests
Add atmel_rf2xx shield on test list.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke 3f5eb6f0e6 samples: net: echo_server: Update samr21_xpro configs
After Zephyr 2.3.0 release system uses more RAM.  This update
samr21_xpro configuration to allow echo_server run again and
remove unnecessary definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke d167205916 samples: net: echo_server: Rem unnecessary configs
The sam4e_xpro and sam_v71_xult configs are unnecessary.  Now
atmel_rf2xx shield will complement all necessary configuration.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Marek Porwisz 311dd73517 samples: openthread: remove redundant configuration options
Some of the settings are no longer needed in the sample as OpenThread
configuration manages it by itself.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-06-30 07:48:08 -04:00
Jukka Rissanen db9dca059e samples: net: echo-server: Add userspace support
Allow echo-server to start TCP/UDP threads in user mode for
testing purposes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-23 18:17:15 +03:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Marc Herbert 2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Robert Lubos fc7b142961 net: openthread: Use newlib in samples
OpenThread throws a warning when minimal libc is used, as some of its
new files use stdlib functions not available in the minimal
implementation. It's not critical failure, as those new functions are
not linked anyway in default configuration, but the warnings do not
look well. Therefore, use newlib by default in the sample to prevent
warnings.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-05-07 23:27:49 -05:00
Kumar Gala dbeb3ba32e drivers: spi: spi_sam: rework device tree support
Reworked spi_sam driver to utilize new DT_INST macros as part of
this rework we also now get pin ctrl/mux configuration information
from the device tree instead of via Kconfig and defines in soc_pinmap.h

We remove defines from dts_fixup.h and soc_pinmap.h and associated
Kconfig symbols that are no longer needed due to getting all that
information from devicetree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:29:54 -05:00
Anas Nashif b90fafd6a0 kernel: remove unused offload workqueue option
Those are used only in tests, so remove them from kernel Kconfig and set
them in the tests that use them directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 18:42:27 -04:00
Kumar Gala 35cad0884a dts: soc: atmel: sam: cleanup node labels to match SoC docs
Update dts files to use node labels that match Atmel SoC docs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-09 09:02:19 -05:00
Jukka Rissanen bfa3e80ca0 samples: net: echo_server: Fix compile issues from timeout overhaul
Feed proper time delay parameter to K_THREAD_DEFINE()

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Tomasz Bursztyka a497bfa455 samples/net: Enable power management statistics for frdm k64f
On echo server app only.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-04-02 11:07:45 +03:00
Andrzej Głąbek 386e5ba81c samples: echo_server: Fix missed renaming of nrf52840_pca10056
This is a follow-up to commit 4253eae005.

The board known earlier as nrf52840_pca10056 is now named
nrf52840dk_nrf52840.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-30 13:27:37 +02:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Tomasz Bursztyka df368e8094 samples/net: Adding relevant parts to test PM on echo server
Just to get something to test for PM, via frdm_k64f board. So only this
board will get PM enabled.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Andrzej Głąbek 4253eae005 boards: nrf52840_pca10056: Rename board to nrf52840dk_nrf52840
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-27 09:14:08 +01:00
Jukka Rissanen cf720f9882 samples: net: echo-server: Wait network interface before starting
No use starting the application if the network interface is down.
So start to listen connection management events and start the
TCP and UDP handlers only after network is up and ready.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-03-17 17:17:20 +02:00
Oleg Zhurakivskyy 71a225d76f samples: echo_server: Add overlays for debugging
Add overlays that might be useful for debugging:

- overlay-log.conf
   Enable debug log for socket, context, connection, TCP/TCP2.
- overlay-debug.conf
   Disable optimization and compile with debug information.
- overlay-max-stacks.conf
   Overlay to quickly sort out insufficient stack problems.
- overlay-e1000.conf

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-11 16:24:52 +02:00
Gerson Fernando Budke 19e6497d32 samples: net: sockets: echo_server: Update README.rst
Add information about how to build and test atsamr21_xpro board with
IEEE 802.15.4 RF2xx driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke cc91a734d9 samples: net: sockets: echo_server: Add sam_v71_xult config
Add necessary configuration to run demo on the sam_v71_xult board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 2d960aeeb7 samples: net: sockets: echo_server: Add sam4e_xpro config
Add necessary configuration to run demo on the sam4s_xpro board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 97f210bce0 samples: net: sockets: echo_server: Add atsamr21_xpro config
Add special configuration for SAMR21 SoC. Since it have only 32k SRAM,
all possible application buffers need to be shrinked.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Magne Værnes e02eb4e511 samples: net: echo_client/_server: Fix bug in socket close
Fixed bug in udp.c in echo_client and echo_server samples.
The bug causes UDP sockets to not close if socket id is 0.

Signed-off-by: Magne Værnes <magne.varnes@nordicsemi.no>
2020-01-30 12:33:30 +02:00
Jukka Rissanen 1d324a1b20 samples: net: echo-server: Fix compile error for missing IP proto
Make sure that the echo-server compiles ok if IPv6 or IPv4 is
disabled when VLAN is enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-30 09:42:07 +02:00
Ravi kumar Veeramally 326302eda0 samples: net: echo_server: Do not bail out on Accept errors
Echo-server sample should not bail out on failed
accept() calls. This sample should close socket
in case of any errors and keep listening on socket
for further incoming connections.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-01-23 21:07:18 +02:00
Ravi kumar Veeramally d228dd0c85 samples: net: echo_server: Add signed certs and keys
Current sample certs and keys are not signed. Adding
signed certificates and keys. CA file also added.
This helps users to test with different kind of
configurations.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-01-23 21:07:18 +02:00
Robert Lubos 665d195f3a net: sockets: tls: Add missing symbols for a few options
`TLS_PEER_VERIFY` and `TLS_DTLS_ROLE` options accept specific values,
yet no symbols were defined for them. In result, magic numbers were used
in several places, making the code less readable.

Fix this issue, by adding the missing symbols to the `socket.h` header,
and using them in places where related socket options are set.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-20 09:58:23 +02:00
Robert Lubos b3a1ede830 net: openthread: Use settings subsystem
OpenThread settings implementation built on top of Zepyhr settings
submodule.

With this solution, OpenThread settings are identified with keys of
the following format: `ot/id/instance`, where `id` is assigned by
OpenThread stack, and `instance` is a 32-bit random number, both in
hex. The implementation makes use of `settings_load_subtree_direct`
function to iterate over settings instances. This allows the
OpenThread settings layer to be a fully transparent shim layer between
OpenThread/Zephyr APIs.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-16 17:12:47 -06:00
Jukka Rissanen 3dcefbb316 samples: net: echo-server: Generate coverage report
Add "sample quit" shell command which can be used to stop the
sample application and allows the generation of coverage report.

Fixes #21099

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-09 16:34:18 -05:00
Robert Lubos 6b2a371272 samples: net: Remove redundant frdm_kw41z configs from echo samples
echo_client and echo_server configuration for 802.15.4 and OpenThread is
covered by overlay files and default board configuration. Board-specific
configuration for frdm_kw41z was redundant in this case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-09 12:47:45 -05:00
Oleg Zhurakivskyy 516525fcd8 samples: net: echo-server: Increase the stack size for the coverage
echo_server crashes if the coverage is enabled due to the insufficient
stack size.

Use bigger stack size when the coverage is enabled.

Fixes #20797

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-11-27 10:14:20 +01:00
Ulf Magnusson bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Jukka Rissanen 0f30bb23ab samples: net: echo-server: In case of socket error quit the app
Quit the accept loop if there is a socket related error as there
is no point of continuing in this case.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-28 13:58:59 +02:00
Torstein Grindvik b422e4a8ea samples: Add PSK support for echo client/server
PSK support is added to echo-client.c and echo-server.c.
If enabled, a header is included which contains the PSK.
If the default dummy PSK header is used, a warning is issued.
The header can be changed via Kconfig.

Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
2019-10-28 13:02:29 +02:00
Oleg Zhurakivskyy 807662bf52 samples: net: echo-server: Increase the stack size for TCP2
Executing on qemu_x86 leads to stack overflows.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-10-25 14:33:37 +03:00
Andrei Emeltchenko 299c9fedd4 samples: net: Clean up netusb overlay configuration
Clean up configs which do not belong to Ethernet over USB.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-04 21:23:53 +03:00
Jan Van Winkel 391076c73e samples: net: echo-server: Init tcp6_handler_in_use for IPv6
Initialize tcp6_handler_in_use instead of tcp4_handler_in_use for IPv6
in start_tcp.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-10-02 10:07:03 +03:00
Jukka Rissanen 7e0d8bcf7a samples: net: echo-server: Add support for multiple listeners
By default only one listener is enabled, but if user specifies
CONFIG_NET_SAMPLE_NUM_HANDLERS with value larger than 1, then
multiple threads are created, and each will be able to accept
connections.

Fixes #19374

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-01 14:21:38 +03:00
Robert Lubos 324f99e0ac samples: net: Add mbedTLS tweaks in overlay-ot.conf
Add some mbedTLS tweaks for OpenThread in overlay-ot.conf.
Add sample configuration to enable Commissioner/Joiner, disabled by
default.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-09-17 20:07:58 +08:00
Alexander Wachter f8a5b013d7 samples: net: echo_client and echo_server: Add 6LoCAN config
This commit adds a sample configuration for 6LoCAN to the
echo_client and echo_server example.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-08 13:25:01 +03:00
Jukka Rissanen a62c6b2b04 samples: net: echo-server: Add PPP overlay config file
A sample overlay config file for PPP added.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-29 10:24:46 +03:00
Anas Nashif 84e87a1eb4 samples: net: quark/arduino 101 do not have ethernet support
Remove old configurations of boards that do not support networking
natively and very custom and difficult to test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07:00
Maureen Helm 4d5ee282be samples: net: Convert mcr20a samples to use the frdm_cr20a shield
Converts all net samples that enable the mcr20a 802.15.4 driver to use
the frdm_cr20a shield instead of hardcoding configs for the frdm_k64f
base board. This makes it possible to build mcr20a samples for other
base boards with compatible arduino headers.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-07-09 18:15:45 -07:00
Jukka Rissanen 530a1e5415 samples: net: echo_server: Enable SO_TIMESTAMPING if needed
If user has set CONFIG_NET_CONTEXT_TIMESTAMP then enable
network packet throughput collection for UDP packets.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-03 09:42:45 +03:00
Carles Cufi b476643695 doc: Cleanup references to cmake
Clean up some stray references to cmake in doc, boards and
samples that don't make explicit use of the zephyr app extension,
as well as other minor doc fixes.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-06-17 10:09:57 -07:00
Ulf Magnusson a84ded74ea dts: Replace status = "ok" with status = "okay"
The DT spec. only has "okay" and not "ok". The Linux kernel has around
12k "okay"s and 300 "ok"s.

The scripts/dts scripts only check for "disabled", so should be safe re.
those at least.

The replacement was done with

    git ls-files | xargs sed -i 's/status\s*=\s*"ok"/status = "okay"/'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-14 19:51:13 -05:00
Jukka Rissanen 104014154e samples: net: echo-server: Ignore the return value of close()
We are not interested in whether the close() call succeeds or
not when the connection is terminated.

Coverity-CID: 198878
Fixes #16569

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-09 10:23:57 +03:00
Andrei Emeltchenko de26f76ef2 samples: net: echo_server: Fix usbnet configuration
This patch enables USB tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00