Radio Test with Skyworks FEM + NRF52840

Hi,

I needed assistance to get the SKY66403-11 FEM working with the Radio Test Example in VS Code, for certification testing (FCC, CE etc). I am using the NCS 2.2.0 SDK.  I am using a custom board with nRF52840 SoC and it has the LFXO present. 

I have added the device tree node as depicted below in the sample code, created as an existing project.:

nrf_radio_fem: SKY66403 {
		compatible = "skyworks,sky66403-11", "generic-fem-two-ctrl-pins";
		ctx-gpios = <&gpio1 01 GPIO_ACTIVE_HIGH>;
		crx-gpios = <&gpio1 04 GPIO_ACTIVE_HIGH>;
		chl-gpios = <&gpio1 06 GPIO_ACTIVE_HIGH>;
		cps-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
	};

Are there any additional changes required beside these to be done to get the FEM working because while building this I get the following build error. 

FAILED: CMakeFiles/app.dir/src/radio_cmd.c.obj 
C:\nordicsemi\toolchains\v2.2.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=0 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/nordicsemi/v2.2.0/zephyr/include -Izephyr/include/generated -IC:/nordicsemi/v2.2.0/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/nordicsemi/v2.2.0/zephyr/lib/util/fnmatch/. -IC:/nordicsemi/v2.2.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/nordicsemi/v2.2.0/nrf/include -IC:/nordicsemi/v2.2.0/nrf/lib/multithreading_lock/. -IC:/nordicsemi/v2.2.0/nrf/tests/include -IC:/nordicsemi/v2.2.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/nordicsemi/v2.2.0/modules/hal/nordic/nrfx -IC:/nordicsemi/v2.2.0/modules/hal/nordic/nrfx/drivers/include -IC:/nordicsemi/v2.2.0/modules/hal/nordic/nrfx/mdk -IC:/nordicsemi/v2.2.0/zephyr/modules/hal_nordic/nrfx/. -IC:/nordicsemi/v2.2.0/modules/debug/segger/SEGGER -IC:/nordicsemi/v2.2.0/modules/debug/segger/Config -IC:/nordicsemi/v2.2.0/zephyr/modules/segger/. -IC:/nordicsemi/v2.2.0/nrfxlib/mpsl/include -IC:/nordicsemi/v2.2.0/nrfxlib/mpsl/include/protocol -I../../../bluetooth/direct_test_mode/src/fem -isystem C:/nordicsemi/v2.2.0/zephyr/lib/libc/minimal/include -isystem c:/nordicsemi/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include -isystem c:/nordicsemi/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include-fixed -isystem C:/nordicsemi/v2.2.0/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros C:/nordicsemi/v2.2.0/nrf/samples/peripheral/radio_test/build_nofem/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/nordicsemi/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/nordicsemi/v2.2.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/nordicsemi/v2.2.0/nrf/samples/peripheral/radio_test=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/nordicsemi/v2.2.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/nordicsemi/v2.2.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/radio_cmd.c.obj -MF CMakeFiles\app.dir\src\radio_cmd.c.obj.d -o CMakeFiles/app.dir/src/radio_cmd.c.obj -c ../src/radio_cmd.c
c:\nordicsemi\v2.2.0\nrf\samples\peripheral\radio_test\src\radio_cmd.c:64:20: error: 'CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB' undeclared here (not in a function)
   64 |         .txpower = CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB,
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 PS: Just wanted to mention that I tried running the Radio Test Example directly without adding the support for the FEM and that works as expected.

Thanks in Advance

