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

  • 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 the same issue in NCS v2.2.0. However, everything worked for me as expected with NCS v2.0.0. Could you downgrade to NCS version v2.0.0 and test radio sample again?
    In the build configuration, you should have the options below added as Extra CMake arguments

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


    Best regards,
    Dejan

  • Hi,

    I was able to build the Radio test sample without any build errors with v2.0.0, though got a couple of warnings. Would want to know why can't I use the latest SDK version for the same.

    But when I send any commands to start the Tx, the device resets. Please refer the image below.

    If I build the code as is without the FEM node in the device tree. The Tx commands work fine.

  • 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

Related