Commit Graph

2038 Commits

Author SHA1 Message Date
Marek Matej 3776402f40 boards: xtensa: esp32 board split
Remove virtual esp32 board and replace it with the
real word boards:

- esp32_devkitc_wroom
- esp32_devkitc_wrover (with PSRAM option)

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-25 18:12:33 +02:00
Robert Lubos 9866a5229d samples: net: dns_resolve: Improve DHCPv4 handling
There is some ambiguity with the DHCPv4 handling in the dns_resolve
sample. On one hand, the sample uses net_config library, which does
initiate the DHCPv4 on the interface (if enabled) and may block the
initialization until the address is assigned (in case there is no other
statically assigned IPv4 addresses.) On the other hand, the sample
registers for NET_EVENT_IPV4_ADDR_ADD in case DHCPv4 is in use, delaying
the DNS queries until address is assigned.

In case net_config delayed the initialization however, this will not
work, as the event handler will be registered only after DHCPv4 address
is assigned, so the callback will not get executed.

Fix this, by checking if DHCPv4 assigned address already exists on an
interface - if so, schedule DNS queries immediately. Otherwise (for
example in case when net_config was not configured to wait for address)
register an event callback, and schedule queries from there.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-25 14:18:54 +02:00
Chaitanya Tata 631312334e samples: lwm2m: Fix default ID length check for DTLS
If the default which is set to CONFIG_BOARD is used, then the lwm2m
client fails to set the client identity as the default maximum length
allowed is only 16 and for some boards this exceeds.

So, increase the default length to accomodate almost all boards. Also
add a build assert for the length validation.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-07-18 11:08:23 +00:00
Robert Lubos 87ee12ae72 samples: net: echo_client: Fix build with UDP disabled
In case UDP is disabled, init_udp() is not compiled and the build
fails. Fix this, by providing dummy implementations for UDP functions,
in case UDP is disabled.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-17 17:21:33 -04:00
Robert Lubos 1f1f550ad6 samples: net: echo_client/server: Fix mbed TLS dependency
All application level TLS operations should be guarded with
"#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)" and not mbed TLS configs
only. Otherwise, in case mbed TLS is enabled, but the sample is not
configured to use TLS (hence TLS credential library is not available
for example), the build may fail or produce spurious warnings.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-17 17:21:33 -04:00
Jiaxuan Weng 33e3ddd4d5 boards: xtensa: Add support for xiao esp32s3
add board support and overlay for seeed xiao esp32s3.

Signed-off-by: Jiaxuan Weng <1391548050@qq.com>
2023-07-03 09:31:27 +02:00
Seppo Takalo 5c1228770e net: lwm2m: Add support for X509 certificates
Add support for using X509 certificates.
Default settings use ECDSA certificates with SHA256 hash.

When different settings are required clients should overwrite
struct lwm2m_ctx->load_credentials() and
struct lwm2m_ctx->set_socketoptions()

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-06-26 12:35:29 +00:00
Saravanan Sekar 026d476a84 samples: websocket_client: close tcp socket after websocket_disconnect
websocket_disconnect api does not closes user tcp socket, so tcp socket
must be closed after done.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2023-06-19 09:18:45 +01:00
Florian Grandel 1ee4d3ed77 net: l2: ieee802154: document L1/L2 sep. of concerns
The method ieee802154_radio_handle_ack() does not belong to the
PHY/radio layer but to the L2 layer. It is a callback called from the
radio layer into the L2 layer and to be implemented by all L2 stacks.
This is the same pattern as is used for ieee802154_init(). The
'_radio_' infix in this function is therefore confusing and
conceptually wrong.

This change fixes the naming inconsistency and extensively documents
its rationale.

It is assumed that the change can be made without prior deprecation of the
existing method as in the rare cases where users have implemented custom
radio drivers these will break in obvious ways and can easily be fixed.

Nevertheless such a rename would not be justified on its own if it were
not for an important conceptual reason:

