Commit graph

9378 commits

Author SHA1 Message Date
Marek Matej
cd8fc0eb11 samples: sysbuild: update list of platforms
Add ESP32 boards to test the MCUboot builds.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-06-26 09:01:25 -04:00
Abderrahmane Jarmouni
66e7bdde53 samples: drivers: counter: alarm: add stm32-rtc test case
A specific test case for STM32 RTC is needed because of the way Counter
node is selected in preprocessing.
Tests STM32 RTC_Alarm using counter_ll_stm32_rtc driver.
This also clarifies how STM32 RTC Alarm can be used in this test.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-06-26 06:01:18 -04:00
Luca Burelli
cec4be3a84 llext: rework test and sample coverage
This patch reworks the testcase.yaml and sample.yaml files for the llext
subsystem to further reduce the number of tests performed by CI while
improving overall coverage.

The following changes are introduced by this commit:

- Remove the arch_allow field from the common section to allow any arch
  to be tested in the build_only test. All other tests explicitly narrow
  down the arches they are applicable to.
- In addition to platforms with active issues, also exclude a number of
  platforms that are always skipped by the runtime filter due to
  RAM/Flash limitations.
- Add integration_platforms to limit the test count to a few selected
  platforms which are representative of the different arches.
- Remove a number of duplicate SLID tests and group them into a single
  test that covers both ARM and Xtensa architectures.
- Test the relocatable case on ARM as well.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-25 21:25:33 -04:00
Luca Burelli
6c5983492b llext: set proper LLEXT_STORAGE default for Xtensa
This patch sets the default value for LLEXT_STORAGE_WRITABLE to 'y' on
the Xtensa architecture. This is necessary because it does not currently
support the read-only mode for the LLEXT storage.

Make sure the default reflects this instead of asking the user to
manually set it.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-25 21:25:33 -04:00
David Leach
96aad48be0 samples: sensor: qdec: fix mimxrt1050_evk build failure.
Recent PR turned on test case for twister which revieled a bug
with building the test case for RT1050 EVK. The touch_controller
DTS node was removed a by commit 57ad325e and further deprecated
by bde07beb5 when the platform was converted to tread displays as
shields.

Signed-off-by: David Leach <david.leach@nxp.com>
2024-06-25 21:18:47 -04:00
Declan Snyder
3fe65eec7f samples: adc_dt: Move frdm_rw612 overlay to boards
The overlay was in the root of the sample folder instead of the boards
folder. This is clearly a mistake.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-25 19:13:15 -04:00
Robert Lubos
4ba53a6325 samples: net: sockets: echo_client/server: Remove duplicate configs
A few configs in prj.conf were duplicated, remove duplicates.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-25 14:15:16 -04:00
Robert Lubos
67187f620b samples: net: sockets: echo_client/server: Bump ZVFS_OPEN_MAX config
Recent POSIX changes caused that 3 file descriptors are now preallocated
for stdin/out/err. This caused file descriptor shortage in all-in TLS
configuration of the sample, hence increase the maximum FD count.

In the server sample this manifested itself as an accept() error. This
triggered a busy loop though in the sample, as in case of accept()
errors it'd just try again w/o any delay. This made this issue hard to
investigate, so to avoid such cases in the future, make the accept()
failure fatal in the echo_server sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-25 14:15:16 -04:00
Robert Lubos
fa27d706ea samples: net: sockets: echo_client/server: Bump DTLS max frag len
Echo samples exchange data fragments longer than the default DTLS max
fragment length introduced in commit
f033cd5601. Hence, need to increase this
config value for the sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-25 14:15:16 -04:00
Robert Lubos
9391ca9893 samples: net: sockets: echo_client: Bump NET_SOCKETS_POLL_MAX config
Commit 3046e95d85 introduced eventfd use
in the sample, increasing the pollfd array size, however the config
indicating maximum number of monitored events remained intact, so the
sample didn't really work.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-25 14:15:16 -04:00
Bjarki Arge Andreasen
9f867a1893 samples: net: cellular_modem: disable AT shell for NRF91_SLM
The NRF91_SLM has no additional AT channel for the AT shell to
use. This commit disables the AT shell for boards which use
the NRF91_SLM.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-06-25 12:18:40 -04:00
Chris Friedt
32d8326373 modules: thrift: update doc and cmake to build with macos
Added tabs to the thrift doc so that building works for macos
and is consistent with the rest of the documentation in terms
of one tab per os.

