I have a custom board with a nRF52840 and a nRF21540. To control my FEM (nRF21540) I have added the following to my code to my nRF52840_nRF52840.dts file:
I have a custom board with a nRF52840 and a nRF21540. To control my FEM (nRF21540) I have added the following to my code to my nRF52840_nRF52840.dts file:
Hi Sheldon,
You only need to specify the FEM in the device tree (as I see you are doing) and enable MPSL FEM support in your project configuration. Then the MPSL will automatically control the FEM. You can read more about this under Working with RF front-end modules.
Einar
Hmmm. Thanks, Einar. I never imagined it working that way. Is it still possible to control it manually?
I tried to enable it in the pro.config:
Hi,
You will get this error as you have a whitespace before the equal sign. It should be like this: "CONFIG_MPSL_FEM=y
".
Regarding manual control that is also possible, but it makes sense to let the MPSL control the FEM. You do not have full control of when the radio is used from the application, as it is the stack that keeps track of packet transmission times, retransmissions etc.
I must be doing something wrong because it still doesn't work. I do see several concerning things in my code: When I mouse over to of the FEM lines in the 'pro.config' file I get the following comments (which makes me think some things are not present that need to be). I don't quite know what to do:
Below is the code:
# # Copyright (c) 2018 Nordic Semiconductor # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # Enable the UART driver CONFIG_UART_ASYNC_API=y CONFIG_NRFX_UARTE0=y CONFIG_SERIAL=y CONFIG_GPIO=y # Make sure printk is printing to the UART console CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_HEAP_MEM_POOL_SIZE=2048 CONFIG_MAIN_STACK_SIZE=4096 CONFIG_BT_SCAN_UUID_CNT=1 # Enable FEM and MPSL CONFIG_MPSL=y CONFIG_MPSL_FEM=y CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="Nordic_UART_Service" CONFIG_BT_DEVICE_APPEARANCE=833 CONFIG_BT_MAX_CONN=1 CONFIG_BT_MAX_PAIRED=1 CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_GATT_CLIENT=y CONFIG_BT_NUS_CLIENT=y CONFIG_BT_RX_STACK_SIZE=2048 CONFIG_MPSL_FEM_NRF21540_GPIO=y # Enable the NUS service # STEP 1 - Enable the Kconfig symbol of the NUS service CONFIG_BT_NUS=y CONFIG_BT_NUS_AUTHEN=n CONFIG_BT_NUS_SECURITY_ENABLED=n CONFIG_BT_SCAN=y CONFIG_BT_SCAN_FILTER_ENABLE=y CONFIG_BT_SCAN_UUID_CNT=1 CONFIG_BT_SCAN_NAME_CNT=1 CONFIG_BT_GATT_DM=y CONFIG_HEAP_MEM_POOL_SIZE=2048 # Enable bonding CONFIG_BT_SETTINGS=n CONFIG_FLASH=n CONFIG_FLASH_PAGE_LAYOUT=n CONFIG_FLASH_MAP=n CONFIG_NVS=n CONFIG_SETTINGS=n # Added as suggested by technical support # CONFIG_BT_PERIPHERAL_PREF_MIN_INT=12 # CONFIG_BT_PERIPHERAL_PREF_MAX_INT=132 # CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400 # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y # This example requires more workqueue stack CONFIG_MAIN_STACK_SIZE=1152 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 # Config logger CONFIG_LOG=y CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y CONFIG_LOG_BACKEND_UART=n CONFIG_LOG_PRINTK=n CONFIG_ASSERT=y