Commit graph

8689 commits

Author SHA1 Message Date
Christopher Friedt dd33a8152a samples: philosophers: remove redundant items in prj.conf
The normal and posix philosophers samples seemed to have
a number of redundant choices in prj.conf.

Let's reduce to the minimum required for the sample. The
CONFIG_DEBUG_THREAD_INFO option is part of the
documentation, so leave it as-is.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-01 05:26:24 -05:00
Christopher Friedt 842fdbdea6 samples: posix: philosophers: fix off-by-one error
The number of forks should match the number of philophers, and
that is encoded via NUM_PHIL.

Change the build assert to match.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-01 05:26:24 -05:00
Christopher Friedt 9122e8530f samples: posix: philosophers: minor spacing corrections
Fix spacing and wrapping in the README.rst file.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-01 05:26:24 -05:00
Christopher Friedt 52b619cd2b samples: philosophers correct misspelled introduction tag
The tag 'introduction' was misspelled 'inroduction'.

Correct it both the samples/philosophers and the
samples/posix/philosophers directories.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-01 05:26:24 -05:00
Christopher Friedt 855b8bc6ca posix: separate shell utilities and posix api implementation
Previously, the POSIX shell utilities were intermixed with the
POSIX API implementation.

The POSIX shell utilities only depend on the public POSIX API,
so it makes sense to keep them in a separate subdirectory.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-01 05:26:24 -05:00
Daniel DeGrasse b83d8b0707 samples: drivers: jesd216: support NXP FlexSPI NOR driver
Support NXP FlexSPI nor driver with jesd216 sample.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-01 10:57:35 +01:00
Fredrik Danebjer c948f831e0 Bluetooth samples: Add USB Audio to Broadcast Sink sample
Added USB Audio output for the Broadcast Sink sample. In addition
offloading of the LC3 codec was also made. The sample supports only
mono, and a KConfig option was added to configure which audio
location to sync to.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2024-02-01 10:55:24 +01:00
Lars Knudsen b77df76e98 samples: Add Broadcast Assistant sample
First version of Broadcast Assistant sample
with hard coded selection of sink and source.

Signed-off-by: Lars Knudsen <LAKD@demant.com>
2024-02-01 10:54:56 +01:00
Emil Gydesen 01d0f1a566 Bluetooth: PBP: Fix parsing and return issue with bt_pbp_parse_announcement
bt_pbp_parse_announcement was defined as uint8_t return value function,
but returned errno values, so it was modified to return an int instead.
The return values are also now more granular and documented.

The function also triggered a coverity issue with the way that it
parsed the data->data, as it would be marked as tainted. This should
be fixed by using the net_buf_simple API, which also improves on
some other parts of the code.

Finally the meta argument for the function was changed from an
unknown sized buffer, where the caller somehow had to know the
size of the metadata before calling the parsing function, to
an output pointer. This also omits the requirement for the
caller to always copy the metadata, where now it just
gets a pointer to the metadata in the bt_data struct. The application
can now always decide whether to continue to parse the metadata or
to copy it, using the pointer and the return value of the function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:33:56 -05:00
Armando Visconti e26cd0ba91 sample/shield: x-nucleo-iks01a3: add support to lis2de12 on DIL24
The x-nucleo-iks01a3 shield is equipped with a DIL24 socket where
different compatible sensors may fit. This commit add support to
lis2de12 on DIL24 in such a way that, if sensor is not present, test
would just skip it and proceed. Other sensors may be added in future.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-01-31 15:39:45 +01:00
Magdalena Pastula 361a5a11aa samples: add overlay files for nRF54L15
Add nRF54L15 overlays to samples that needed them.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Andriy Gelman c7dab3df08 drivers: can: Add xmc4xxx CAN support
Adds CAN drivers for XMC4xxx SoCs.

XMC4xxx has multiple CAN nodes. The nodes share a common clock and
a message object pool.

The CAN nodes do not have a loopback mode. Instead there is an
internal bus which can be used to exchange messages between
nodes on the SoC. For this reason tests/samples which rely on the
loopback feature have been disabled.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-01-30 19:06:06 +01:00
Navinkumar Balabakthan 6a8d011c65 samples: drivers: Added Nand Test Application
Nand Test Application has added in sample/drivers folder.

