nRF54l15 Custom Board & nRF21540 FEM & nRF7001 GPIOTE error

      • We designed a nRF54L15 custom board with a nRF21540 FEM and nRF7001 Module which are on the same SPI with separate CS pins our device tree is configured for this as follows:

            wifi_coex: nrf7001_coex {
                compatible = "nordic,nrf7001-coex";
                status = "okay";
                req-gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>;
                status0-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
                grant-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
                swctrl1-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
            };

            nrf_radio_fem: nrf21540_fem {
                compatible = "nordic,nrf21540-fem";
                status = "okay";
                tx-en-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
                rx-en-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
                pdn-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
                mode-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
                spi-if = <&nrf21540_spi>;
                supply-voltage-mv = <3300>;  
            };

        &spi21 {
            status = "okay";
            cs-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>,
            <&gpio2 10 GPIO_ACTIVE_LOW>;
            pinctrl-0 = <&spi21_default>;
            pinctrl-1 = <&spi21_sleep>;
            pinctrl-names = "default", "sleep";

            nrf21540_spi: nrf21540-spi@0 {
                compatible = "nordic,nrf21540-fem-spi";
                status = "okay";
                reg = <0>;
                spi-max-frequency = <8000000>;
            };

            nrf70: wifi@1 {
                status = "okay";
                compatible = "nordic,nrf7001-spi";
                reg = <1>;
                spi-max-frequency = <8000000>;
                iovdd-ctrl-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
                bucken-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
                host-irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
                iovdd-power-up-delay-ms = <1>;

                /*
                 * TODO: replace with your certified/custom-board TX power ceilings.
                 * These are placeholder values commonly used in public nRF70 examples.
                 */
                wifi-max-tx-pwr-2g-dsss = <21>;
                wifi-max-tx-pwr-2g-mcs0 = <16>;
                wifi-max-tx-pwr-2g-mcs7 = <16>;

                nrf70_wlan: nrf70_wlan {
                    compatible = "nordic,wlan";
                    status = "okay";
                };
            };


        This configuration compiles however when I switched the SPI reg and CS pins as shown below I got GPIOTE error also show below.

        Do both the CS pins also need to be on GPIO port 1 with RADIO DFE functionality?

        Or is there a reason that the nRF21540 has to be the first SPI Index or not on a shared SPI?

        Why does swapping the index on the SPI bus affect this?


        NOT working configuration (Other Configurations unchanged):


        &spi21 {
            status = "okay";
            cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>,
            <&gpio1 13 GPIO_ACTIVE_LOW>;
            pinctrl-0 = <&spi21_default>;
            pinctrl-1 = <&spi21_sleep>;
            pinctrl-names = "default", "sleep";

            nrf70: wifi@1 {
                status = "okay";
                compatible = "nordic,nrf7001-spi";
                reg = <0>;
                spi-max-frequency = <8000000>;
                iovdd-ctrl-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
                bucken-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
                host-irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
                iovdd-power-up-delay-ms = <1>;

                /*
                 * TODO: replace with your certified/custom-board TX power ceilings.
                 * These are placeholder values commonly used in public nRF70 examples.
                 */
                wifi-max-tx-pwr-2g-dsss = <21>;
                wifi-max-tx-pwr-2g-mcs0 = <16>;
                wifi-max-tx-pwr-2g-mcs7 = <16>;

                nrf70_wlan: nrf70_wlan {
                    compatible = "nordic,wlan";
                    status = "okay";
                };
            };

            nrf21540_spi: nrf21540-spi@0 {
                compatible = "nordic,nrf21540-fem-spi";
                status = "okay";
                reg = <1>;
                spi-max-frequency = <8000000>;
            };


        };


        Error resulting from this configuration:

        C:/ncs/v3.2.4/nrf/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c: In function 'fem_nrf21540_spi_configure':
        c:\ncs\v3.2.4\zephyr\soc\nordic\common\gpiote_nrfx.h:11:45: error: 'g_nrfx_gpioteDT_N_S_soc_S_peripheral_50000000_S_gpio_50400_P_gpiote_instance_IDX_0_PH_REG_IDX_0_VAL_ADDRESSU' undeclared (first use in this function)
        11 | #define GPIOTE_NRFX_INST_BY_REG_CONCAT(reg) g_nrfx_gpiote##reg

        Note:
        We are using SDK and toolchain 3.2.4 

Parents
  • Hi Dawson,

    Looking at the SDK source file doesn't help explain what is wrong. I will have to reproduce this and debug further.

    If you have a minimal sample, that would help speed thing up a lot. Otherwise, I will return when I find something.

    Hieu

  • Hi,

    If you are going to use the SPI on the nRF21540 to control the gain/output power on the FEM then it has to be on a dedicated SPI module. This is required to meet the timing requirements of the FEM as MPSL needs extremely tight control of the timing to meet the stack requirements. If the SPI is in use to communicate with the nRF7001 when you try to use the nRF54L15 radio then it would crash..

    From the FEM documentation for the SDK:

    On nRF54L Series devices, use SPI bus instance belonging to the PERI Power Domain (on the nRF54L15 SoC one of the spi20, spi21, spi22 instances). Select the pins for the SPI interface that belong to the same power domain as the SPI bus instance. This is Port 1 for the nRF54L. All pins on the same port to guarantee timing

  • I thought that since I used spi21 and the cs for the nRF21540 is on port 1 that this would be fine.
    To be clear are you saying that the issue is that SPIM_SCK, SPIM_MISO, SPIM_MOSI are on Port 2 or is the issue that I am trying to share the SPI with the nRF7001 and need a sperate dedicated SPI with all of the SPI pins on Port 1?

Reply
  • I thought that since I used spi21 and the cs for the nRF21540 is on port 1 that this would be fine.
    To be clear are you saying that the issue is that SPIM_SCK, SPIM_MISO, SPIM_MOSI are on Port 2 or is the issue that I am trying to share the SPI with the nRF7001 and need a sperate dedicated SPI with all of the SPI pins on Port 1?

Children
Related