Unable to Use Only MOSI Line in SPI Configuration (Zephyr, WS2812)

I am using the Zephyr SPI driver to control a WS2812 LED strip through the SPI interface. Since only the MOSI line is required for communication, I want to configure the SPI interface to use only MOSI while leaving MISO and SCK unassigned, since I want to use them for other purposes.

When I manually assign MISO and SCK to arbitrary pins, everything works as expected. However, when I try to explicitly disconnect them using the following configuration:

            psels = <NRF_PSEL(SPIM_MOSI, 2, 8)>,
                    <NRF_PSEL_DISCONNECTED(SPIM_MISO)>,
                    <NRF_PSEL_DISCONNECTED(SPIM_SCK)>;

it results in the following error:

ASSERTION FAIL [nrf_gpio_pin_present_check(*p_pin)] @ WEST_TOPDIR/modules/hal/nordic/nrfx/hal/nrf_gpio.h:944

Questions:

  1. Is it possible to use only the MOSI line for SPI communication in Zephyr?

  2. If so, what is the correct way to configure SPI to disable MISO and SCK without causing an assertion failure?

Parents Reply Children
  • Is there any update on this?

    Update: I have verified that I can build on nrf54L15 under 3.2.1 without assertions after defining a spi with only the MOSI pin defined, so this check has apparently been corrected. Note however in my case that I am not disconnecting pins in the source code, but instead used a device tree overlay in my application to simply remove the other pins from the pinctrl routines, removing the unused NRF_PSEL mappings.

Related