Signed-off-by: Navinkumar Balabakthan <navinkumar.balabakthan@intel.com>
2024-01-30 18:01:31 +01:00
Guillaume Gautier 05712250ea samples: boards: stm32: pm: suspend_to_ram: add wba standby sample
Add a sample for STM32WBA standby power management.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-30 18:01:00 +01:00
Joel Guittet 017b01659f samples: subsys: display: lvgl: add wio_terminal board
Add Wio Terminal configuration to the LVGL sample with button and
keypad overlay.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2024-01-30 10:35:32 -06:00
Abderrahmane Jarmouni 43b2f00c84 samples: modules: lvgl: demos: add test case for stm32h747i_disco
Add a test case for stm32h747i_disco that comes with a display shield.
This will make it easier to catch LVGL regressions on this board.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-01-30 10:27:57 -06:00
Abderrahmane Jarmouni 47f9ee405d samples: subsys: display: lvgl: add test case for stm32h747i_disco
Add a test case for stm32h747i_disco that comes with a display shield.
This will make it easier to catch LVGL regressions on this board.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-01-30 10:27:57 -06:00
Abderrahmane Jarmouni b4191dd67e samples: drivers: display: add a general test case
Add a test case for boards that have a supported built-in display that is
enabled by default in DTS. This will make it easier to catch display
regressions on these boards in CI.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-01-30 10:27:57 -06:00
Martin Jäger 60c58fe918 samples: subsys: lorawan: class_a: add multicast support
This is mainly to make sure that the multicast code is built in CI.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-01-30 14:14:05 +00:00
Wilfried Chauveau e840c9af01 samples: subsys: rpmsg_service improve terminology
Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
Co-authored-by: Jamie <40387179+nordicjm@users.noreply.github.com>
2024-01-30 13:42:02 +01:00
Wilfried Chauveau f875cb6cc9 samples: subsys: ipc: switch rpmsg to sysbuild
rpmsg_service only loads the main application on the target. Switch to
sysbuild which is know to work as expected with the openamp sample.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-01-30 13:42:02 +01:00
Lars Knudsen a3c4d22e79 boards: bbc_microbit_v2: Add buzzer
Tie pwm1 to buzzer pin and adjust sample.

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
2024-01-30 13:08:03 +01:00
Emil Gydesen 515ef17915 Bluetooth: Audio: Change samples and shell to use sinf
Change the samples and shell to use sinf instead of sin,
as that return the expect float data type, instead of
a double.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-30 12:45:26 +01:00
Daniel DeGrasse 8596ee9337 samples: drivers: i2s: add output sample
Add simple I2S output sample. This sample is verified with the RT1060
EVKB, but can be ported to any board with I2S support. It simply
demonstrates how to write I2S output data using the I2S API. The output
can be verified using a signal analyzer, if the user desires.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-29 10:59:24 +00:00
Christopher Friedt 248324b67a samples: posix: implement philosphers using pthreads
This sample takes a POSIX-y spin on the existing
Dining Philosophers sample application. The objects
used in the POSIX version are pthread_mutex_t, and
the threads are pthread_t.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-28 13:01:36 -05:00
Attie Grande cf14d4f1fd samples: drivers: uart: Add a 'passthrough' example
This sample can be used as a "virtual wire", allowing direct access to
devices connected to the target processor - for example: GPS, Cellular,
etc...

This is also useful as a utility - no other connectivity options exist
for UART, where other interfaces like SPI and I2C have shell commands.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2024-01-27 15:33:29 +01:00
Seppo Takalo 53705c062e samples: lwm2m: Clarify DTLS settings
Clarify some documentation regarding DTLS settings.
Set default QUEUE uptime to 30s, which would be same as
most cellular networks use, and  nRF SDK use.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-01-26 12:00:51 -06:00
Seppo Takalo 2deb3d5b0c samples: lwm2m: Set default bootstrap URI
Don't rely on just port number to select a bootstrap server.
Use full URI.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-01-26 12:00:51 -06:00
Daniel DeGrasse 664e710b1c samples: net: zperf: relocate stack to RAM for iMX RT boards
Relocate network stack to RAM for iMX RT boards when running the zperf
sample. Relocating the network stack to ITCM greatly improves
performance on these platforms.