Updated client and server makefiles to discover include paths
for boost and openssl.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-25 10:26:28 -04:00
Robert Lubos
913b06251d samples: net: sockets: net_mgmt: Increase main thread priority
net_mgmt sockets do not implement internal queue but use
net_mgmt_event_wait() internally to receive events. As a consequence,
in case of events burst, some events may be lost if the receiving
thread has lower priority than the net_mgmt thread.

This was visible in the sample, where only DAD event was reported
properly, as IPv6 Add/Remove events were triggered in pair with
corresponding multicast events (from solicited-node multicast
address).

We can mitigate this by increasing main thread priority to be at the
same priority as net_mgmt thread, so that the receiving thread (main)
has a chance to run in between event reports.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-25 10:25:37 -04:00
Lingao Meng
302422ad9d everywhere: replace double words
import os
import re

common_words = set([
    'about', 'after', 'all', 'also', 'an', 'and',
     'any', 'are', 'as', 'at',
    'be', 'because', 'but', 'by', 'can', 'come',
    'could', 'day', 'do', 'even',
    'first', 'for', 'get', 'give', 'go', 'has',
    'have', 'he', 'her',
    'him', 'his', 'how', 'I', 'in', 'into', 'it',
    'its', 'just',
    'know', 'like', 'look', 'make', 'man', 'many',
    'me', 'more', 'my', 'new',
    'no', 'not', 'now', 'of', 'one', 'only', 'or',
    'other', 'our', 'out',
    'over', 'people', 'say', 'see', 'she', 'so',
    'some', 'take', 'tell', 'than',
    'their', 'them', 'then', 'there', 'these',
    'they', 'think',
    'this', 'time', 'two', 'up', 'use', 'very',
    'want', 'was', 'way',
    'we', 'well', 'what', 'when', 'which', 'who',
    'will', 'with', 'would',
    'year', 'you', 'your'
])

valid_extensions = set([
    'c', 'h', 'yaml', 'cmake', 'conf', 'txt', 'overlay',
    'rst', 'dtsi',
    'Kconfig', 'dts', 'defconfig', 'yml', 'ld', 'sh', 'py',
    'soc', 'cfg'
])

def filter_repeated_words(text):
    # Split the text into lines
    lines = text.split('\n')

    # Combine lines into a single string with unique separator
    combined_text = '/*sep*/'.join(lines)

    # Replace repeated words within a line
    def replace_within_line(match):
        return match.group(1)

    # Regex for matching repeated words within a line
    within_line_pattern =
	re.compile(r'\b(' +
		'|'.join(map(re.escape, common_words)) +
		r')\b\s+\b\1\b')
    combined_text = within_line_pattern.
		sub(replace_within_line, combined_text)

    # Replace repeated words across line boundaries
    def replace_across_lines(match):
        return match.group(1) + match.group(2)

    # Regex for matching repeated words across line boundaries
    across_lines_pattern = re.
		compile(r'\b(' + '|'.join(
			map(re.escape, common_words)) +
			r')\b(\s*[*\/\n\s]*)\b\1\b')
    combined_text = across_lines_pattern.
		sub(replace_across_lines, combined_text)

    # Split the text back into lines
    filtered_text = combined_text.split('/*sep*/')

    return '\n'.join(filtered_text)

def process_file(file_path):
    with open(file_path, 'r', encoding='utf-8') as file:
        text = file.read()

    new_text = filter_repeated_words(text)

    with open(file_path, 'w', encoding='utf-8') as file:
        file.write(new_text)