The renamed function represents a generic "inversion-of-control" pattern
which will become important in the TSCH context: It allows for clean
separation of concerns between the PHY/radio driver layer and the
MAC/L2 layer even in situations where the radio driver needs to be
involved for performance or deterministic timing reasons. This
"inversion-of-control" pattern can be applied to negotiate timing
sensitive reception and transmission windows, it let's the L2 layer
deterministically timestamp information elements just-in-time with
internal radio timer counter values, etc.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-17 16:20:21 -04:00
Bjarki Arge Andreasen 22152915ab drivers/gsm_ppp: Update existing modules to use PPP L2
This commit replaces the workarounds spread around the
drivers and subsystems with the updated PPP L2
interface.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-06-17 07:46:21 -04:00
Andrei Hutanu be04e30a88 samples: net: mqtt_azure: hotfix stack overflow
running samples/net/cloud/mqtt_azure in QEMU with default
configuration crashes with exception. This PR change doubles
the default workqueue stack size in a attempt to fix the issue
reported in: GH#58930.

Signed-off-by: Andrei Hutanu <andrei.hutanu.i@gmail.com>
2023-06-14 09:12:08 -04:00
Anas Nashif 8ffb08b10e tests: net: sockets: remove scneario
This scneario does not build and does not fit on hardware, remove.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-13 09:38:27 -04:00
Anas Nashif b835b02136 tests: cleanup metadata and filtering
- Add integration_platforms to avoid excessive filtering
- Make sure integration platforms are actually part of the filter
- Fix some tags and test meta data

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-13 09:38:27 -04:00
Théo Battrel e9ee3e0af0 Bluetooth: Samples: Remove usage of `BT_DEBUG_LOG`
Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from samples. It
has been deprecated since this PR:
https://github.com/zephyrproject-rtos/zephyr/pull/56183

The Kconfig symbols has been replaced by `CONFIG_LOG=y` on most of the
cases. Or it has been removed when not needed anymore.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-06-07 13:56:55 -04:00
Benjamin Cabé 21f473aaec samples: doc: fix dead links
Fixed deadlinks reported by Sphinx linkchecker

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-06-07 04:40:47 -04:00
Matthew Bradbury 74e98d5375 samples: coap_client: Return correct result from send_simple_coap_request
send_simple_coap_request needs to return a result from previous functions
instead of success at the end of the function. Without doing so the example
may wait for a response from a coap sever when a message failed to send.

Signed-off-by: Matthew Bradbury <matt-bradbury@live.co.uk>
2023-06-05 08:30:41 -04:00
Anas Nashif 34a4001d49 samples: net: fix tags/identifiers
Add net tag to net samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-02 04:47:06 -04:00
TOKITA Hiroshi 5f5b34793d samples: net: dhcpv4_client: Make DHCPv4 requests on all ipv4 interfaces
Send DHCPv4 requests on all available ipv4 interfaces.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-05-29 14:34:46 -04:00
Torsten Rasmussen 1120934874 doc: samples: update OVERLAY_CONFIG to EXTRA_CONF_FILE
Update rst files to use EXTRA_CONF_FILE instead of OVERLAY_CONFIG.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-05-23 16:40:21 +02:00
Matthias Breithaupt 82c576c536 samples: dhcpv4_client: Add option callback
Extend the DHCPv4 sample to make use of the option callback functionality.
This serves as a reference of how to register and use a custom option
callback.

Signed-off-by: Matthias Breithaupt <m.breithaupt@vogl-electronic.com>
2023-05-22 15:25:40 +02:00
Chris Morgan 777f88939f samples: net: mdns_responder: Code in example is unrelated to mDNS
Clarify the comment in the code so people looking to use mDNS don't
think that interaction with Zephyr is necessary for mDNS support to
work, its in fact built into the networking stack when the mDNS
feature is enabled.

Signed-off-by: Chris Morgan <chmorgan@gmail.com>
2023-05-22 08:05:49 +00:00
Georges Oates_Larsen 5350d417e9 samples: net: sockets: echo_server: Use conn_mgr ignore_iface
conn_mgr now allows applications to request that ifaces be ignored.

This commit changes the echo_server sample to use this feature to
filter out the tunnel iface, instead of manually filtering events
generated by it.

This will allow the echo_server sample to remain compatible with
planned changes to conn_mgr, namely a switch from events being
fired for every individual iface that goes up or down, to only
being fired when connectivity is gained or completely lost.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-05-11 12:15:44 +02:00
Georges Oates_Larsen 716c19f7ef net: conn_mgr: Reorganize files
Since conn_mgr is a subsystem rather than a library, relocate it
directly into subsys/net rather than subsys/net/lib/

Rename header files to better match their function.

