Commit graph

145 commits

Author SHA1 Message Date
Anas Nashif
ae8c4a934e samples: move sof under samples/modules
This is not a sample of an audio subsystem in zephyr, it is a sample
that completely depends on sof and its audio support.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-25 14:41:37 -04: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
c77035c61e samples: module: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from samples.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:00:36 -07:00
Francois Ramu
b5f3df0303 samples: canopenmode exclude nvs_sector_size above 64K
This commits is restricting the execution of the
samples/modules/canopennode to board configuration where
the nvs_sector_size is less than 0x10000.
When the CONFIG_CANOPENNODE_STORAGE is selected, the
settings_subsys_init do not accept
nvs_sector_size > UINT16_MAX.
Then all the stm32h723/h743/h745/h750 cannot run the
sample.modules.canopennode testcase

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-07-13 10:14:03 +02:00
Kumar Gala
d9c5022d3b samples: tflite-micro: 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-07 10:01:20 +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
Anas Nashif
2d97bdd85d samples: add module requirement into samples
Do not build those samples if the needed modules are not available in
the workspace.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-19 09:38:55 -04:00
Yuval Peress
aaf0c6e827 modules: chre
Add initial build rules for CHRE. This change includes a Kconfig and
CMakeLists.txt to begin compiling code from the CHRE module.
Additional files are included to bridge the APIs from CHRE's to
Zephyr's. These can be found in modules/chre/include and
modules/chre/src.

Additionally, add a sample to make sure that the module builds. It can
be built via:

```
$ west build -b native_posix -p=always samples/application_development/chre
```

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-18 13:21:52 -05:00
Lauren Murphy
2faa6f5c0b samples: misc fixes to docs
Changes console blocks in hello_world and magic_wand tflite-micro
samples to Kconfig blocks to match content. Fixes typos in
some networking samples so that code blocks display instead
of being hidden. Fixes path to litex-vexriscv-tflite.resc.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-04-12 08:33:32 -04:00
Yuval Peress
a98f5d719e samples: Normalize .cc extensions to .cpp
Rename all .cc files to .cpp (note that no .hh files were found).
Addresses #44196

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-11 16:09:21 -05:00
Henrik Brix Andersen
2f43226b3d modules: canopennode: CANopenNode does not support CAN-FD
The CANopenNode stack does not support CAN-FD. Depend on it being
disabled and explicitly disable it in the CANopenNode sample.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-25 15:35:10 -07:00
Lauren Murphy
5e8b7b5b37 samples: tflite-micro: fix hello_world README
Corrects number of loops mentioned in README of sample
to match NUM_LOOPS in main.c. NUM_LOOPS was lowered in
PR #41123 to reduce the noise the sample produced in CI,
but the PR missed changing the README.

Cleans up one line.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-03-23 16:51:22 -04:00
Nazar Kazakov
f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Yuval Peress
ea3f3dac50 samples: nanopb: Add .options file to the sample
Add an options file to the sample to help developers that aren't
familiar with nanopb

Signed-off-by: Yuval Peress <peress@google.com>
2022-03-07 10:48:06 +01:00
Henrik Brix Andersen
878ea22eac samples: modules: canopennode: filter tests based on dts
- Filter out the CANopenNode tests if no zephyr,canbus chosen node is
  enabled in the devicetree.
- Enable the program download build-only test on all boards with the
  necessary fixed partions.
- Explicitly exclude boards without the needed flash support from the
  program download build-only test as these do not even pass Kconfig and
  thus fail to complete the twister filter stage.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-24 07:12:54 -06:00
Henrik Brix Andersen
8372de867d samples: modules: canopennode: enable CONFIG_GPIO
The CANopenNode sample uses GPIO. Ensure it is enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-24 07:12:54 -06:00
Moritz Fischer
aa283e5439 samples: modules: canopennode: Add stm32f072b_disco support
Add support for the stm32f072rb discovery board.

Signed-off-by: Moritz Fischer <moritzf@google.com>
2022-02-22 10:25:08 +01:00
Moritz Fischer
499cc72411 samples: modules: canopennode: Fix example code
When moving the samples to samples/modules the example code was not
updated accordingly.