def process_directory(directory_path):
    for root, dirs, files in os.walk(directory_path):
        dirs[:] = [d for d in dirs if not d.startswith('.')]
        for file in files:
            # Filter out hidden files
            if file.startswith('.'):
                continue
            file_extension = file.split('.')[-1]
            if
	file_extension in valid_extensions:  # 只处理指定后缀的文件
                file_path = os.path.join(root, file)
                print(f"Processed file: {file_path}")
                process_file(file_path)

directory_to_process = "/home/mi/works/github/zephyrproject/zephyr"
process_directory(directory_to_process)

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-06-25 06:05:35 -04:00
Francois Ramu
e0c25089e3 samples: drivers spi_flash on the external NORof stm32h5 disco kit
Define the configuration to run the test on the external memory
xspi flash of the stm32h573i_dk disco kit in MemoryMapped Mode
Reading is done with memcopy and erase/write are aborting operation
to send the appropriate command

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-24 12:45:34 -04:00
Francois Ramu
2f0dd2c66f samples: code relocation in external memory of stm32h5 disco kit
Define the configuration to run the code_relocation
application on the external memory xspi flash
of the stm32h573i_dk disco kit in XIP

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-24 12:45:34 -04:00
Lyle Zhu
2d89be6702 Sample: bluetooth: add mimxrt1040_evk support
Enable mimxrt1040_evk for handsfree and
handsfree_ag samples.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-06-24 12:44:49 -04:00
Piotr Kosycarz
6898f93e48 samples: sensor: qdec: verify position value
At least for nrf boards, the emulation timer settings generate
reading around -60 degrees. Verify that value with some threshold.

Delay the first reading to prevent 0 at the beginning.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-24 12:43:25 -04:00
Piotr Kosycarz
456fed3bc3 samples: sensor: qdec: align pins for nrf boards
To match used loopbacks.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-24 12:43:25 -04:00
Robert Lubos
ca322ec3d4 samples: net: sockets: big_http_download: Fix build with TLS enabled
After enabled POSIX_API in the sample, not all headers were included in
the build due to #ifdefs around header inclusions. This commit fixes
this.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-24 12:42:16 -04:00
Robert Lubos
bed98044e3 samples: net: tftp_client: Bump main thread stack size
The sample was crashing due to stack overflow on the main thread.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-24 12:42:16 -04:00
Robert Lubos
648b3db443 samples: net: telnet: Bump IPv6 mcast address count
The multicast IPv6 address count was too low to create all
solicited-node multicast address, resulting in an error being
printed on boot:

  Cannot join solicit node address ff02::1:ff00:1 for 1 (-12)

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-24 12:42:16 -04:00
Robert Lubos
c8ce949ec7 samples: net: stats: Update project configuration
Fix two issues with the current configuration:
* The log buffer was too small for the sample, causing part of the stats
  printout to be dropped
* The sample set CONFIG_NET_CONFIG_NEED_IPV4 but did not actually set
  any IPv4 address, nor enable DHCP, causing the NET_CONFIG
  initialization failure.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-24 12:42:16 -04:00
Robert Lubos
63a5d26877 samples: net: mdns_responder: Bump CONFIG_NET_SOCKETS_POLL_MAX
Socket service library threw an error, the configured value was too
low for it to work.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-24 12:42:16 -04:00
Robert Lubos
65d9bf1ed7 samples: net: lwm2m_client: Bump IPv6 mcast address count
The multicast IPv6 address count was too low to create all
solicited-node multicast address, resulting in an error being
printed on boot:

  Cannot join solicit node address ff02::1:ff00:1 for 1 (-12)

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-24 12:42:16 -04:00
Lingao Meng
f6480db986 samples: bluetooth: Fixes bt_hci_cmd_send_sync API usage
If func:`bt_hci_cmd_send_sync` return no-zero value, indicate
that `cmd(buf)->status` not zero, in this condition, rsp not
to assign anything, so remove it.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-06-24 14:26:22 +02:00
Jordan Yates
07870934e3 everywhere: replace double words
Treewide search and replace on a range of double word combinations:
    * `the the`
    * `to to`
    * `if if`
    * `that that`
    * `on on`
    * `is is`
    * `from from`

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-22 05:40:22 -04:00
Katarzyna Giądła
bf6ba17655 samples: sensor: sensor_shell: Extend timeout for pytest tests
The test `sample.sensor.shell.pytest` fails althought the output
is correct. Time to execution is not enough.
This change extend test execution timeout.

