Commit Graph

89511 Commits

Author SHA1 Message Date
David Leach d33f8c7f27 drivers: i2c: i2c_mcux_lpi2c: fix unused variable warning
With commit 1d7476af, it fixed a build error with config
structure no longer having a base address field but left
the local variable defined. This resulted in a build warning
of an unused variable 'config' in two places.

Signed-off-by: David Leach <david.leach@nxp.com>
2024-01-10 09:22:54 -06:00
Daniel Leung 78790a85aa tests: net: lwm2m_engine: workaround stack overflow on qemu_x86
When running on qemu_x86, the test test_socket_state failed on
stack overflow. Setting CONFIG_TEST_EXTRA_STACK_SIZE to 1024
seems to fix the issue. So add a board specific config for
qemu_x86 so this test would pass.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-01-10 10:09:18 -05:00
Lukasz Mrugala 23b3e5741e scripts: tests: Removal of straggling folders
Current blacbox tests leave two folders,
OUT_DIR and TEST_DIR after they are finished.
Unit tests create two further folders,
mock_testsuite and demo_board_2.
This change deletes them appropriately.

Additionally, the created twister-out* folders in blackbox tests are
moved to a temp directory and removed after every test.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-01-10 09:23:06 -05:00
Gerson Fernando Budke b8188e54a4 kernel: Implement k_sleep for Single Thread
The current z_tick_sleep return directly when building kernel for Single
Thread model. This reorganize the code to use k_busy_wait() to be time
coherent since subsystems may depend on it.

In the case of a K_FOREVER timeout is selected the Single Thread the
implementation will invoke k_cpu_idle() and the system will wait for
an interrupt saving power.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2024-01-10 15:10:16 +01:00
James Zipperer 273165c3bb usb: device: audio: fix compiler warning for usb audio microphone
audio_receive_cb is only used by headphones and headset, it is unused in
microphone-only configurations.  Gate compilation based on the device
tree.

Signed-off-by: James Zipperer <jzipperer@fb.com>
2024-01-10 15:08:06 +01:00
James Zipperer 975208209b usb: device: audio options for polling-interval and sample-rate-hz
These descriptor values can now be configured via the device tree

Signed-off-by: James Zipperer <jzipperer@fb.com>
2024-01-10 15:08:06 +01:00
James Zipperer 21c9c4abfe drivers: usb: device: add start of frame notifications to nxp mcux driver
When usb middleware sends a start of frame notification to this driver,
call status_cb with USB_DC_SOF.

Signed-off-by: James Zipperer <jzipperer@fb.com>
2024-01-10 15:08:06 +01:00
James Zipperer 2b91d62c0e modules: hal_nxp: usb: enable sof notifications
When building with CONFIG_USB_DEVICE_AUDIO, enable start of frame
notifications from the mcux sdk usb middleware

Signed-off-by: James Zipperer <jzipperer@fb.com>
2024-01-10 15:08:06 +01:00
Ali Hozhabri a87a42dec7 drivers: bluetooth: hci: Add support for ST Proprietary extended event
Add support for handling ST Proprietary extended event.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-01-10 15:07:36 +01:00
Ali Hozhabri af76d061f8 boards: arm: Update dts files for ST BlueNRG-based boards
Update dts files to use ST vendor specific HCI SPI Bluetooth driver.

Remove unnecessary GPIO bias for output pins.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-01-10 15:07:36 +01:00
Ali Hozhabri 8b8be3c7aa drivers: bluetooth: hci: Remove ST vendor code from spi.c
Remove ST vendor code from spi.c.

