Enabling GPIO+SPI mode support for nRF21540 - v2.8.0

This page (v2.8.0) https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/nrf/app_dev/device_guides/fem/fem_nrf21540_gpio_spi.html

Suggests copying the following into devicetree.


&pinctrl {
    spi0_default_alt: spi0_default_alt {
       group1 {
          psels = <NRF_PSEL(SPI_SCK, 1, 15)>,
                  <NRF_PSEL(SPI_MISO, 1, 18)>,
                  <NRF_PSEL(SPI_MOSI, 1, 16)>;
       };
    };
 
    spi0_sleep_alt: spi0_sleep_alt {
       group1 {
          psels = <NRF_PSEL(SPI_SCK, 1, 15)>,
                  <NRF_PSEL(SPI_MISO, 1, 18)>,
                  <NRF_PSEL(SPI_MOSI, 1, 16)>;
          low-power-enable;
       };
    };
 };
 
However, I get this error:
note the following errors:
devicetree error: C:/ncs/v2.8.0/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts:138 (column 59): parse error: expected number or parenthesized expression
I can clear this error by changing SPI_CLK to SPIM_CLK etc...
This suggests I have a definition for SPIM_CLK but I am missing SPI_CLK
The prj.conf includes:
CONFIG_MPSL=y
CONFIG_FEM_AL_LIB=y
CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y

It seems that documentation for enabling FEM is not sufficiently comprehensive or accurate to support success in v2.8.0
Is there an example project with nrf FEM support which is tested?
note the dtsi file (whatever that is or does) for this board includes:
SPIM and that hasn't the error. It would seem that SPI_SCK is not defined without some additional CONFIG perhaps?
Or SPI should be SPIM perhaps?
Thank you
Parents
  • I upgraded to v2.9.0

    added to prj.conf:

    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y

    Added this to dts (This section throws an error - missing comma)

    / {
        nrf_radio_fem: name_of_fem_node {
           compatible  = "nordic,nrf21540-fem";
           tx-en-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
           rx-en-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
           pdn-gpios   = <&gpio0 15 GPIO_ACTIVE_HIGH>;
           spi-if = <&nrf_radio_fem_spi>  # *********** here is missing a comma or semicolon
     };
    };

    Added the remainder:

    -- Found BOARD.dts: C:/ncs/v2.9.0/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts
    devicetree error: C:/ncs/v2.9.0/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts:196 (column 59): parse error: expected number or parenthesized expression

    I also note here that if a Pristine Build fails - then there is no path to edit the dts files.

    I seems that the code offered on the support page has not been tested in v 2.9.0 as it throws a parsing error.

Reply
  • I upgraded to v2.9.0

    added to prj.conf:

    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y

    Added this to dts (This section throws an error - missing comma)

    / {
        nrf_radio_fem: name_of_fem_node {
           compatible  = "nordic,nrf21540-fem";
           tx-en-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
           rx-en-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
           pdn-gpios   = <&gpio0 15 GPIO_ACTIVE_HIGH>;
           spi-if = <&nrf_radio_fem_spi>  # *********** here is missing a comma or semicolon
     };
    };

    Added the remainder:

    -- Found BOARD.dts: C:/ncs/v2.9.0/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts
    devicetree error: C:/ncs/v2.9.0/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts:196 (column 59): parse error: expected number or parenthesized expression

    I also note here that if a Pristine Build fails - then there is no path to edit the dts files.

    I seems that the code offered on the support page has not been tested in v 2.9.0 as it throws a parsing error.

Children
No Data
Related