Signed-off-by: Katarzyna Giądła <katarzyna.giadla@nordicsemi.no>
2024-06-21 15:26:07 -04:00
Mathieu Choplain
8e7b0c4af3 samples: llext: modules: increase stack size
This commit increases the size of the main stack for the LLEXT sample
subsys/llext/modules, which otherwise overflows the stack on several
platforms.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-06-21 14:56:27 -04:00
Gerson Fernando Budke
e6d8ed2e0d samples: sensor: qdec: Fix wrong harness
The #73619 which fixes the atmel,sam-tc-qdec sensor implementation
introduced agregression on the sample test removing the harness
console. That changed the test to use the default ztest behaviour
which is incompatible with the test outpout. This restore the
harness to the default console value.

Fixes: #74531

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-06-21 14:55:12 -04:00
Fabian Blatz
a2833ab2cf samples: subsys: display: lvgl: Remove kscan pointer check
Removes the check for whether or not the kscan kconfig option is set to
change the GUI accordingly.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-06-21 11:54:11 -04:00
Erwan Gouriou
94f7a60d3b samples: stm32: serial_wakeup: Enable fifo
Uart FIFO is useful in case of wakeup on serial as it will allow
to avoid losing chars.
Enable it systematically on all overlays for this sample.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-06-21 08:44:54 -04:00
Robert Lubos
bd4469aa79 samples: net: dns_resolve: Increase socket-related configs
Current NET_SOCKETS_POLL_MAX and ZVFS_OPEN_MAX values were too low for
the sample after the DNS refactoring, making the sample unusable in
current state.

Bump those values accordingly to make the sample functional again.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-21 08:44:29 -04:00
Benjamin Cabé
a8573a985c doc: fix incorrect bullet lists
ReStructuredText bullet lists should be preceded by an empty
line

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-20 14:07:32 -04:00
Benjamin Cabé
3c3627b968 samples: net: vlan: improve README formatting
simple tweaks to improve HTML rendering of the
vLAN README

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-20 14:07:32 -04:00
Benjamin Cabé
dea2bcb214 samples: net: tftp: doc: formatting/spelling clean up
misc fixes to ensure proper formatting and spelling of the
TFTP sample README

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-20 14:07:32 -04:00
Benjamin Cabé
f6d0383a97 samples: net: http_server: use proper language in code-block
Achieve proper syntax highlighting using "console"
language when command snippets start with a prompt.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-20 14:07:32 -04:00
Benjamin Cabé
bd73073708 doc: samples: net: mqtt: improve formatting
use code literal formatting for KConfig identifiers

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-20 14:07:32 -04:00
Benjamin Cabé
f6db733f4a doc: samples: userspace: add cross reference to C functions
use :c:func:  role to cross reference the function mentioned
in the README

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-20 14:07:32 -04:00
Benjamin Cabé
ee820206ef doc: samples: logging: add reference to Kconfig
use kconfig:option role to properly cross reference the Kconfig
mentioned in the README

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-20 14:07:32 -04:00
Benjamin Cabé
e04cdb0d2f doc: usb: samples: improve commands formatting
use code literal formatting for commands in RST file

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-20 14:07:32 -04:00
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
Aleksandr Khromykh
3cf219fb97 Bluetooth: Mesh: align mesh and host psa usage
Commit aligns usage mesh and host PSA.
Since PSA crypto is supported in host then
there is no reason to switch off some of host
features to get rid of tinycrypt functions in
the final image.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2024-06-19 13:24:08 -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
Johann Fischer
7e123084e2 doc: usb: document USB message notifications
Add documentation about USB message notifications. Use literalinclude to
pull code snippets from the samples.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-18 19:56:54 -04:00
Swift Tian
beef60df65 samples: tests: dts: mspi: update ambiq specific MSPI dts
Updated apollo3p_evb overlay files for MSPI peripheral devices.