Also, remove overlays for the RT1050 and RT1060 setting the system timer
to systick. This is no longer required as this is the default timer for
these boards.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-26 12:57:02 +01:00
Daniel DeGrasse 68952095a5 samples: net: zperf: allow networking code to be relocated to RAM
Enable relocation of key networking stack functions to RAM when running
the zperf example. This will enable better performance on platforms with
fast code RAM.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-26 12:57:02 +01:00
Declan Snyder dcedb649ca drivers: nxp_enet: Fix build error with PTP on
Fix build errors in nxp enet driver during case where PTP on,
and add coverage to CI.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-01-25 19:32:02 -05:00
Armando Visconti 9f1c256e46 samples/shields: add samples to test x-nucleo-iks4a1 shield
Provide three basic examples to test the x-nucleo-iks4a1 shield:

    - Test shield in standard mode
        Acquire sensor data from shield with all MEMS sensors connected
        to micro-controller

    - Test shield in HUB1 mode
        Acquire sensor data from shield with lis2mdl and lps22df
        connected to LSM6DSV16X sensor hub

    - Test shield in HUB2 mode
        Acquire sensor data from shield with lis2mdl and lps22df
        connected to LSm6DSO16IS sensor hub

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-01-25 18:26:40 +00:00
Hang Fan b3d2891e16 Bluetooth: Classic: Add support for class of device
Add `CONFIG_BT_COD` for class of device.

< HCI Command: Write Class of Device (0x03|0x0024) plen 3
        Class: 0x200408
          Major class: Audio/Video (headset, speaker, stereo, video, vcr)
          Minor class: Hands-free Device
          Audio (Speaker, Microphone, Headset)
> HCI Event: Command Complete (0x0e) plen 4
      Write Class of Device (0x03|0x0024) ncmd 1
        Status: Success (0x00)

Signed-off-by: Hang Fan <fanhang8@gmail.com>
2024-01-25 15:09:01 +00:00
Christopher Friedt 2236e57e42 samples: thrift: update doc to include optional modules
Update the Thrift sample to include instructions on
fetching optional modules. Without this, user builds
will fail.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-24 19:35:33 -05:00
Luca Burelli 92a5e3ace7 llext: rework testcases to share common config
This patch reworks the YAML files for the llext samples and tests to
share a common restriction list. Also, using an arch-specific config
to disable the MPU for the ARM architecture only, there is no need
to duplicate the test cases per architecture.

Use this to enable the "writable" test case for the ARM architecture
and separate the "modules_enabled" case to test building as a module.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-24 10:44:48 +01:00
Tom Burdick e69ce68d40 sensing: Fix initializer compile-time constant
Initializers must be compile time constants (not expressions!) for clang
to be happy. Clang rightfully pointed out that the callback_list member
of sensing_connection was being initialized using an expression that was
not compile-time constant.

The macros passed along a pointer created by taking the address of a
global constant and then at initialization time attempting to
dereference it using the * operator. So in the end the compiler has
identifier its trying to first take the address of and then later
dereference in an initializer. Clang didn't appreciate this, though gcc
seemed to be just fine.

Actually clang 17 might work just fine with this as well, but clang 16
(the clang I tried) didn't like it at all.

Instead store the pointer to the callback list rather than copying the
struct. This could be done the other way and not passing a
pointer through the macros perhaps.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-01-24 10:32:10 +01:00
Zhang Lixu f5595b4b9c sensing: support multiple sensor types in one device
Many sensors have multiple functions, for example, icm42688 supports
accel, gyro and temperature, and the sensor streaming api always mixes
the multiple functions in one function call. So we need add a layer in
sensing subsystem to dispatch the result returned from sensor streaming
api for each function.
I changed the sensor-type(int) to sensor-types(array) in sensing sensor
device bindings, so that one device can map to multiple instances of
sensing sensor.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
2024-01-24 10:32:10 +01:00
Zhang Lixu 91774cb0eb samples: sensing: add more sample code
1. add sensing_set_config/sensing_get_config in sample code
2. add hinge_angle sensor in sample code.

Build and test:
  west build -p -b native_sim samples/subsys/sensing/simple/ -t run

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
2024-01-24 10:32:10 +01:00
Guangfu Hu b9b714c8bd sensing: refine sensing API
1) move variable shift behind struct sensing_sensor_value_header in
struct sensing_sensor_value_q31
2) add pointer checking for sensing API
3) add context sensing_callback_list and sensing_data_event_t
4) add macro SENSING_SENSITIVITY_INDEX_ALL
5) rename zephyr,sensing-phy-3d-sensor.yaml