Fixes: 613f1cde4a
Signed-off-by: Moritz Fischer <moritzf@google.com>
2022-01-28 10:05:58 +01:00
Henrik Brix Andersen
13e6d264bb samples: modules: canopennode: add stm32f3_disco support
Add support for the ST STM32F3 Discovery development board.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-11 14:40:49 -06:00
Lauren Murphy
5b62546eed samples, modules: tflite-micro: reduce sample test case noise
Reduces noise of sample test case in CI by reducing number of
output lines from 50 to 10.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-12-13 19:24:32 -06:00
Stephanos Ioannidis
6ee8182e0a samples: tflite-micro: hello_world: Increase main stack size
This commit increases the main stack size to 2048 since the current
stack size is insufficient for the `qemu_x86` board (the default stack
size is 1024 for that board) and results in a stack overflow in the
main thread.

Note that this is required because the newlib full variant, which is
used by this sample, included in the Zephyr SDK 0.13.2 now has an
increased stack usage requirement due to enabling the C99 format
specifier support.

For more details, refer to the issue #40469 [1].

[1] https://github.com/zephyrproject-rtos/zephyr/pull/40469#issuecomment-977854095

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-11-25 06:58:45 -05:00
Fabio Baltieri
911a483f7a samples: canopennode: update led and sw to use gpio_dt_spec
Switch the LED and button code to the gpio_dt_spec APIs. This also gets
rid of the code conditionals, so that the entire sample code is always
compiled.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-11-12 14:51:16 +01:00
Fabio Baltieri
fa87410cd6 samples: canopennode: increase main stack size
Bump up the main stack size from 1kB to 2kB, seems like the settings
restore function right now goes above the default stack size for SPI
flash devices:

0x20000aa8 main (real size 2048): unused 864 usage 1184 / 2048 (57 %)

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-11-12 14:51:16 +01:00
Henrik Brix Andersen
5bc0451f72 drivers: can: remove DT_CHOSEN_ZEPHYR_CANBUS_LABEL macro
Remove the DT_CHOSEN_ZEPHYR_CANBUS_LABEL macro and replace it with
DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)) were possible.

Where both devicetree CAN controllers and Kconfig specified CAN loopback
controllers are supported, the macro is replaced with
DT_LABEL(DT_CHOSEN(zephyr_canbus)) for now.

This is the first pass for removing the requirement for devicetree
labels for CAN controllers.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-11-09 11:19:50 +01:00
Henrik Brix Andersen
c817a09b0a canbus: rename zephyr,can-primary chosen property to zephyr,canbus
Rename the Zephyr chosen property for specifying the default CAN bus
controller from "zephyr,can-primary" to "zephyr,canbus".

The "zephyr,can-primary" property name was selected in antipation of
adding support for redundant CAN networks, which we have yet to
add. Meanwhile, the "primary" term causes confusion for non-redundant
CAN bus configurations (and the "can" term doesn't match the name of the
Zephyr CAN bus subsystem).

The CAN in Automation (CiA) 302-6, which deals with CANopen network
redundancy, uses the terms "default interface" and "redundant
interface". If/when we add support for redundant CAN networks, the
"zephyr,canbus" chosen property can be supplemented with a
"zephyr,canbus-redundant" chosen property.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-11-07 09:05:39 -05:00
Fabio Baltieri
46ef9be075 samples: canopennode: fix the sample path
The sample code got moved in 613f1cde4a, update the old path to the
current one.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-09-27 21:54:56 -04:00
Stephanos Ioannidis
9d7c9ffefd samples: tflite-micro: hello_world: Enable standard C++ library
The TensorFlow Lite module makes use of the features provided by the
standard C++ library (e.g. `#include <functional>`), so the standard
C++ library config must be enabled for it.

