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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
New event LWM2M_RD_CLIENT_EVENT_REG_UPDATE to indicate
application that engine starts registration update.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
The source file for most single-file sample apps is usually
`main.c`. Rename this file to be consistent with other
samples.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
* use `read()` instead of `recv()`
* use `write()` instead of `send()`
* use `CONFIG_POSIX_API` and drop `<zephyr/posix/..>` prefix
* use `perror()`
* fix `Makefile.posix` to use `CC` instead of `CXX`
* fix race condition which caused an unhandled EOF
and infinite loop, by adding a readback / echo
* Updated the docs to reflect the expected stdout
* Improve doc clarity
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Recent Zephyr changes (IEEE 802.15.4 config moved from KConfig
to DeviceTree) left the TI CC1352r1_launchxl board's net examples in
a non-working state, mainly due to the fact that CC13x2 has two
IEEE802154 interfaces available (2.4GHz and sub-GHz) and none were
enabled.
This commit enables the 2.4GHz radio inside the board's DTS and also
introduces a new devicetree overlay inside the echo* samples:
'boards/boards/cc1352-enable-subg.overlay', enabling the sub-GHz
interface.
Signed-off-by: Stancu Florin <niflostancu@gmail.com>
By default, qemu_coxtex_m3 target selected SLIP driver as
a network backend. This requires some unstandard tool (tunslip6),
which are error prone and might not necessary work.
Ethernet backend work equally well as in native_posix so
use the same for both.
Change the default emulation platform from X86 to Cortex-M3
because it supports Ethernet by default.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Allow endpoint name, PSK and TLS tag and server address
to be configured in Kconfig.
When endpoint name is not defined, use CONFIG_BOARD.
Also use endpoint name as a PSK ID instead of hard coded
"Client_identity" which would collide if more than one instance
is ran against same server. Now we could define different identity
for each endpoint.
Also, as a mininal refactor, allow DNS names to be used in
server address, instead of assuming IP address.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
By default, qemu_coxtex_m3 target selected SLIP driver as
a network backend. This requires some unstandard tool (tunslip6),
which are error prone and might not necessary work.
Ethernet backend work equally well as in native_posix so
use the same for both.
Change the default emulation platform from X86 to Cortex-M3
because it supports Ethernet by default.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The sample documentation mentions that the sample can be built directly
on Linux, which was no longer the case. This commit fixes it.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The old link has expired, the file is no longer avaiable to download.
Update the download link, which now leads to a file in Ubuntu
repositories for the recent LTS release, hopefully making the link valid
for longer period.
As the server ceritficate is signed by a different root CA, update the
root CA as well.
Finally, cleanup how the URL is handled in the sample - for TLS variant
it'll always be provided with a Kconfig, hence no need to repeat it in
the sample.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
It's often the case with TLS file servers, that the download link does
not lead to downloaded file, but rather redirects to another server.
Therefore it makes sense to have a minimal support in the sample for
HTTP redirection, so that the file can still be downloaded.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This application uses the uart1 DT node, so it should enable it,
not assume that it will be enabled by default for a given board.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit updates all in-tree code to use `CONFIG_CPP` instead of
`CONFIG_CPLUSPLUS`, which is now deprecated.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
Disables having USB enabled for boards that configure USB CDC for
console, shell or logging at bootup in applications that enable USB
to prevent a conflict arising whereby USB is registered from
multiple points and later calls fail.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fix all line-length errors detected by yamllint:
yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
grep '(line-length)'
Using a limit is set to 100 columns, not touching the commandlines in
GitHub workflows (at least for now).
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Fix all comments-indentation errors detected by yamllint:
yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
grep '(comments-indentation)'
This checks that the comment is aligned with the content.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>