Commit graph

23 commits

Author SHA1 Message Date
Benjamin Cabé 14c92da96d doc: stm32: Update all st.com links to use HTTPS
While recent browsers seem to transparently try to use https for
http://www.st.com/... URLs, they are effectively not working anymore, so use
https://www.st.com/... URLs instead.

curl http://www.st.com/en/evaluation-tools/nucleo-g070rb.html -m 5 -v
*   Trying 104.89.117.48:80...
* Connected to www.st.com (104.89.117.48) port 80 (#0)
> GET /en/evaluation-tools/nucleo-g070rb.html HTTP/1.1
> Host: www.st.com
> User-Agent: curl/8.1.2
> Accept: */*
>
* Operation timed out after 5002 milliseconds with 0 bytes received
* Closing connection 0
curl: (28) Operation timed out after 5002 milliseconds with 0 bytes
received

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-26 16:55:08 +02:00
Benjamin Cabé 32dcd2e523 samples: shields: Update Nucleo shields to new code-sample extension
Update all Nucleo shield samples and references to them so that they
use the new zephyr:code-sample extension.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-25 16:43:05 +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
Stephan Linz 9f0bc06468 samples: mimxrt1010_evk: exclude various tests
Disable various samples because they require certain digital signals
from the Arduino header, which are not connected when the board is
shipped and therefore not defined via the connector gpio-map.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2023-05-08 09:58:30 +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
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
Gerard Marull-Paretas a202341958 devices: constify device pointers initialized at compile time
Many device pointers are initialized at compile and never changed. This
means that the device pointer can be constified (immutable).

Automated using:

```
perl -i -pe 's/const struct device \*(?!const)(.*)= DEVICE/const struct
device *const $1= DEVICE/g' **/*.c
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-22 17:08:26 +02:00
Kumar Gala 5d36157c7c sensors: Remove unnecessary Kconfig setting of sensors
Sensor Kconfig sybmols should be enabled if CONFIG_SENSOR=y
and the devicetree node for the sensor is enabled.  We can
remove explicitly enabling specific sensor drivers in .conf
files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-25 15:18:56 +02:00
Kumar Gala e263876065 samples: x_nucleo_iks02a1: standard: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE 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 10:48:09 +02:00
Steffen Jahnke 612b9247e4 boards: Exclude boards from shield samples
Some of the Panasonic's evaluation boards have limited amount of pins.
So not all arduino pins can be occupied and not all shields are
compatible.

Signed-off-by: Steffen Jahnke <steffen.jahnke@eu.panasonic.com>
2022-06-28 15:51:55 +02: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
Radoslaw Koppel d1a93c1426 drivers: sensor: Const sensor trigger data in trigger handler
This commit adds const modifier in second argument for
sensor trigger handler.
There is no reason to modify this data and this change
would allow to store trigger configuration also in FLASH.

Fixes: #38929

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2021-10-27 15:09:35 -04: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
Henrik Brix Andersen 34904e567b boards: arm: lpcxpresso55s16: rename board definition
Rename the NXP LPCXpresso55S16 board definition from
lpcxpresso55s16_ns (non-secure) to lpcxpresso55s16 and remove TF-M
configuration options.

While the LPC55S16 does have Arm TrustZone support, there is no TF-M
support available upstream yet.

Fixes #35100

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-05-19 08:02:54 -05:00
Armando Visconti 79c709bf02 drivers/sensor: ism330dhcx: Move INT_PIN Kconfig attr into DT
Convert ism330dhcx INT_PIN attribute from Kconfigs to Device
Tree binding properties. Here int-pin has been defined as
enum with two possible values: 1 and 2.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-02-28 16:47:15 -05:00
Armando Visconti d2e8b0cc6e drivers/sensor: iis2dlpc: Move drdy_int info into DT
The IIS2DLPC drdy interrupt can be routed to either INT1 or
INT2 pin. Currently the selection is done by Kconfig configuration.
This commit is instead moving it into Device Tree as 'drdy-int'.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-01-18 09:21:00 -06:00
Erwan Gouriou c7f26e99f1 samples/shields: x_nucleo_iks01a3/02a1: Default use of prj.conf
By default, prj.conf is the CONF_FILE file use by any application.
Use the file when it is not the case and remove the line that sets
it in CMakeLists.txt as this is not required.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-12-02 13:17:30 -06:00
Peter Bigot 56048bb500 samples: add FP formatting to all samples that require it
Samples that include floating-point format specifications may need
cbprintf FP support.  Make sure it's available.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-17 14:44:59 -06:00
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Henrik Brix Andersen 5e2e1ab3ea samples: shields: x_nucleo_iks0xax: exclude lpcxpresso55s16_ns board
Exclude the NXP LPCXpresso55S16 board from the X-NUCLEO-IKS0xAx
samples, since the rely on having Arduino Uno header A3 available.

On the LPCXpresso55S16, A3 is connected through a resistor (R63) which
is not mounted by default.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-06-19 15:18:16 +02: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
Anas Nashif 5622ee4c59 samples: x_nucleo_iks02a1: fix test identifier
Use a more complete test identifier instead of just test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-07 14:23:45 -04:00
Armando Visconti 9f52bfd12b samples/shields: add samples to test x-nucleo-iks02a1 shield
Provide three basic examples to test the x-nucleo-iks02a1 shield:

    - Test shield standard mode
        Acquire sensor data from shield configured in mode 1.

    - Test shield sensorhub mode
        Acquire sensor data from shield configured in mode 2.

    - Test on-shield microphone
        Acquire microphone PDM audio and output it in 16-bit
        PCM format to console.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-05-06 10:33:07 -05:00