Update CMakeLists to select ST vendor file for ST BlueNRG devices.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-01-10 15:07:36 +01:00
Ali Hozhabri 98d6dbf787 drivers: bluetooth: hci: Add Bluetooth driver for ST HCI SPI protocol
Copy ST specific SPI protocol code from spi.c to a vendor specific file.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-01-10 15:07:36 +01:00
Ali Hozhabri f74c14537a dts: bindings: bluetooth: Include zephyr,bt-hci-spi.yaml
Include zephyr,bt-hci-spi.yaml in both ST HCI SPI yaml files.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-01-10 15:07:36 +01:00
Gerard Marull-Paretas 5b3dd2288e boards: gd32f403z_eval: remove redundant Kconfig
Board does not have any init code, so BOARD_INIT_PRIORITY is redundant.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-10 15:05:54 +01:00
Gerard Marull-Paretas d4838ed57e boards: gd32f450i_eval: remove unused Kconfig
Board no longer has init code.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-10 15:05:54 +01:00
Gerard Marull-Paretas ba52701630 drivers: counter: gd32: depend on !SOC_SERIES_GD32VF103
Because SOC_FAMILY_GD32_ARM is going to be dropped soon.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-10 15:05:54 +01:00
Gerard Marull-Paretas 81dbe94a16 boards: gd32*: reduce board image file size
Some GD32 board pictures exceed the maximum allowed limit (100K), so
reduce them.

Automated using `cwebp path/to/board.jpg -o path/to/board.webp`

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-10 15:05:54 +01:00
Gerard Marull-Paretas 067f32731e modules: hal_gigadevice: use CONFIG_${ARCH} to select components
Instead of using custom SoC definitions. The selected components (e.g.
CMSIS), depend on the architecture selected by the SoC Kconfig options.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-10 15:05:54 +01:00
Fabio Baltieri bd8cee8683 drivers: input: add an analog-axis driver
Add an input driver to read data from an analog device, such as a
thumbstick, connected to an ADC channel, and report it as an input
device.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-10 15:05:35 +01:00
Nicolas Pitre e5b3231354 tests: posix: semaphore: assorted adjustments
- Adjust refcount checks with regards to previous commit.

- Remove redundant zassert_not_null() on local pointers after a
  sem_close(). There is no implicit reference passing in C.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-01-10 07:18:19 -05:00
Nicolas Pitre cf74f22524 posix: semaphore: optimize named semaphore implementation a bit
- Regroup refcount decrement and semaphore destruction by making the
  linked state into a counted reference for it. This allows for
  simplifying the code and cleanly adding a few assertions in a common
  location.

- Remove redundant initialization to NULL on memory about to be freed
  and local pointer in nsem_cleanup().

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-01-10 07:18:19 -05:00
Yong Cong Sin b8662b97f2 tests: posix: semaphore: run normal semaphore test with named semaphore
Run the normal semaphore test with a named semaphore.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-10 07:18:19 -05:00
Yong Cong Sin 3bfcf123a7 tests: posix: semaphore: refactor `test_semaphore`
Localize a few public variables and refactor the test and
functions so that they are reusable.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-10 07:18:19 -05:00
Yong Cong Sin 9016cec150 doc: posix: mark `sem_open`, `sem_close` & `sem_unlink` as supported
The `sem_open()`, `sem_close()` & `sem_unlink()` functions are
now implemented, so mark them as supported.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-10 07:18:19 -05:00
Yong Cong Sin abb21d48d9 posix: semaphore: implement `sem_open()`, `sem_unlink()` & `sem_close()`
Implements `sem_open()`, `sem_unlink()` & `sem_close()`
functions and added tests for them.

Updated existing tests and POSIX docs.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-10 07:18:19 -05:00
Yong Cong Sin 25b0083ee9 MAINTAINERS: add myself as a POSIX collaborator
Add myself as a collaborator in the POSIX subsystem.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-10 07:18:19 -05:00
Piotr Golyzniak a27ae686d3 tests: bsim: add testcase.yaml to bsim bis test
For better manageability of tests building, add possibility to build
BabbleSim Bluetooth BIS tests by Twister.

Signed-off-by: Piotr Golyzniak <metody159@gmail.com>
2024-01-10 12:10:58 +01:00
Piotr Golyzniak 8831aa60eb scripts: twister: add copying of bsim exe
To make possible to build bsim tests by Twister, it is necessary to
copy executables to BabbleSim bin directory.