Signed-off-by: Swift Tian <swift-tian@qq.com>
2024-06-18 19:55:35 -04:00
Yong Cong Sin
67578faefe lib: cpp: remove deprecated Kconfigs
These Kconfigs should have been deprecated for more than 2
releases, remove them:

- `CONFIG_CPP_MAIN`
- `CONFIG_CPLUSPLUS`
- `CONFIG_LIB_CPLUSPLUS`
- `CONFIG_EXCEPTIONS`
- `CONFIG_RTTI`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Yong Cong Sin
1899e4f667 bluetooth: remove CONFIG_BT_DEBUG_LOG
`CONFIG_BT_DEBUG_LOG` has been deprecated for more than 2
releases, replace it with `CONFIG_BT` + `CONFIG_LOG`:

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Ivan Iushkov
0b71206054 bluetooth: samples: Add missing option to hci_uart_async sample
hci_uart_async/debug.mixin.conf is used to enable RTT logging
for hci_uart_async sample. RTT can be used to avoid conflict
between different serial interfaces because the sample uses
UART as an interface for HCI communication.
RTT_CONSOLE option enabled in the debug.mixin.conf depends on
CONFIG_USE_SEGGER_RTT so enabling CONFIG_USE_SEGGER_RTT by
default makes it easier to build the project with RTT enabled

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2024-06-18 11:05:50 +02:00
Rodrigo Peixoto
6ec617340f samples: zbus: add isolated pool to msg_sub sample
Add isolated pool (static and dynamic) to the sample illustrating how to
use that and performing some testing in different scenarios.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-06-17 21:20:05 -04:00
Gerson Fernando Budke
0561d74d31 drivers: counter: sam: Add qdec as tc special mode
The current atmel,sam-tc-qdec sensor implementation shared the timer
counter node. This create issues when users wants define both modes.
The current proposal changes the qdec dedinition to be a child of
tc and refactor all the chain of definitions.

Fixes #71312

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-06-17 17:47:42 -04:00
Piotr Kosycarz
83958eb937 samples: sysbuild: hello_world: add testing base on console
Extend automated testing on HW by veryfing console output.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-17 15:30:14 +02:00
Adam Berlinger
3dabe035c7 samples: boards: stm32: Add example for STOP3 mode on STM32U5
Simple blinky example, but using STOP3 mode. When in STOP3 mode,
GPIOs are not driven, but only pull-up or pull-down can be enabled
based on value in PWR registers.

Signed-off-by: Adam Berlinger <adam.berlinger@st.com>
2024-06-15 04:44:26 -04:00
Jakub Zymelka
2cb0a07a63 samples: ipc: icmsg: Align icmsg sample for nRF54L15
Add nRF54L15 APP and FLPR cores to icmsg sample application.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-06-15 04:41:47 -04:00
Jakub Zymelka
bd40190c25 samples: mbox: Add nRF54L15 to MBOX sample targets
Add nRF54L15 APP and FLPR cores to ping-pong sample application.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-06-15 04:41:47 -04:00
Swift Tian
0b9430169e samples: mspi: Add a mspi async sample
The sample is added to demonstrate mspi_transceive asynchronously.
Apollo3 MSPI controller has hardware command queue and supports
scatter IO and callback management, so no additional software queue
is required.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
5dfdf2bc05 samples: mspi: Add a mspi flash sample
The sample code is copied from spi_flash. To flash API, there is no
difference if the bus is spi or mspi.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
efdddd46b1 samples: memc: Add APS6404L device to memc example
Demo the usage of APS6404L device driver in memc example.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Bartlomiej Buczek
79f4f2ac31 samples: drivers: adc: Allow coverage calculation.
Sample must end to dump coverage data.