Signed-off-by: Guangfu Hu <guangfu.hu@intel.com>
2024-01-24 10:32:10 +01:00
Christopher Friedt 8556ae5afe samples: posix: change Subsystem to API
The POSIX API in Zephyr is considered more of a library than a
Subsystem.

Adjust the samples doc to reflect that.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-23 10:03:13 +00:00
Christopher Friedt f6373d6918 samples: portability: link to posix samples
POSIX API Samples live in another directory, but they should
still be easy to find from Portability Samples.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-23 10:03:13 +00:00
Sean Madigan a9a3b808e8 samples: bluetooth: iso_receive: Allow syncing any subevent number
When using softdevice controller on iso_broadcast sample, the BIG
created uses more than 1 subevent. This means that when you try to
use the iso_receive sample to sync it does not work.

So update the sample to use mse=0 and allow any number of subevents,
making the sample more flexible and work with SDC without any changes.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2024-01-23 10:02:26 +01:00
Sylvio Alves ce1be0e121 boards: esp32xx: decrease Wi-Fi minimum heap size
Decrease total RAM usage when Wi-Fi is enabled, specially after
`config HEAP_MEM_POOL_ADD_SIZE_BOARD` was added. This allows application
to handle additional HEAP as required.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-01-22 12:59:23 +01:00
Tomas Galbicka e776051cad samples: mbox: Add mbox sample with data transfer
This commits add mbox sample which supports transfering of
4 bytes of data between cores.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2024-01-22 09:48:09 +00:00
Henrik Brix Andersen 3436c93387 drivers: can: remove run-time RTR filtering, add build-time RTR filter
A growing number of CAN controllers do not have support for individual RX
hardware filters based on the Remote Transmission Request (RTR) bit. This
leads to various work-arounds on the driver level mixing hardware and
software filtering.

As the use of RTR frames is discouraged by CAN in Automation (CiA) - and
not even supported by newer standards, e.g. CAN FD - this often leads to
unnecessary overhead, added complexity, and worst-case to non-portable
behavior between various CAN controller drivers.

Instead, move to a simpler approach where the ability to accept/reject RTR
frames is globally configured via Kconfig. By default, all incoming RTR
frames are rejected at the driver level, a setting which can be supported
in hardware by most in-tree CAN controllers drivers.

Legacy applications or protocol implementations, where RTR reception is
required, can now select CONFIG_CAN_ACCEPT_RTR to accept incoming RTR
frames matching added CAN filters. These applications or protocols will
need to distinguish between RTR and data frames in their respective CAN RX
frame handling routines.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-21 11:00:31 +01:00
Doug Foster 9fe370ef36 samples: doc: Added/Updated README and Makefile for POSIX samples
Added README.rst for eventfd and uname samples. Updated README for
gettimeofday to align with other READMEs.Updated Makefile.host
file for samples to store output file in 'build' directory.

Signed-off-by: Doug Foster <dougwfost@gmail.com>
2024-01-19 10:32:23 +01:00
Jukka Rissanen 1dc8249fcd samples: net: zperf: Increase the polled fd count
We need more polled fd count so that socket services work ok.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-18 20:13:31 +01: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
Ian Wakely 715dc68b22 boards: Enabling neopixel on Adafruit Qt Py RP2040
Using the recently added WS2812 PIO driver, this enables the LED on the
QT PY to work with the built in RGB LED examples.

Signed-off-by: Ian Wakely <raveious.irw@gmail.com>
2024-01-18 10:54:55 +01:00
Yong Cong Sin 2cd0265f7e samples: posix: uname: add Makefile to compile on POSIX OS
Previously the sample was using some headers that aren't
available to the host, now we can add a `Makefile.host` to
compile the example on a POSIX OS like Linux:

```
# Go to the sample dir
cd ${ZEPHYR_BASE}/samples/posix/uname

# Compile the sample
make -f Makefile.host

# Run the binary
./build/uname

sysname[65]: Linux
nodename[65]: LAPTOP-YC
release[65]: 5.10.16.3-microsoft-standard-WSL2
version[65]: #1 SMP Fri Apr 2 22:23:49 UTC 2021
machine[65]: x86_64
```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:32 +01:00