Remove net_ prefix from conn_mgr types, API, and files, since it is
unnecessary.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-05-11 12:15:44 +02:00
Johann Fischer 0929d73788 samples: zperf: add overlays for USBD CDC ECM implementation
Add DT and Kconfig overlay for new experimental CDC ECM
implementation. USB device support configuration and
initialization can be done through shell by following
commands:

uart:~$ usbd config add 1
uart:~$ usbd class add cdc_ecm_0 1
uart:~$ usbd defaults
uart:~$ usbd init
uart:~$ usbd enable

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-05-11 11:26:54 +02:00
Lucas Dietrich e803b77463 samples: net: mqtt: Add a sample to connect to AWS IoT core
This sample application demonstrates the implementation of an
MQTT client that can publish messages to AWS IoT Core using
the MQTT protocol.

Fixes #22866

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2023-05-10 17:54:56 +02:00
Gerard Marull-Paretas 93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Alberto Escolar Piedras 2d5d9fdf77 tests/net: For nrf52_bsim use flash model
Now that the nrf52 HW models support it,
let's use their flash model instead of falling back
to the openthread RAM settings backend.

Note that the flash model defaults to just keeping the
flash content in the Linux process heap.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-05-08 10:08:35 +02:00
Keith Packard 4134858868 tests/samples: Replace minimal libc malloc configs with common ones
With the minimal C library malloc implementation moving to libc/common, all
of the related Kconfig variables have also changed. Update uses within the
tree.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-27 20:17:24 +09:00
Hein Wessels 9ea250a445 samples: net: sockets: sntp_client: build for native_posix
Extend the sample to be built with native_posix
prevent issues like #57133 in the future. Also extends the qemu
build to build a "raw" configurationw without POSIX_API or
NET_SOCKETS_POSIX_NAMES.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-04-24 09:23:17 -04:00
Hein Wessels 2689e16670 net: sntp: support building without NET_SOCKETS_POSIX_NAMES
Fixes the compiler error that occurs when attempting to build
the SNTP library with CONFIG_NET_SOCKETS_POSIX_NAMES=n, while
using native_posix.

Closes #57133

Co-authored-by: Chris Friedt <cfriedt@meta.com>
Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-04-24 09:23:17 -04:00
Sylvio Alves a6c8c6e546 soc: esp32s3: add Wi-Fi support
This adds Wi-Fi linker areas and also bring wi-Fi entry
into SoC device tree.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-04-19 17:11:58 +02:00
Gerard Marull-Paretas 1eb683a514 device: remove redundant init functions
Remove all init functions that do nothing, and provide a `NULL` to
*DEVICE*DEFINE* macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-19 10:00:25 +02:00
Gerard Marull-Paretas 667eeb11fb shell: fix MISRA 5.7 violations on `struct shell`
MISRA Rule 5.7 requires uniqueness of tag identifiers. Shell is
frequently problematic because many code uses `const struct shell
*shell`. This causes CI noise every time one of these shell files is
edited, so let's update all of them with `const struct shell *sh`
instead.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-14 12:21:08 +02:00
Keith Packard 0b90fd5adf samples, tests, boards: Switch main return type from void to int
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Most of these changes were automated using coccinelle with the following
script:

@@
@@
- void
+ int
main(...) {
	...
-	return;
+	return 0;
	...
}

Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Huifeng Zhang dcd2778525 samples: zperf: enable it on the fvp_base_revc_2xaemv8a board
Add config file and devicetree overlay for the fvp_base_revc_2xaemv8a
board, so that this sample can run on this board.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-04-11 11:27:05 +02:00
Huifeng Zhang bd8f527368 samples: zperf: enable it on the fvp_baser_aemv8r board
Add config file and devicetree overlay for the fvp_baser_aemv8r board,
so that this sample can run on this board.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-04-11 11:27:05 +02:00
Huifeng Zhang 5d90e7589c samples: dhcpv4_client: enable it on the fvp_base_revc_2xaemv8a board
Add config file and devicetree overlay for the fvp_base_revc_2xaemv8a
board, so that this sample can run on this board.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-04-11 11:27:05 +02:00
Huifeng Zhang 1ae558f5b4 samples: dhcpv4_client: enable it on the fvp_baser_aemv8r board
Add config file and devicetree overlay for the fvp_baser_aemv8r board,
so that this sample can run on this board.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-04-11 11:27:05 +02:00
Dean Sellers b0d785df18 samples: net: wifi: esp32: add auto dhcpv4 to esp32 boards
The wifi sample for esp32 boards would connect but not do
dhcp.

