Commit graph

24 commits

Author SHA1 Message Date
Benjamin Cabé
b4b623c26c doc: use proper pygment for .conf code-blocks
config file snippets should use "cfg" pygment to get proper highlighting
This commit updates all occurences where "kconfig" or other languages
were used.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-20 14:07:32 -04:00
Daniel Mangum
d216a281d8 samples: tflite-micro: fix link to original magic_wand samples
Fixes link to magic_wand sample, which was removed from the tflite-micro
repository.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2024-06-18 20:00:41 -04:00
Torsten Rasmussen
4879681b7e cmake: remove stray overlay file from target sources
An overlay file was wrongly added to a target_sources call, this has
now been corrected.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-04-05 21:54:12 -05:00
Lauren Murphy
d0ae602cef tflite-micro: update README to pull optional module
tflite-micro is an optional module now, and needs to be
pulled for the sample to build.

Fixes #69942.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2024-03-19 14:31:15 -04:00
Gerard Marull-Paretas
1d128f13b6 samples: modules: tflite-micro: remove incorrect check
sensor cannot be null because it is initialized with DEVICE_DT_GET_ONE,
which always resolves to a device. The deleted check triggered a
compiler warning ("warning: the address of '__device_dts_ord_23' will
never be NULL").

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-18 12:09:53 +00:00
Keith Packard
1e5c46df3d samples: Switch from NEWLIB_LIBC to REQUIRES_FULL_LIBC
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF and adjust
CONFIG_LIBC_MALLOC_ARENA_SIZE as needed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-25 08:32:06 +02:00
Ryan McClelland
65a15e9299 samples: tflite-micro: update samples for latest tflite-micro
tflite-micro now uses MicroPrintf instead of MicroErrorReporter. Update
the samples to use this function instead. AllOpsResolver is now removed
from tflite-micro. AllOpsResolver was also removed in the latest
tflite-micro. Use MicroMutableOpResolver and only include the kernels
used instead.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-09-25 09:46:33 +02: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
Gaël PORTAY
419dda3ed7 samples: fix path to tensorflow lite micro examples
The samples under the tensorflow modules directory has been renamed
since commit 6fd1b02496. However, the path
in their README.rst was not updated.

Additionnaly, the modules top directory under the samples is missing for
the samples magic_wand and tflm_ethosu.

This fixes the path to the tensorflow lite micro samples in their
README.rst.

Signed-off-by: Gaël PORTAY <gael.portay@rtone.fr>
2023-03-06 16:08:55 -06:00
Jamie McCrae
ec7044437e treewide: Disable automatic argparse argument shortening
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>
2023-01-26 20:12:36 +09:00
Stephanos Ioannidis
cf211aa7af treewide: Update deprecated CONFIG_LIB_CPLUSPLUS usages
This commit updates all deprecated `CONFIG_LIB_CPLUSPLUS` usages to:

* check if the Zephyr minimal C++ library is enabled using
  `CONFIG_MINIMAL_LIBCPP` instead of relying on the
  `CONFIG_LIB_CPLUSPLUS`-based inference.

* select `CONFIG_REQUIRES_FULL_LIBCPP` when there exists a component-
  level C++ standard library dependency. This allows a component to
  declare C++ standard library dependency without designating a
  specific libray implementation.

* select the correct type of C++ standard library implementation to use
  through one of the `CONFIG_LIBCPP_IMPLEMENTATION` choices.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Stephanos Ioannidis
4a64bfe351 treewide: Use CONFIG_CPP instead of CONFIG_CPLUSPLUS
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>
2023-01-13 17:42:55 -05: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
Gerard Marull-Paretas
cb448591ed samples: modules: tflite-micro: magic_wand: add missing CONFIG_I2C=y
The magic_want sample requires I2C bus to be enabled (used sensor is
connected to the bus).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +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
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
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
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
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
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