This used to work without `CONFIG_LIB_CPLUSPLUS=y` due to the bug
described in the issue #36644.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-09-21 11:39:18 -04:00
Lauren Murphy
bdae9399be samples: tflite-micro: fix magic_wand
Fixes accelerometer_handler.cc to import correct header
with TfLiteStatus since c_api_internal.h file was deleted in
the new standalone tflite-micro repo.

Removes import of version.h in main_functions.cc to match
tflite-micro version.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-08-24 07:26:08 -04:00
Lauren Murphy
82f64e1f20 samples: tflite-micro: update hello_world
Updates tflite-micro hello_world sample code.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-08-24 07:26:08 -04:00
Lauren Murphy
6fd1b02496 docs, samples: tflite-micro: change tensorflow to tensorflow lite micro
Changes name of folder from tensorflow to tflite-micro and updates docs
to reference TensorFlow Lite Micro specifically instead of TensorFlow.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-08-24 07:26:08 -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
4216b9f622 modules: canopennode: rename header and Kconfig options
Rename the top-level header file from <canbus/canopen.h> to
<canopennode.h>.

Rename CANopenNode related Kconfig options from CONFIG_CANOPEN* to
CONFIG_CANOPENNODE*.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-01 13:32:18 -04:00
Henrik Brix Andersen
613f1cde4a samples: modules: canopennode: move the CANopenNode sample to modules
Move the CANopenNode sample into the samples/modules directory.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-01 13:32:18 -04:00
Alexey Brodkin
2b2a2cad68 samples: tensorflow: Fix sample path
Otherwise documentation mentions wrong path in the "west" options.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-05-27 14:40:12 -05:00
Lauren Murphy
f492636aa9 samples: tensorflow: remove requirements.txt from magic wand sample
Removes the requirements.txt from the training directory of the
magic wand sample as it is causing issues in CI. Updates README.md
to explicitly state the Python packages listed in requirements.txt.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-24 14:18:08 -04:00
Lauren Murphy
f77d5c5c53 samples: tensorflow: change from file list to glob in cmakelists.txt
Changes CMakeLists.txt in TensorFlow samples from explicit file
list to a GLOB capturing src/* to make TensorFlow samples consistent
with other samples in tree.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-20 20:59:45 -04:00
Lauren Murphy
e4b985b929 samples: tensorflow: fix documentation
Fixes documentation for samples that incorrectly state that TensorFlow
library requires the -fno-threadsafe-statics flag to compile.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-20 20:59:45 -04:00
Lauren Murphy
e6b8c50599 samples: tensorflow: add no-threadsafe-statics to compiler flags
Adds no-threadsafe-statics to compiler flags for gcc and arcmwdt.

The flag is required to compile the samples - the module can compile
without it.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-20 20:59:45 -04:00
Lauren Murphy
09ba258b05 docs: rearrange toc
Fix index.rst and README.rst to put TensorFlow samples under
External Module samples next to Nanopb sample to avoid 4-level
indentation in the sidebar.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Lauren Murphy
14e6d1cf5d samples: add tensorflow magic wand sample train scripts
Adds training scripts to TensorFlow Magic Wand sample.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Lauren Murphy
83a036d738 samples: add tensorflow magic wand sample
Adds Tensorflow Magic Wand sample to tree.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Lauren Murphy
42e2a9ed21 samples: add tensorflow hello world sample train scripts
Adds training scripts to TensorFlow Hello World sample.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Lauren Murphy
cb4d28a066 samples: add tensorflow hello world sample
Adds Tensorflow Hello World sample to tree.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Pieter De Gendt
40c25b931d samples: modules: nanopb: fix encode buffer size
A bug was introduced when encoding/decoding moved to separate
functions where sizeof no longer had the correct argument.

The size of the encode buffer is passed to the encode function.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-04-14 14:45:26 -05:00
Pieter De Gendt
b6979736ca modules: nanopb: introduce new module
Add the nanopb library and generator tools as a module.
Nanopb is a small code-size Protocol Buffers implementation in ansi C.
It is especially suitable for use in microcontrollers,
but fits any memory restricted system.

Nanopb home: https://jpa.kapsi.fi/nanopb/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-04-08 14:57:55 +02:00