Signed-off-by: Dean Sellers <dsellers@evos.com.au>
2023-04-07 13:32:16 +02:00
Anas Nashif fcefc27823 tests: remove intel adsp cavs platforms from filters
Remove all filters related to dropped platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-06 18:51:56 +02:00
Anas Nashif 629892eb7a samples: zperf: remove reference to quark se
Quark SE does not exist in zephyr anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-03-29 10:26:56 -05:00
Alberto Escolar Piedras 6decd2d55f samples echo_client/server: Add overlay for nrf52_bsim
To disable the flash by default so the openthread RAM
settings backend is used instead.
This allows using this samples with the overlay-ot.conf
directly in the simulated nrf52_bsim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-03-22 14:09:03 +01:00
Robert Lubos 45d9960bc6 samples: net: sockets: echo_client: Fix userspace crash
k_work_* APIs cannot be used from user threads, hence it has to be
replaced with some other solution to retain userspace functionality in
the sample.

This commit reworks the sample as follows:
  * Replace delayed work items with combination of k_timer and a
    dedicated thread to send UDP packets. k_poll_signal is used for
    communication between k_timer callback and UDP thread.
  * As kernel objects should not be placed in a memory modifiable from
    user threads, declare a separate structure for them, and link it
    with the client context structure with a pointer.
  * k_timer_init() is not a system call, therefore it has to be called
    from supervisor thread. Therefore, add an additional function to
    initialize UDP, and use it to initialize kernel objects used by the
    UDP module and grant access for the main thread before it becomes an
    user thread. UDP thread inherits permissions from the parent (main
    thread).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-03-20 16:56:46 +01:00
Kumar Gala 9a759025d9 samples: net: sockets: tcp: Add newlib filter to samples.yaml
Not all toolchains support newlib so tests that require newlib need
to have a filter to we don't try and build those tests on those
testcases.  Add the following to samples.yaml to handle the issue:

	filter: TOOLCHAIN_HAS_NEWLIB == 1

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-03-16 11:46:45 +01:00
Sylvio Alves 14ac1347e2 samples: wifi: esp32s2_saola: decrease heap size
Current stack size is making build fail due to ram overflow.
So, decresase total heap available to make room for the application.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-03-09 17:21:04 +01:00
Sebastian Arnd 3cd58c29bf net/lib: mqtt_sn: Fix MQTT-SN IPv6 Support and assertation in Example
1. `zsock_socket()` gets the right packet familiy.
2. `inet_pton()` returns 1 on success.

This should address #55193.

Signed-off-by: Sebastian Arnd <sebastianarnd@gmail.com>
2023-03-09 09:20:53 +01:00
Marc Lasch 072a5da433 net: lwm2m: Register callback for firmware update cancel
Allow to register a callback function which is called when a firmware
update is canceled by the cancel command.

Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
2023-03-06 12:33:12 +01:00
Robert Lubos 46e93f67a6 samples: net: sockets: echo_server: Fix userspace crash
k_work_* API cannot not be used from the user threads as the APIs are
not syscalls. Doing so leads to a crash when userspace is enabled.

As the current use of delayed work API from user threads is merely
scheduling of the initial work execution, it can be moved into the main
thread context. The time difference from the former and current approach
should be marginal, as the start_tcp/udp_proto() calls are not blocking
calls.

Another issue was usage of k_mem_domain_add_thread() on uninitialized
TCP threads. This lead to another crash, as assigning thread to a memory
domain also involves removing it from the previous domain, which lead to
NULL pointer dereference if thread was not initialized yet. As, by
default, newly spawned threads inherit memory domain assignment from
their parent, it's not really needed to assign the same domain
explicitly, hence, it can be safely removed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-03-03 10:48:21 +01:00
Jamie McCrae af78cbdc99 samples and tests: Add REQUIRED to Zephyr find_package call
Adds REQUIRED to samples and tests for finding the zephyr package
to align all samples and tests with the same call and parameters.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-02 09:58:27 +01:00
Sjors Hettinga 0243599766 samples: echo_server: Add a full network stack overflow
Some features like IP fragmenting are default disabled to keep the network
stack compact for small devices.
In bigger applications as well as for the Maxwell Pro tests it required
to have the full functionality enabled. This can also work as example for
new projects.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2023-02-24 11:49:54 +01:00