Commit graph

10700 commits

Author SHA1 Message Date
Emil Gydesen
08b9ca4356 samples: Bluetooth: central_iso: Remove K_FOREVER for buf alloc
Allocating a buffer in the system workqueue thread should never
be done wiht a K_FOREVER as that may block the thread forever.

Replace the K_FOREVER with a K_NO_WAIT and slightly modified
the function to handle this case.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-06 17:01:34 +02:00
Erwan Gouriou
e4b03b79e6 samples: stm32: i2c_timing: Fix README header
Move sample README header to the new format designed for cross reference.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-07-04 18:00:16 +02:00
Alberto Escolar Piedras
1a1032de48 samples/net/dhcpv4_client: Exclude native_posix due to EVENTFD
EVENTFD is not anymore compatible with these targets so let's
disable them with this sample to avoid a failure in twister
otherwise.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-04 17:59:34 +02:00
Henrik Brix Andersen
ec601b89df doc: update documentation to use the --shield west build command arg
Update zephyr-app-commands to generate "west build --shield ..." for west
invocations using shields while still generating "cmake .. -DSHIELD=..."
if the tool is set to "cmake".

Updated the various shield documentation pages to recommend using
"--shields" over "-DSHIELD" to match the results of the corresponding
zephyr-app-commands code snippets.

Add proper support to zephyr-app-commands for specifying multiple shields
(using a comma-separated list) and fix a few invocations to use this.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-07-04 13:25:00 +02:00
Jeppe Odgaard
7e22942078 samples: modules: canopennode: add bootloader argument
The README "Testing CANopen Program Download" section needs a sysbuild
MCUboot option. Otherwise only the application is built and the test will
fail.

This has probably been missing since commit
238d113185.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-07-03 15:22:01 +02:00
Robert Lubos
71f668d1f3 samples: net: dhcpv4_client: Enable DNS in the sample
The DHCP server can distribute DNS addresses, hence enable DNS resolver
in the sample to show this functionality.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-02 14:17:16 +02:00
Robert Lubos
28ed03afc4 samples: net: dhcpv4_client: Replace example DHCP server with kea
Currently used DHCP server in the sample, dhcpd, is no longer maintained
and reached EOL. Therefore, update the sample's readme file with a
sample configuration for its successor, kea.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-02 14:17:16 +02:00
Sreeram Tatapudi
28b03b86b7 samples: bluetooth: Update samples to support cyw920829m2evk_02
Update bluetooth projects to support cyw920829m2evk_02 platform

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-07-02 09:35:33 +02:00
Gerson Fernando Budke
768b8bbca3 scripts: west robot & simulation: Fix OOT
The current version of scipts do not consider OOT boards use cases and
the tests with robot now are strict to only one robot file, which is
not realistic for real environment. This address those issues and allow
multiple testsuits at command line and lists at tests entries. It add
another test parameter to allow configure robotframework options.

Fixes: #74563

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2024-07-01 16:10:35 -04:00
Jukka Rissanen
c95f61f688 samples: net: txtime: Do not run qemu_x86 with twister
The txtime can be run manually with qemu_x86 but it is enough
to have native_sim compiled with twister.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-06-29 05:50:04 -04:00
Jukka Rissanen
ba88c50fb3 samples: net: txtime: Add e1000 overlay for qemu_x86
This allows user to run the sample in qemu_x86.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-06-29 05:50:04 -04:00
Jukka Rissanen
d9703934f1 samples: net: txtime: Add support for native_sim board
native_sim needs to enable PTP clock support

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-06-29 05:50:04 -04:00
Jukka Rissanen
d121e88390 samples: net: txtime: The option type should be int
When setting boolean options using setsockopt(), the option
type should be int as the size of the option type is checked
and only int is accepted.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-06-29 05:50:04 -04:00
Jamie McCrae
88f30f3f51 samples: Use DEFAULT_IMAGE for sysbuild
Uses the variable for the default image when adding sysbuild
dependencies so that they can be copied out-of-tree and still work

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-06-28 20:54:25 -04:00
Johann Fischer
88c2476136 samples: usb: mass: increase main stack size
"ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0" observed on a few
supported platforms when using SD card disk. Increase main stack size
for next USB device stack configuration to prevent stack overflow.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-28 20:54:01 -04:00
Sebastian Głąb
c6ef6941a3 samples: drivers: mbox: Extend mbox sample
Print on what board/core sample is executing.

Print how many bytes of data can be sent
in the mbox message (show use of mbox_mtu_get_dt()).

Print how many channels are available for incoming and/or
outgoing messages (show use of mbox_max_channels_get_dt()).

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-06-28 12:21:55 -04:00
Sebastian Głąb
92b0d6dda5 samples: drivers: mbox: Fix overlays for nrf54h20
Add sample configuration 'nrf54h20_app_ppr' where:
- cpuapp sends messages to cpuppr vevif channel 15,
- cpuppr sends messages to cpuapp bellboard channel 18.

Add sample configuration 'nrf54h20_rad_app' where:
- cpuapp sends messages to cpurad bellboard channel 12,
- cpurad sends messages to cpuapp bellboard channel 18.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-06-28 12:21:55 -04:00
Jordan Yates
08eab876d8 samples: tflite-micro: add REQUIRES_FLOAT_PRINTF
Add `CONFIG_REQUIRES_FLOAT_PRINTF=y` to tflite-micro samples as in the
past the module was using its own `printf` implementation, but now uses
our logging infrastructure.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-28 07:50:12 -04:00
Jordan Yates
91f8c1aea9 everywhere: replace #if IS_ENABLED() as per docs
Replace `#if IS_ENABLED()` with `#if defined()` as recommended by the
documentation of `IS_ENABLED`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-28 07:20:32 -04:00
Jordan Yates
cf870e8350 bluetooth: correct bt_le_scan_param scan type
The `type` parameter of `struct bt_le_scan_param` is documented as
taking a `BT_LE_SCAN_TYPE_*` value, not a `BT_HCI_LE_SCAN_*` value.

In practice this makes no difference as the values are defined as the
same integer, but does result in `<zephyr/bluetooth/hci.h>` not needing
to be included.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-28 11:34:36 +02:00
Robert Lubos
125f1f593e samples: net: zperf: Fix sample performance issues
Sockets service thread need to be cooperative for best performance.

Enable CACHE_MANAGEMENT as some boards don't do it by default, it has
devastating impact on the performance as well.

Finally, increase FDS count, so that uploads still work when both TCP
and UDP receiver are enabled.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-27 08:47:26 -04:00
Jordan Yates
243eb36b18 everywhere: reindent .overlay files with tabs
`checkpatch.pl` requires that dts sources are indented with tabs,
fix all the spaces that slipped in while checkpatch wasn't watching.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-26 15:59:44 +02:00
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