SPI and UART configurations

Dear Customer Support,

Reaching out for help / example on couple peripheral configurations

We are using nRF Connect 2.5.0

1-UART

we have the following configuration

   uart1_default: uart1_default {
      group1 {
         psels = <NRF_PSEL(UART_TX, 0, 20)>,
                 <NRF_PSEL(UART_RTS, 0, 21)>;
      };
      group2 {
         psels = <NRF_PSEL(UART_RX, 0, 22)>,
                 <NRF_PSEL(UART_CTS, 0, 23)>;
         bias-pull-down;
      };
   };

we want to configure the TX line P0.20 to be OPEN_DRAIN

The way it is done today is by re-defining P0.20 in the .dts file as a GPIO, and that works

Wondering if they is a better way to embed to OPEN_DRAIN configuration within the uart1_default configuration

-SPI

we are trying to configure a pull down on the the MISO line

we currently use the following configuration

&spi1 {
   compatible = "nordic,nrf-spi";
   status = "okay";
   pinctrl-0 = <&spi1_default>;
   pinctrl-1 = <&spi1_sleep>;
   pinctrl-names = "default", "sleep";

we tried adding this property as documented here

https://docs.zephyrproject.org/2.5.0/reference/devicetree/bindings/nordic,nrf-spi.html?highlight=miso%20pull%20up

by adding this property

miso-pull-down

Unfortunately, we get this compile error

devicetree error: 'miso-pull-down' appears in /soc/spi@40004000 in C:/GitAV/AutoVentive/application/build_P1/zephyr/zephyr.dts.pre, but is not declared in 'properties:' in C:/GitAV/AutoVentive/external/zephyr/dts/bindings\spi\nordic,nrf-spi.yaml

Please advise how to proceed...

Thank you

Parents
  • https://docs.zephyrproject.org/2.5.0/reference/devicetree/bindings/nordic,nrf-spi.html?highlight=miso%20pull%20up

    by adding this property

    miso-pull-down

    Unfortunately, we get this compile error

    devicetree error: 'miso-pull-down' appears in /soc/spi@40004000 in C:/GitAV/AutoVentive/application/build_P1/zephyr/zephyr.dts.pre, but is not declared in 'properties:' in C:/GitAV/AutoVentive/external/zephyr/dts/bindings\spi\nordic,nrf-spi.yaml

    Please advise how to proceed...

    NCSv2.5.0 is not the same as Zephyr RTOS v2.5.0.

    As you can see in the west.yml file of nrf connect sdkv2.5.0 The zephyr version used is v3.4.99-ncs1(same as 3.5.0)

    - name: zephyr
          repo-path: sdk-zephyr
          revision: v3.4.99-ncs1
          import:

    And if you look at the documentation for nrf-spi in this version  you will see that you do not have this property anymore as things are done in pinctrl now.

    You can probably do this (untested and copied from other post)

    &spi1 {
        compatible = "nordic,nrf-spi";
        status = "okay";
        pinctrl-0 = <&spi1_default>;
        pinctrl-1 = <&spi1_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    pinctrl {
        spi1_default: spi1_default {
            group1 {
                psels = <NRF_PSEL(SPIM_SCK, PIN_SCK)>,  // not sure if you mentioned SPI pin numbers
                        <NRF_PSEL(SPIM_MOSI, PIN_MOSI)>,
                        <NRF_PSEL(SPIM_MISO, PIN_MISO)>;
                bias-pull-down; // Configure pull-down on pins
            };
        };
    
        spi1_sleep: spi1_sleep {
            group1 {
                psels = <NRF_PSEL(SPIM_SCK, PIN_SCK)>, 
                        <NRF_PSEL(SPIM_MOSI, PIN_MOSI)>, 
                        <NRF_PSEL(SPIM_MISO, PIN_MISO)>;
                bias-disable; 
            };
        };
    };

  • Ok, understood

    How about the first question on the UART configuration?

    we want to configure the TX line P0.20 to be OPEN_DRAIN

    Thank you

Reply Children
Related