Signed-off-by: Piotr Golyzniak <metody159@gmail.com>
2024-01-10 12:10:58 +01:00
TOKITA Hiroshi 665d216b6f samples: drivers: led_ws2812: add configure for adafruit_kb2040
Add configuration to use PIO driver for adafruit_kb2040.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-01-10 12:10:36 +01:00
TOKITA Hiroshi 4266a7e17a boards: arm: adafruit_kb2040: add led-strip configuration
Adafruit KB2040 has one NeoPixel(WS2812) LED that
attaches to GPIO17 pin.
Add configuration for it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-01-10 12:10:36 +01:00
TOKITA Hiroshi 6699d4d4f9 drivers: led_strip: add rpi_pico's PIO based ws2812 driver
Add driver that based on RPI-PICO's PIO feature for ws2812.

This driver can handle WS2812 or compatible LED strips.
The single PIO node can handle up to 4 strips.
Any pins that can be configured for PIO can be used for strips.

I verified the samples/driver/led_ws2812 sample
working with WS2812(144 pcs) led strip using following patches.

- samples/drivers/led_ws2812/boards/rpi_pico.overlay

```
/ {
        aliases {
                led-strip = &ws2812;
        };
};

&pinctrl {
        ws2812_pio0_default: ws2812_pio0_default {
                ws2812 {
                        pinmux = <PIO0_P21>;
                };
        };
};

&pio0 {
        status = "okay";

        pio-ws2812 {
                compatible = "worldsemi,ws2812-rpi_pico-pio";
                status = "okay";
                pinctrl-0 = <&ws2812_pio0_default>;
                pinctrl-names = "default";
                bit-waveform = <3>, <3>, <4>;

                ws2812: ws2812 {
                        status = "okay";
                        output-pin = <21>;
                        chain-length = <144>;
                        color-mapping = <LED_COLOR_ID_GREEN
                                         LED_COLOR_ID_RED
                                         LED_COLOR_ID_BLUE>;
                        reset-delay = <280>;
                        frequency = <800000>;
                };
        };
};

```

- samples/drivers/led_ws2812/boards/rpi_pico.conf

```
CONFIG_WS2812_STRIP_RPI_PICO_PIO=y
```

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-01-10 12:10:36 +01:00
Jukka Rissanen b0dd9a2980 doc: net: ppp: Fix the point-to-point documentation
The ppp doc was still referring to gsm-modem sample which
is no longer there. Also removed old information that is no
longer relevant.

Fixes #67171

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-10 12:06:19 +01:00
Shane Snover e49d174be9 driver: usb: change function parameter name from class to base_class.
Change function parameter name in function usbd_device_set_code_triple
from `class` to `base_class` as `class` is a keyword in C++.

Signed-off-by: Shane Snover <ssnover95@gmail.com>
2024-01-10 11:08:11 +01:00
Maximilian Huber 47e4728604 doc: add note that some versions of displays are not supported
This adds a hint that for stm32h747i_disco just some display shields are
supported.

Signed-off-by: Maximilian Huber <gh@maxhbr.de>
Co-authored-by: Benjamin Cabé <kartben@gmail.com>
2024-01-10 11:07:41 +01:00
Lukasz Madej 1ed51885d3 drivers: mfd: mfd_ad5592: fix reset magic sending
Use proper register mask for software reset register so
reset magic value sent to device is not malformed.

Co-authored-by: Bartosz Bilas <b.bilas@grinn-global.com>
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
2024-01-10 10:01:52 +01:00
Lukasz Madej c69ddc1018 drivers: mfd: mfd_ad5592: fix typo
Fix a typo in `AD5592_REG_VAL_MASK` macro name.

Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
2024-01-10 10:01:52 +01:00
Lukasz Madej a5b467646a drivers: mfd: mfd_ad9952: fix reset magic value
Reset magic value equal 0xDAC is invalid. According to device
specification [1] a valid value is 0x5AC.
Use proper value to make driver aligned with the spec.