Parents
  • Hi,

    You might need to include Kconfig option CONFIG_MPSL_FEM_SIMPLE_GPIO=y for FEM device that has generic 2-pin control interface. You can read more about this option here.

    Best regards,
    Dejan

  • Hello Dejans,

    Thanks for the quick response.

    I tried adding that option. I get the following Cmake error:

     error: MPSL_FEM_GENERIC_TWO_CTRL_PINS_SUPPORT (defined at
    [cmake] C:/nordicsemi/v2.2.0/nrf\subsys\mpsl\fem/Kconfig:23) is assigned in a configuration file, but is not
    [cmake] directly user-configurable (has no prompt). It gets its value indirectly from other symbols. See
    [cmake] http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MPSL_FEM_GENERIC_TWO_CTRL_PINS_SUPPORT
    [cmake] and/or look up MPSL_FEM_GENERIC_TWO_CTRL_PINS_SUPPORT in the menuconfig/guiconfig interface. The
    [cmake] Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices
    [cmake] sections of the manual might be helpful too.
    [cmake] 
    [cmake] CMake Error at C:/nordicsemi/v2.2.0/zephyr/cmake/modules/kconfig.cmake:328 (message):
    [cmake]   command failed with return code: 1
    [cmake] Call Stack (most recent call first):
    [cmake]   C:/nordicsemi/v2.2.0/nrf/cmake/modules/kconfig.cmake:29 (include)
    [cmake]   C:/nordicsemi/v2.2.0/zephyr/cmake/modules/zephyr_default.cmake:108 (include)
    [cmake]   C:/nordicsemi/v2.2.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    [cmake]   C:/nordicsemi/v2.2.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
    [cmake]   CMakeLists.txt:32 (find_package)

    Do I require to add any other option along with this one?

    The error seems to say I cannot change these options as they not "user-configurable", is my understanding correct here?

  • Hi,

    I have seen board resets in NCS v2.2.0 which were not there for me when using NCS v2.0.0. I tested the sample with Skyworks FEM on nRF52840-DK using the following configuration in nrf52840dk_nrf52840.overlay

    / {
        nrf_radio_fem: SKY66112 {
    		compatible = "skyworks,sky66112-11", "generic-fem-two-ctrl-pins";
    		ctx-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
    		crx-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
    		chl-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
    		cps-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
    	};
    };



    Brosnan said:
    Would want to know why can't I use the latest SDK version for the same.

    There is a pull request for this issue.

    Best regards,
    Dejan

  • Hi,

    1
    2
    3
    4
    5
    6
    7
    nrf_radio_fem: SKY66403 {
    compatible = "skyworks,sky66403-11", "generic-fem-two-ctrl-pins";
    ctx-gpios = <&gpio1 01 GPIO_ACTIVE_HIGH>;
    crx-gpios = <&gpio1 04 GPIO_ACTIVE_HIGH>;
    chl-gpios = <&gpio1 06 GPIO_ACTIVE_HIGH>;
    cps-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I have added my node as mentioned earlier in the nrf52840dk_nrf52840.dts file. Should that matter?

  • Hi,

    It matters what is the location of your nrf52840dk_nrf52840.dts file. If you put it in your project folder, it will not work as you expect. However, modifying existing nrf52840dk_nrf52840.dts file which is located in \v2.0.0\zephyr\boards\arm\nrf52840dk_nrf52840 should work as expected. You can check if Skyworks configuration is included after building the project by looking at zephyr.dts file which is located in your build\zephyr folder. In order to avoid modifying existing dts file, it is recommended to use nrf52840dk_nrf52840.overlay file instead. You can put this overlay file in your project directory.

    Best regards,
    Dejan

  • Hi,

    I am using the Radio test sample as is (as an existing project), and haven't created a separate project directory.

    As you suggested to check the build\zephyr folder, I did and found the changes for the FEM node to be present. As I am not very well versed to create a custom .overlay file, didn't do that and instead changed the <board>.dts file directly.

    I'll just post the warnings I get after building here as well for reference.

    Any other pointers for what I should check/do next.

  • Hi,

    If you want to try the way I suggested, please make sure that you have unmodified file \v2.0.0\zephyr\boards\arm\nrf52840dk_nrf52840\nrf52840dk_nrf52840.dts. When you have verified that this dts file is unmodified, proceed with steps outlined below.

    1. Make freestanding application in VS Code based on radio_test sample in NCS v2.0.0. When the application is made, radio_test directory is created. This is what I referred to as your project directory. You don't need to have separate project directory other than radio_test.
    2. Inside your project directory (radio_test), create a file called nrf52840dk_nrf52840.overlay. The content of this file should be (in case you use nRF52840-DK) as shown below

    / {
        nrf_radio_fem: SKY66112 {
    		compatible = "skyworks,sky66112-11", "generic-fem-two-ctrl-pins";
    		ctx-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
    		crx-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
    		chl-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
    		cps-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
    	};
    };


    3. Create a build configuration in VS Code and add following Extra CMake arguments

    -DCONFIG_MPSL=y
    -DCONFIG_MPSL_FEM=y
    -DCONFIG_MPSL_FEM_SIMPLE_GPIO=y


    4. Build your application

    You may still see some warnings, but the build should be successful.

    Best regards,
    Dejan

Reply
  • Hi,

    If you want to try the way I suggested, please make sure that you have unmodified file \v2.0.0\zephyr\boards\arm\nrf52840dk_nrf52840\nrf52840dk_nrf52840.dts. When you have verified that this dts file is unmodified, proceed with steps outlined below.

    1. Make freestanding application in VS Code based on radio_test sample in NCS v2.0.0. When the application is made, radio_test directory is created. This is what I referred to as your project directory. You don't need to have separate project directory other than radio_test.
    2. Inside your project directory (radio_test), create a file called nrf52840dk_nrf52840.overlay. The content of this file should be (in case you use nRF52840-DK) as shown below

    / {
        nrf_radio_fem: SKY66112 {
    		compatible = "skyworks,sky66112-11", "generic-fem-two-ctrl-pins";
    		ctx-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
    		crx-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
    		chl-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
    		cps-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
    	};
    };


    3. Create a build configuration in VS Code and add following Extra CMake arguments

    -DCONFIG_MPSL=y
    -DCONFIG_MPSL_FEM=y
    -DCONFIG_MPSL_FEM_SIMPLE_GPIO=y


    4. Build your application

    You may still see some warnings, but the build should be successful.

    Best regards,
    Dejan

Children
Related