Signed-off-by: Bartlomiej Buczek <bartlomiej.buczek@nordicsemi.no>
2024-06-14 17:08:52 -04:00
Tomi Fontanilles
703e5258eb mgmt: updatehub: replace TinyCrypt by PSA
As part of ongoing work to move away from TinyCrypt and towards PSA
(#43712), introduce a PSA option and remove the TinyCrypt one for the
SHA-256 implementation.

The Mbed TLS implementation is modified to use `mbedtls_sha256`
directly for smaller code size.

The reliance of mgmt/updatehub on storage/flash_map's configuration
(`FLASH_AREA_CHECK_INTEGRITY_BACKEND`) is removed.
The choice of which implementation to use is made automatically,
based on whether a PSA API provider is present (`PSA_CRYPTO_CLIENT`).

This commit also add a test case with PSA (based on Mbed TLS)
in samples/subsys/mgmt/updatehub/sample.yaml.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-14 14:02:08 -04:00
Francois Ramu
298bf49048 samples: sensor: dht_polling run sample on sensor present
Add a fixture to run the sample only when the DHT sensor
HX330x is present (shield) on the nucleo_f40re board
'fixture_i2c_hs300x'
The stm32f401 Nucleo board itself has no sensor mounted

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 14:01:41 -04:00
Chris Friedt
156eaab70e posix: move ioctl() from fdtable to posix
The ioctl() call should be a part of the _XOPEN_STREAMS
Option in posix, so move it there.

Create a zephyr-native zvfs_ioctl() in the layer below.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Francois Ramu
0b83a9b18c samples: subsys: task_wdt on the IWDG of the stm32f4
Run the sample on the IWDG of stm32f4 nucleo boards
instead of WWDG because the APB1 prescaler cannot set
the WWDG input clock source to match the wd timeout.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 19:34:58 +02:00
Luca Burelli
57011e4c1a llext: add a "modules" Kconfig tristate example
This adds a new sample to demonstrate the use of tristate symbols
in Kconfig to build a function as an llext module or as a built-in
part of Zephyr.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-14 19:24:51 +02:00
Phi Bang Nguyen
727f04b159 samples: video: capture: Add support for i.MX RT1170 EVK
Add support for i.MX RT1170 EVK

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-06-14 19:20:08 +02:00
Phi Bang Nguyen
831f5f6ba6 samples: video: capture: Display captured frames on screen
Improve the sample application by displaying the captured frames instead
of just discarding them.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-06-14 19:20:08 +02:00
Phi Bang Nguyen
0ecbd0b9c9 samples: video: capture: Use a chosen node for camera
In order to be generic, use a chosen node for camera so that the sample
is not specific to NXP SoCs. Also, always favorite a real video device
unless it is unavailable.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-06-14 19:20:08 +02:00
Phi Bang Nguyen
553f527a49 samples: video: capture: Enhance logs readability
There are some compatibilty situations where carriage return does not
work (e.g. on Serial Monitor in VSCode). Moreover, keeping the
timestamps logs on the console would help to have an idea about the
frame rate. So, it's better to use line feed instead of carriage return
in this case.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-06-14 19:20:08 +02:00
Phi Bang Nguyen
ee3347a9f3 samples: video: capture: Run clang-format
Run clang-format on the file before making any changes

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-06-14 19:20:08 +02:00
Phi Bang Nguyen
96d8330d9b samples: video: capture: Update documents and tests
The mt9m114 camera shield is now added. There are also some changes in
the mt9m114 camera driver, e.g. frame rate, default format, capabilities.
Update the sample document and test to reflect these changes.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-06-14 19:20:08 +02:00
Johann Fischer
8739efe0fc doc: usb: add initial USB device configuraiton howto
Add initial documentation how to configure and enable new USB device
support. Use literalinclude to pull code snippets from the samples.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 19:17:13 +02:00
Johann Fischer
cf2113e437 samples: usb: rework common code to use usbd_register_all_classes()
Rework common USB samples code to use usbd_register_all_classes().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 19:17:13 +02:00
Piotr Kosycarz
3222f378ab samples: subsys: ipc: ipc_service: check console output
Verify host console.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-14 19:14:38 +02:00
Piotr Kosycarz
45aca35650 samples: subsys: logging: multidomain: check console output on HW
Verify host console.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-14 19:14:13 +02:00
Vinayak Kariappa Chettimada
d9171df773 samples: Bluetooth: peripheral_hr restart advertising on disconnect
Restart legacy advertising on ACL disconnect similar to when
using extended advertising in this sample.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-06-14 19:13:19 +02:00
Sebastian Głąb
48fc6877e4 samples: drivers: adc: adc_sequence: Enable test execution on nrf54h20
Add overlay file for nrf54h20 cpuapp target.
Add nrf54h20 target to platform_allow.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-06-14 15:36:17 +02:00
Sebastian Głąb
cc9bd6d77e samples: drivers: adc: adc_dt: Add nrf54h20 to platform_allow
Enable test execution on nrf54h20dk.
Overlay file already exists.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-06-14 15:36:17 +02:00
Piotr Kosycarz
1b3725e099 samples: sensor: accel_polling: Allow coverage calculation
Sample must end to dump coverage data.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-14 15:35:17 +02:00
Piotr Kosycarz
e63c691a86 samples: sensor: bme680: Allow coverage calculation
Sample must end to dump coverage data.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-14 15:35:02 +02:00
Jens Rehhoff Thomsen
ab9fd0b5c9 Bluetooth: BAP: Add bt_bap_base_get_size function
bt_bap_base_get_size function returns the size of the BASE.

Fixes #73847

Signed-off-by: Jens Rehhoff Thomsen <jthm@demant.com>
2024-06-14 15:34:23 +02:00
Johann Fischer
94f48c7a78 samples: debug: add CMSIS DAP sample using USB as interface
Add CMSIS DAP sample using USB as interface.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Jeppe Odgaard
b1f2eb9a11 samples: drivers: adc: add nucleo_h563zi
Add Nucleo H563ZI board support to ADC sample.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-06-13 20:46:44 -04:00
Emil Gydesen
2690cacf65 samples: Bluetooth: CAP: Add missing argument to get_chan_allocation
The sample was missing a argument to the function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-13 16:58:37 -04:00
Johann Fischer
0dc1414237 samples: usb: remove hid-cdc sample
We have some other simpler CDC ACM and HID samples in the tree.
Providing multiple functions is a core functionality of USB device
support, and we have other samples to demonstrate this as well. This
sample does not really provide anything unique, but has a few issues
such as unsafe HID buffer handling and calling uart_fifo_fill() outside
of the UART driver's IRQ context.
Remove the hid-cdc sample, as there is no value in this sample, and to
avoid spending time fixing and cleaning up the code.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-13 16:47:22 -04:00
Declan Snyder
e902a08832 boards: frdm_rw612: Simple enablements collection
A collection of simple enablements to match some of the enablement
done for rd_rw612_bga as closely as possible on the frdm_rw612 board.

- i2c
- spi
- dma
- mrt
- ctimer
- os timer
- dac
- adc
- trng (alread was enabled but now listed support)
- watchdog

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-13 16:44:12 -04:00
Mark Wang
1fabbe01f5 samples: usb: enable next usb device stack samples on NXP platforms
enable next usb device stack samples (cdc_acm, mass and shell)
on rt685 and mimxrt1060_evk

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-06-13 17:59:31 +02:00
Luis Ubieda
253de6c7a2 samples: shell: shell_module: Add README
With basic description of registering different types of Shell commands.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-06-13 17:57:36 +02:00
Emil Gydesen
c07a87abbb tests: Bluetooth: Audio: Add BSIM test of the CAP samples
Adds babblesim tests of the CAP Acceptor and the CAP Initiator
samples for unicast.

This simply checks if at least one stream is connected
and is sending (empty) data.

This modifies the samples to send data as well as counting the
receive ISO data packets.
Ideally the TX would be superflous to verify that ISO is working,
but a missing feature in the Zephyr LL makes it a requirement.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-13 17:56:58 +02:00
Emil Gydesen
daf7d8066a Samples: Bluetooth: Add CAP acceptor unicast sample
Adds a CAP acceptor unicast sample that simply
uses the CAP acceptor implementation to setup
streams with a CAP initiator.

To keep it simple no audio or encoding support
has been added.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-13 17:56:58 +02:00
Emil Gydesen
a712315793 Samples: Bluetooth: Add CAP initiator unicast sample
Adds a CAP initiator unicast sample that simply
uses the CAP initiator unicast API to setup
streams with a CAP acceptor.

To keep it simple no audio or encoding support
has been added.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-13 17:56:58 +02:00
Abderrahmane Jarmouni
ed95cd9ab3 samples: boards: stm32: no need to configure button pin
The gpio pin that will be used as a source for PWR wake-up pins does not
actually need to be configured as input, hence input_gpio_keys driver does
not need to be involved. As far as GPIO controller is concerned, the pin
can be in analog state.

Also, it's clearer & safer to call gpio_pin_configure_dt directly in the
application with the STM32_GPIO_WKUP flag, just before calling Poweroff,
instead of relying on a driver, like input_gpio_keys to do it just after
boot behind the scenes, & risk not having the correct wake-up pins config
when Poweroff is finally called.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-06-13 17:51:43 +02:00
Francois Ramu
df788d0b41 samples: drivers: flash_shell does not run on stm32h745/m4 boards
Do not run the samples/drivers/flash_shell application on the
stm32h745i_disco//m4 as the flash controller is not supported yet
on the M4 core (only M7). Just like the nucleo stm32h745//m4
is excluded.
Also exclude stm32h7rs disco at the moment (still TODO).

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-13 08:23:16 -04:00
Fabio Baltieri
2c5b09cbda usb: device_next: rename the rate properties to use the correct unit
The polling properties are a period in us but are named as "-rate" right
now, which would imply that that's a frequency. Rename them to
"period-us" to make that unambiguous.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-06-13 08:03:49 -04:00
Lyle Zhu
c4df21e8bd Samples: bluetooth: hf_ag: Add board specific configuration
Overlay sram when BT is enabled on board MIMXRT1170 EVKB.

Select NXP NW612 chipset for Handsfree_ag example

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-06-13 05:45:36 -04:00
Lyle Zhu
79e1b48ab1 Samples: bluetooth: hf: Add board specific configuration
Overlay sram when BT is enabled on board MIMXRT1170 EVKB.

Select NXP NW612 chipset.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-06-13 05:45:36 -04:00
Emil Gydesen
c6cc034b5c Bluetooth: Audio: Add fallback to get_chan_allocation
Added a fallback parameter to
bt_audio_codec_cfg_get_chan_allocation as absence of
channel allocation in BAP implicitly means Mono.
In the case that it is absent,
BT_AUDIO_LOCATION_MONO_AUDIO is the returned value.

This commit also fixes the implementation of
bt_audio_codec_cfg_get_frame_blocks_per_sdu as it only applies to
LC3 (as per the BAP spec). It also adds additional testing of it

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-13 05:41:47 -04:00
Adam Wojasinski
3684294a64 samples: net: ptp: Add sample for PTP
This application demonstrates PTP functionality

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-06-13 05:40:41 -04:00
Tom Burdick
98b26c6ca8 rtio: Remove builtin iodev mpsc queue
I/O Devices were meant to be handles of sorts and had a built in mpsc queue
as this made sense initially. As time has gone on it turned out that often
we wanted the mpsc queue to be an implementation detail hidden in a driver.
In fact pretty much all drivers work this way now.

Keeping the struct mpsc queue as a member of rtio_iodev meant wasted memory
in cases where it wasn't used. It also meant a bit of confusion as the
queue might be accidently used in places where it shouldn't be.

Remove the mpsc queue member from struct rtio_iodev and the last remaining
usages of it. Will ensure RTIO for 3.7 LTS avoids causing unneeded churn
for future users.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-06-12 21:12:54 -04:00
Daniel DeGrasse
9f4c849ac0 samples: add rt1064 to display samples with shield
Add RT1064 EVK to platform-allow list for display sample tests with
RK043* based shields.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-06-12 18:18:39 -04:00
Daniel DeGrasse
d27a352ac1 samples: add rt1040 to display samples with shield
Add RT1040 EVK to platform-allow list for display sample tests with
RK043* based shields.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-06-12 18:18:15 -04:00