Commit Graph

24 Commits

Author SHA1 Message Date
Martin Jäger 9f77f88548 samples: subsys: lorawan: class_a: remove clock sync and multicast
These LoRaWAN services are now covered by the FUOTA sample.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-05-02 16:54:43 +02:00
Martin Jäger 1479f9d239 samples: subsys: lorawan: fuota: add basic sample application
Add basic sample application that starts the LoRaWAN FUOTA services.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-05-02 16:54:43 +02:00
Martin Jäger 60c58fe918 samples: subsys: lorawan: class_a: add multicast support
This is mainly to make sure that the multicast code is built in CI.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-01-30 14:14:05 +00:00
Lucas Dietrich 66b131928b lorawan: Set dev_nonce to 0 during join_cfg initialization
Ensure the LoRaWAN dev nonce is initialized with a known state in the
class_a sample.

Signed-off-by: Lucas Dietrich <lucas.dietrich@socomec.com>
2023-09-26 08:38:05 +02:00
Benjamin Cabé 4f1cd0e428 doc: Migrate subsys/ code samples to new Sphinx extension
This migrates the subsys code samples to the new Sphinx code-sample
extension, making it easier to find relevant samples when browsing
API reference.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-21 09:28:31 +02:00
Daniel Leung b2f2f85ebd samples: lorawan: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02: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
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
Jordan Yates 41d83d7ea2 lora: compile drivers based on devicetree
Similar to the changes made in #48048, compile in the appropriate lora
modem driver when `CONFIG_LORA=y`. The `LORA_SX12XX` symbol has no
use now so remove. LoRa and LoRaWAN subsystems are still marked as
unstable so no additional deprecation cycle is needed.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-03-31 09:20:22 +02:00
Martin Jäger 5dd50f9232 samples: subsys: lorawan: class_a: add clock sync option
Add an option to build the sample with application-layer clock sync
service running in the background.

This will also add a build-check for the clock sync service in CI.

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-01-23 10:05:49 +00:00
Martin Jäger 5b4920c81b samples: subsys: lorawan: class_a: add documentation
Add a README for the LoRaWAN sample.

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-01-23 10:05:49 +00:00
Benjamin Lindqvist 85c6de4335 lorawan: enable run-time config of region/freq
This commit adds support for compiling in support for several different
regions/frequencies and dynamically choosing which to use in run-time.
This commit introduces no API breakages - if a prj.conf contains only a
single region Kconfig, the new function lorawan_set_region() does not
need to be called.

Signed-off-by: Benjamin Lindqvist <benjamin@eub.se>
2022-11-14 11:16:16 +00:00
Jordan Yates 58b65082c2 samples: lora: remove `platform_allow`
The twister docs specify that `platform_allow` should only be used
if applications can only possibly run on the specified platforms. This
is not the case for these applications, which should be able to run on
any board with LoRa support.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-09-29 08:59:03 +00:00
Jordan Yates 3cf42040ae samples: lorawan: verify region compilation
Issue #49960 showed that individual regions can fail to compile when
enabled. As requested in #50626, validate that each region compiles in
CI.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-09-29 08:59:03 +00:00
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Kumar Gala 057f1555c3 samples: lorawan: class_a: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:41:54 -05:00
Gerard Marull-Paretas c7b5b3c419 samples: migrate includes to contain <zephyr/...> prefix
In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:

```python
from pathlib import Path
import re

EXTENSIONS = ("c", "h", "cpp", "rst")

for p in Path(".").glob("samples/**/*"):
    if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
        continue

    content = ""
    with open(p) as f:
        for line in f:
            m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
            if (m and
                not m.group(2).startswith("zephyr/") and
                (Path(".") / "include" / "zephyr" / m.group(2)).exists()):
                content += (
                    m.group(1) +
                    "#include <zephyr/" + m.group(2) +">" +
                    m.group(3) + "\n"
                )
            else:
                content += line

    with open(p, "w") as f:
        f.write(content)
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 11:29:59 +02:00
Anas Nashif 1e4027aa7c samples: prefix should be sample, not samples
convention is to start sample identifiers with sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-03-18 10:50:57 -04:00
Erwan Gouriou fa16f8654a samples: lora: Add harnesses for execution with twister
Lora samples are missing harnesses and hence are reported
failed by default by twister.
Add required harnesses to be able to detect correct and faulty
test executions.

Fixes #42159

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-28 19:15:01 -05:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Fabio Baltieri 2e60836eca samples: lora, class_a: allow building on nucleo_wl55jc
Add nucleo_wl55jc to platform_allow for lora send/receive and class_a
samples. The board has a variation of the sx1262 driver, this should
allow to build test that code path.

Fix the existing config as well to specify the platforms on a single
line, as currently only the last entry is considered.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-07-15 21:30:28 -04:00
Ilya Tagunov 33faca671d samples: lorawan: class_a: increase stack sizes
Increase main and system workqueue stack sizes to avoid overflows
as the LoRaMac-node library is quite stack-hungry.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2021-06-18 11:22:03 +02:00
Jordan Yates e7368e1940 samples: lorawan: class_a: downlink cb
Add an example downlink callback to the LoRaWAN sample.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-04-30 13:05:10 -05:00
Anas Nashif bcec7029fd samples: move lorawan to subsys/lorawan
lorawan has its own susbsystem, so move this sample under subsys/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00