Commit Graph

89495 Commits

Author SHA1 Message Date
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
Alberto Escolar Piedras 572ba26b1f boards nrf5*_bsim: Provide more common headers
Provide some more common headers some nRF drivers
expect.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 14bc4aeec8 drivers uart_nrfx: Break infinite loops for simulation
While waiting for the UART to be ready in ISR
mode, for simulation only, add a tiny delay per
iteration of the busy wait loops to allow
time to pass.
This Z_SPIN_DELAY is an empty macro for any
other target than simulation.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 9a27906e38 drivers counter_nrfx_timer: Get peripheral address from HAL
Instead of getting the hardcoded address from the DT structure
use its symbolic name which will be resolved by the nRF HAL
definitions to the same value.

This allows the TIMER peripherals' addresses to be redefined
for the simulated targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 83af2d7f3c drivers counter nrfx: Fix ISR prototype
The ISR prototype is not matching the
signature for interrupt handlers, which results in
build warnings.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras efca307d35 drivers uart_nrfx: Correct pinctrl reg address for simulation
For simulation, we cannot get the UART regiter address
for the pinctrl config structure from DT, as that
cannot match the one allocated at build time.
So let's override it at runtime with the correct address
which is stored in the UART config structure.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 4efd08bfd8 drivers uart_nrfx: Get peripheral address from HAL
Instead of getting the hardcoded address from the DT structure
use its symbolic name which will be resolved by the nRF HAL
definitions to the same value.

This allows the GPIO peripherals' addresses to be redefined
for the simulated targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 5b993b070a drivers uart nrfx: Fix ISR prototype
The ISR prototype used when building without the
interrupt driven UART was not matching the
signature for interrupt handlers, which results in
build warnings.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Weiwei Guo eac50e318f drivers: intc_plic: fix plic PLIC_TRIG_LEVEL define mistake
Interrupt trigger type register each bit indicate the configured interrupt
type. bit value is 0 indicate level trigger interrupt, 1 indicate edge
trigger interrupt.

The level trigger defined to ~BIT(0) equal 0xfffffffe not equal 0.

Signed-off-by: Weiwei Guo <guoweiwei@syriusrobotics.com>
2024-01-10 10:01:23 +01:00
Abe Kohandel 83ca2a04a0 drivers: usb_dc_native_posix: do callback for ZLPs
A Zero Length Packet can be used by higher layer stack to discover when
an endpoint is being processed by the host. An example of this was
introduced as part of 0127d000a2 ("usb: device: cdc_acm: Use ZLP to
detect initial host read") in the CDC ACM class.

Not invoking the callback for ZLPs results in the higher layer stack not
being informed when the packet is consumed. This manifests as a CDC ACM
USB-IP device that cannot transmit to the host while being able to
receive from the host.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2024-01-10 10:01:14 +01:00
Benedikt Schmidt 70c8df7724 arch: arm: core: cortex_m: fix cache disabling in init_arch_hw_at_boot
Use the arch-cache functions instead of the sys-cache-functions
in z_arm_init_arch_hw_at_boot to ensure that the caches are
disabled even when CONFIG_CACHE_MANAGEMENT is disabled.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 10c0b86f83 soc: arm: use sys_cache* to enable caches for stm32f7 and stm32h7
Use sys_cache* functions to enable the caches for stm32f7 and
stm32h7. This ensures that CONFIG_CACHE_MANAGEMENT is
considered correctly.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 8b4516226b soc: arm: use sys_cache* for enabling the caches on same70 and samv71
Use the sys_cache* functions to enable the caches on same70 and
samv71. This will ensure that CONFIG_CACHE_MANAGEMENT is
considered correctly.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 2a2919946f arch: arc: use sys_cache instead of arch-function for enabling the cache
Use sys_cache_data_enable instead of arch_dcache_enable to enable
the cache. This will ensure that CONFIG_CACHE_MANAGEMENT
is considered correctly.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 1f1b430d88 soc: arm: remove redundant cache config options for kv5x
Remove the redundant cache config options for kv5x and use
the sys_cache* functions to enable the caches. This will automatically
consider CONFIG_CACHE_MANAGEMENT.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt d992683db5 soc: arm: replace redundant config option for caches for nxp_imx
Replace the redundant cache config options for the nxp_imx and
use sys_cache* functions to enable the caches. These will automatically
consider CONFIG_CACHE_MANAGEMENT.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 49d3244798 soc: arm: use sys_cache* for enabling the caches in nxp_s32
Use sys_cache* for enabling the caches in nxp_s32. This automatically
considers CONFIG_CACHE_MANAGEMENT and will activate the
cases only if this is active.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00