[1] https://www.analog.com/media/en/technical-documentation/data-sheets/ad5592r.pdf

Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
2024-01-10 10:01:52 +01:00
Jamie McCrae 7e07ea0435 west.yml: MCUboot synchronization from upstream
Update Zephyr fork of MCUboot to revision:
  b994ba2ce29425587957dcbb6c96d4e1872b5737

Brings following Zephyr relevant fixes:
 - 4d75fc8e bootutil: Fix compatible sector checking
 - 35e9931c bootutil: Add debug logging for boot status write
 - db9a7f58 boot: zephyr: cmake: Fix issue with missing dts
   entries
 - 8cee3550 zephyr: kconfig: make MBEDTLS_PROMPTLESS depend on
   MBEDTLS

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-01-10 10:01:43 +01:00
Alberto Escolar Piedras 892e8ef47a tests/drivers uart_async_*: Provide overlays for nrf52_bsim
For uart_async_api, uart_mix_fifo_poll & uart_pm:
These test can be run fine in the simulated nrf52_bsim board,
just connecting the UART Tx and Rx in loopback,
but we need an overlay just like for the real boards.
Let's provide it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras c7d179f895 tests/drivers uart_async_api: Fix build error with host gcc
For some reason the host gcc (11 & 12) does not believe
rx_buf_size is constant. Let's work around it by using the
sizeof() expression it is initialized to instead.

This fixes a build error when targetting native targets
which use the host gcc:

tests/drivers/uart/uart_async_api/src/test_uart_async.c:236:34:
error: expression in static assertion is not constant
  236 |         BUILD_ASSERT(rx_buf_size <=
  sizeof(tdata.rx_first_buffer), "Invalid buf size");

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 37f26174ea tests/drivers uart_async_rx: Fix for integration_platforms
The test was actually filtered out in the integration platforms
(native_sim) as SERIAL was not enabled in its prj.conf
and that is not enabled by default for this target.
Let's just enable it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras bd9836be8c subsys logging: Enable native backend if possible
Let's always enable the native_posix backend even
if the serial is used.
Both can be used at the same time, and:
a) users expect the logger output in the invoking shell even if they
enable the UART
b) Since printk is routed to the logger twister actually needs it
for tests to pass as for native platforms it looks into the stdout
of the process.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 009fcd70e5 tests bsim bt: Add basic connection test with HCI UART async controllers
Add a basic connection test between two devices,
in which the controllers are in separate nrf52_bsim devices
connected over UART to the devices running the host+app.
The controllers are running the HCI UART async sample.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 398e4b121a tests bsim bt: Add basic connection test with HCI UART controllers
Add a basic connection test between two devices,
in which the controllers are in separate nrf52_bsim devices
connected over UART to the devices running the host+app.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 2f25cd5851 boards nrf52_bsim docs: UART is now supported
Add the UART to the list of supported peripherals

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 0aa0bc9af0 boards nrf*bsim: Move common kconfig selection to common place
Reduce a bit the amount of boilerplate by placing common
Kconfig selections in common options.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 6fee105b1d boards nrf52_bsim: Provide default UART configuration
Provide a good enough UART configuration, but do not
select it as backend by default, let apps do that.

The UART and its driver are very heavy compared to
other backends it may replace, so let's avoid
enabling it by default.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 0bdf943900 boards nrf*_bsim: Do not use the UART for logging by default
Even if the UART is enabled, let's not use it by default,
in this platform, as this UART is not meant for user
interaction, but to connect other devices
(for ex. BT controller).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras f84ef2d6ee boards nrf5*_bsim: Allow using the UART
Now the HW models include the UART(E) models.
So let's allow selecting it, but let's
not default to it, or enable it by default,
as it is only in very rare cases uses will want it,
and some may already be using the native ptty
instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 85d3ad1117 manifest: Update nrf hw models to latest
* Update the HW models module to
c744f2c762aad79e59bd7e99002f2fcab0a2f288

Including the following:
* docs: UART: several minor fixes
* UART(E): Add peripherals and connect to (D)PPI

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00