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
  • Hi Oleksander,

    There was this limitation that the SCK pin needs to be connected in the nrf52 series where it states: "The SCK must always be connected to a pin, and that pin's input buffer must always be connected for the SPI to work." See here: https://docs.nordicsemi.com/bundle/ps_nrf52832/page/spi.html#d945e156 

    We will need to check if this is still a limitation on the nRF54L15 SPIM since the zephyr driver still enforces this limitation as of this day. If it is not, then the Zephyr driver can be updated to remove this limitation.. I will heck internally and get back to you with the updates.

    Best Regards,

    Swathy 

  • 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.

Reply
  • 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.

Children
No Data
Related