<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf21540 gain control</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97584/nrf21540-gain-control</link><description>Hi All! 
 Hope you are doing well. I am using NCS 2.0.2 and VSCODE studio. Radio Test example using nrf52833+nrf21540(custom HW) . I want to ask a question how to control the gain of nrf21540 ? 
 How to enable it in the radio test example and what will</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Mar 2023 05:54:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97584/nrf21540-gain-control" /><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/418471?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 05:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0fe3210-e09e-4645-9279-1e29252b1af5</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;Hi Hieu!&lt;/p&gt;
&lt;p&gt;Thank you so much for your response and help!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Muhammad Usman&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/418383?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 14:51:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfcc5dbf-b1b0-48b8-b0c6-e00be73d75e4</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Muhammad,&lt;/p&gt;
&lt;p&gt;It is not possible to read the CONFREG registers of the nRF21540 via the VS Code Studio Debugger, because the debugger interface is not connected to the nRF21540 in anyway.&lt;/p&gt;
&lt;p&gt;You will need to read that register through the SPI interface.&lt;/p&gt;
&lt;p&gt;Viewing the SPI signals on an oscilloscope or a logic analyzer would tell you whether the&amp;nbsp;nRF52/53 SoC is controlling the FEM but does not guarantee that the FEM is working.&lt;/p&gt;
&lt;p&gt;To confirm that the FEM is working, the best method is to&amp;nbsp;measure the output power of the antenna directly, for example with a spectrum analyzer.&lt;/p&gt;
&lt;p&gt;As an alternative, you could consider configuring the FEM to different output power with the &amp;lt;output_power&amp;gt; and &amp;lt;total_output_power&amp;gt; commands and see if the RSSI value is changing as you would expect it to be.&amp;nbsp;RSSI value is not very reliable, but&amp;nbsp;as long as you keep the physical setup stable,&amp;nbsp;it should be able to help you see differences.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/418189?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 02:51:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16adc36b-70b2-48a1-a7c8-656e950d6f1c</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;Hi Hieu!&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I tried the radio test example as per above mentioned configuration but the RSSI viewer is showing -38dbm when i set 0dbm gain at nrf52833 and 20dbm default gain at nrf21540. Is it possible to read the CONFREG registers of nrf21540? via Vscode studio debugger?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Or any other option to observe that nrf21540 is working? One more option is to view SPI signals on an oscilloscope.&lt;/p&gt;
&lt;p&gt;What u suggest?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Muhammad Usman&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/417848?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2023 10:33:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c636aad-7120-4e13-8032-bbaddb770a7f</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;Thank you so much for your support! Sure i will follow all your instructions. yes, I modified the overlay file only. Will take 1-2 days to get the hardware for testing. I will update my findings soon on it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp;&amp;nbsp; Regards,&lt;/p&gt;
&lt;p&gt;Muhammad Usman&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/417753?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2023 19:15:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b92fcdd9-b084-4384-af68-5964894d7624</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Muhammad,&lt;/p&gt;
&lt;p&gt;I am not too confident in review things without test, but &lt;em&gt;the content&lt;/em&gt; looks right to me. Just remember&amp;nbsp;to define the SPI IF pins correctly as well.&lt;/p&gt;
&lt;p&gt;Are you modifying the nrf52833dk_nrf52833.dts file directly? You shouldn&amp;#39;t do that, and just use the overlay file.&lt;/p&gt;
&lt;p&gt;Finally, as we discussed before, the three Kconfigs you listed should be enabled by default if your DTS work correctly, so please try not setting them explicitly, and run a build to see if they are enabled by default in the zephyr/.config file.&lt;/p&gt;
&lt;p&gt;On second thought, if the DTS setup does not work correctly, the Kconfigs should also just be disabled due to unsatisfied dependencies.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/417385?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2023 11:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:208ac838-0a2b-4ee0-b6fb-4f68c98eb3a8</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;Hi Hieu!&lt;/p&gt;
&lt;p&gt;Again thank you so much for your support!&lt;/p&gt;
&lt;p&gt;You are right, I have to read and understand the basic functionality. Thank you for the links and guidance! Definitely, I will go through all these.&lt;/p&gt;
&lt;p&gt;In the last 2 days, I tried to enable the nrf21540 FEM module for nrf52833. I assigned the pins according to the custom board design (nrf21540+nrf52833).I want to share my work with you. Am I in the right direction?&lt;/p&gt;
&lt;p&gt;Here is the image which explains the configuration of the .dts .overlay file and device tree output.Now MP&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1679657572994v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Now,&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MPSL&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MPSL_FEM&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MPSL_FEM_NRF21540_GPIO_SPI&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;also enabled in the &lt;strong&gt;prj.conf&lt;/strong&gt; file and &amp;quot;&lt;strong&gt;fem.h&lt;/strong&gt;&amp;quot; in &lt;strong&gt;radio_cmd.c&lt;/strong&gt;&amp;nbsp; and &lt;strong&gt;radio_test.c&lt;/strong&gt; as well.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The last thing pending is to test on custom HW. Which will be available to me in 4-5 days.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Muhammad Usman&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/416918?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 20:17:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8505349-e75b-48de-b24a-59593b5424b2</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Muhammad,&lt;/p&gt;
&lt;p&gt;If you recall what I said in my earlier reply, it would make sense:&lt;/p&gt;
[quote user="vthieu"]&lt;p&gt;Just want to share I understood the reason CONFIG_FEM was not set to y. Its dependency MPSL_FEM_ANY_SUPPORT was not set for boards without FEMs.&lt;/p&gt;[/quote]
&lt;p&gt;The board nrf52833dk_nrf52833, which you are likely using, does not have a FEM defined in its Device Tree Specification (DTS).&lt;/p&gt;
&lt;p&gt;If you are using the nRF21540 EK as a shield on top of the nRF52833 DK, you can get the FEM defined in the final compiled DTS by building with the -DSHIELD=nrf21540_ek argument.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can find that documented in &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/peripheral/radio_test/README.html#nrf21540-front-end-module"&gt;the Radio Test sample documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the future, where you have a custom board, you have two options.&lt;/p&gt;
&lt;p&gt;1. Use DTS Overlay to &amp;quot;overlay&amp;quot; the nrf52833dk_nrf52833 board definition into your custom board&lt;/p&gt;
&lt;p&gt;2. Create your custom board.&lt;/p&gt;
&lt;p&gt;To prepare for that, I recommend you read and fully understand the following pages (and their subpages):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/build/dts/howtos.html"&gt;Devicetree HOWTOs — Zephyr Project Documentation (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/board_support/index.html"&gt;Board support — nRF Connect SDK 2.3.99 documentation (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;The two pages above are just on the DTS topic. If possible, I recommend you read the entire application development guide from Zephyr and NCS.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev.html"&gt;Application development — nRF Connect SDK 2.3.99 documentation (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/develop/application/index.html"&gt;Application Development — Zephyr Project Documentation (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I understand that they are a lot. However, to realize a complete product with DFU, wireless connectivity, and custom board, you most likely would need a lot of the knowledge in those pages. Of course, some section can be skipped if they are obviously not applicable to you, such as Wi-Fi.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/416753?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 10:35:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e6fd950-a0f6-47fe-95cd-10bfe0c5ade1</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;Hi Hieu&lt;/p&gt;
&lt;p&gt;Thank you again for your response and help.&lt;/p&gt;
[quote userid="9456" url="~/f/nordic-q-a/97584/nrf21540-gain-control/416374"]Looking at the error, I guess that you are&amp;nbsp;working with a&amp;nbsp;standalone project you created based on the radio_test sample. However, the radio_test sample does not work that way. You will need to build it from its location within the nRF Connect SDK.[/quote]
&lt;p&gt;Thank you I tried your option and it worked for me for &amp;quot;nrf21540_52840&amp;quot;.&lt;/p&gt;
&lt;p&gt;Will that option also work for &amp;quot;52833DK&amp;quot;?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I added the following lines in&amp;nbsp; prj.conf file&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_FEM=y

CONFIG_MPSL=y

CONFIG_MPSL_FEM=y

CONFIG_MPSL_FEM_ONLY=y      #GPIO/ SPI control features 


CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y

CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL=y

CONFIG_MPSL_FEM_POWER_MODEL=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I tried for 52833DK by selecting the board from add build configuration but&amp;nbsp;got the following warnings.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
warning: MPSL_FEM (defined at C:/ncs/v2.3.0/nrf\subsys\mpsl\fem/Kconfig:37) was assigned the value
&amp;#39;y&amp;#39; but got the value &amp;#39;n&amp;#39;. Check these unsatisfied dependencies: MPSL_FEM_ANY_SUPPORT (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MPSL_FEM and/or look up MPSL_FEM in the
menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


warning: MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL (defined at
C:/ncs/v2.3.0/nrf\subsys\mpsl\fem/Kconfig:132) was assigned the value &amp;#39;y&amp;#39; but got the value &amp;#39;n&amp;#39;.
Check these unsatisfied dependencies: (MPSL_FEM_NRF21540_GPIO || MPSL_FEM_NRF21540_GPIO_SPI) (=n),
MPSL_FEM (=n), (MPSL_FEM || MPSL_FEM_PIN_FORWARDER) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL
and/or look up MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL in the menuconfig/guiconfig interface. The
Parsing C:/ncs/v2.3.0/nrf/samples/peripheral/radio_test/Kconfig
Loaded configuration &amp;#39;C:/ncs/v2.3.0/zephyr/boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833_defconfig&amp;#39;
Merged configuration &amp;#39;c:/ncs/v2.3.0/nrf/samples/peripheral/radio_test/prj.conf&amp;#39;
Configuration saved to &amp;#39;C:/ncs/v2.3.0/nrf/samples/peripheral/radio_test/build_1/zephyr/.config&amp;#39;
Kconfig header saved to &amp;#39;C:/ncs/v2.3.0/nrf/samples/peripheral/radio_test/build_1/zephyr/include/generated/autoconf.h&amp;#39;
Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices
sections of the manual might be helpful too.


warning: MPSL_FEM_POWER_MODEL (defined at C:/ncs/v2.3.0/nrf\subsys\mpsl\fem/Kconfig:154) was
assigned the value &amp;#39;y&amp;#39; but got the value &amp;#39;n&amp;#39;. Check these unsatisfied dependencies: MPSL_FEM (=n).
See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MPSL_FEM_POWER_MODEL and/or look up
MPSL_FEM_POWER_MODEL in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.


warning: The choice symbol MPSL_FEM_NRF21540_GPIO_SPI (defined at
C:/ncs/v2.3.0/nrf\subsys\mpsl\fem/Kconfig:70) was selected (set =y), but no symbol ended up as the
choice selection. See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MPSL_FEM_NRF21540_GPIO_SPI and/or look up
MPSL_FEM_NRF21540_GPIO_SPI in the menuconfig/guiconfig interface. The Application Development
Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
might be helpful too.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And CONFIG_FEM is also disabled&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1679482830268v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;is there any other thing I am missing? Because I have to run the code on custom Hardware nrf52833_nrf21540.&lt;/p&gt;
&lt;p&gt;Or do u have any other option for that?&lt;/p&gt;
[quote userid="9456" url="~/f/nordic-q-a/97584/nrf21540-gain-control/416374"]Firstly,&amp;nbsp;I&amp;nbsp;don&amp;#39;t understand what you mean by the above options being disabled. Do you mean that you cannot set them for some reasons? Or do you mean their values are reset somehow?[/quote]
&lt;p&gt;&amp;nbsp;Thank you, now I understand my mistake after your response!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Muhammad Usman&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/416374?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2023 19:56:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a114a14e-a5e4-4ac9-8247-3565c1ae7236</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Muhammad,&lt;/p&gt;
[quote user="Muhammad Usman"]&lt;p&gt;&lt;strong&gt;&amp;nbsp;I set the board &amp;quot;nrf21540_nrf52840&amp;quot;&amp;nbsp;&lt;/strong&gt;instead of nrf52833DK&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I got the following error!&amp;nbsp; for build2&lt;/p&gt;[/quote]
&lt;p&gt;Looking at the error, I guess that you are&amp;nbsp;working with a&amp;nbsp;standalone project you created based on the radio_test sample. However, the radio_test sample does not work that way. You will need to build it from its location within the nRF Connect SDK.&lt;/p&gt;
[quote user="Muhammad Usman"]But when I restarted the Vscode studio above options were disabled. Can you please also help me in this regard where is the issue?[/quote]
&lt;p&gt;Firstly,&amp;nbsp;I&amp;nbsp;don&amp;#39;t understand what you mean by the above options being disabled. Do you mean that you cannot set them for some reasons? Or do you mean their values are reset somehow?&lt;/p&gt;
&lt;p&gt;If it&amp;#39;s their values getting reset, please check if you are using the Save or Save to file button. &amp;quot;Save&amp;quot; only stores the changes to the &amp;lt;build folder&amp;gt;/zephyr/.config file, while only &amp;quot;Save to file&amp;quot; would store the changes to your prj.conf file for subsequent builds.&lt;/p&gt;
&lt;p&gt;Secondly, I see that you are updating &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/kconfig/index.html#CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA"&gt;CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA&lt;/a&gt;&amp;nbsp;and &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/kconfig/index.html#CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTB"&gt;CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTB&lt;/a&gt;. Do you fully understand what those configurations do? They refer to the actual POUTA and POUTB in your nRF21540, which can be &lt;strong&gt;one-time&lt;/strong&gt; configured (it&amp;#39;s only &lt;strong&gt;once&lt;/strong&gt; over the chip&amp;#39;s entire lifetime).&lt;/p&gt;
&lt;p&gt;The factory default of POUTA is 20dB and of POUTB is 10dB. Unless you have performed the one-time configuration of the nRF21540 I mentioned above, then these cannot be changed.&lt;/p&gt;
&lt;p&gt;Related to that, &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/kconfig/index.html#CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB"&gt;CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB&lt;/a&gt;&amp;nbsp;can only be either the value of POUTA or POUTB.&lt;/p&gt;
&lt;p&gt;For more information regarding the two output levels, please refer to &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf21540/keyfeatures_html5.html"&gt;the nRF21540 Product Specification&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/416162?ContentTypeID=1</link><pubDate>Sun, 19 Mar 2023 15:46:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f53849d9-407e-4009-a318-b8f95cc8c1cb</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;Hi Hieu&lt;/p&gt;
&lt;p&gt;One more observation, when I updated the &lt;strong&gt;NCS to 2.3.0.&amp;nbsp;&lt;/strong&gt;It Enabled the following options.&lt;/p&gt;
&lt;p&gt;In kconfig options:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1679236968666v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;.conf file&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1679240637661v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But when I restarted the Vscode studio above options were disabled. Can you please also help me in this regard where is the issue?&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;p&gt;Muhammad Usman&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/416143?ContentTypeID=1</link><pubDate>Sat, 18 Mar 2023 12:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38ca58c8-4b10-4037-934b-7183765d5689</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;Hi Hieu&lt;/p&gt;
&lt;p&gt;Thank you for your support and response! I am facing the same issue.&lt;/p&gt;
&lt;p&gt;when&amp;nbsp;&lt;/p&gt;
[quote userid="9456" url="~/f/nordic-q-a/97584/nrf21540-gain-control/415731"]Thus, if you build for a board with nrf_radio_fem, CONFIG_FEM and consequently CONFIG_MPSL and CONFIG_MPSL_FEM_ONLY should be enabled on their ow[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;I set the board &amp;quot;nrf21540_nrf52840&amp;quot;&amp;nbsp;&lt;/strong&gt;instead of nrf52833DK&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I got the following error!&amp;nbsp; for build2&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1679141155476v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1679141180431v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you please help me where is the issue ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Muhammad Usman&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/415813?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 18:00:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:779c063e-1145-4210-85d9-e94ec11ff000</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;HI Hieu&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Again thank you for your concern and support. I will try to enable it as per your instructions. Facing some issues. Will try to update you on this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/415731?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 13:44:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:405d36ba-d3bd-4737-b679-2ce06902bff0</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Just want to share I understood the reason CONFIG_FEM was not set to y. Its dependency MPSL_FEM_ANY_SUPPORT was not set for boards without FEMs.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# From nrf/subsys/mpsl/fem/Kconfig

config MPSL_FEM_ANY_SUPPORT
	bool
	default $(dt_nodelabel_enabled,nrf_radio_fem)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thus, if you build for a board with nrf_radio_fem, CONFIG_FEM and consequently CONFIG_MPSL and CONFIG_MPSL_FEM_ONLY should be enabled on their own.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/415598?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 06:46:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a40ab42-4afb-45c2-92d4-dc74757ce2ec</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;thank you so much for your concern and response! I just read your messages and I will try and update here as well!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; regards,&lt;/p&gt;
&lt;p&gt;Muhammad Usman&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/415569?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2023 21:02:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76d827b0-92f7-476b-8d49-d4d34173b0f0</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;I just realized my already built project had options changed, and double checked with a fresh unmodified default build. &lt;br /&gt;There I see that CONFIG_FEM is not enabled by default. I am not sure why since it is supposed to default to n.&lt;/p&gt;
&lt;p&gt;CONFIG_FEM=y&lt;br /&gt;CONFIG_NRF21540_FEM=y&lt;/p&gt;
&lt;p&gt;The second option from my previous reply would successfully get the MPSL library into your Radio Test build. But the code relies on CONFIG_FEM to work correctly, so please use this option.&lt;/p&gt;
&lt;p&gt;Sorry for the inaccuracies in my previous reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/415566?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2023 20:10:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd5c1391-0818-45fd-8b08-54548bb745e3</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Muhammad,&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;If you just build the project and examine the Kconfig output, you will see that the MPSL library is already enabled.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Update: The library is not included by default. See my next reply&lt;/p&gt;
&lt;p&gt;Without building, you can find how to include the MPSL library with one of these two approaches.&lt;/p&gt;
&lt;p&gt;The first one is you can see that the sample folder contains a Kconfig file. This adds Kconfig options unique to the sample that you can build with.&lt;/p&gt;
&lt;p&gt;In that Kconfig file, you can see that it also &amp;quot;includes&amp;quot; another Kconfig file with the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/build/kconfig/extensions.html#kconfig-extensions"&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;rsource&lt;/span&gt;&lt;/a&gt; line, which include another one... Overall, the sample&amp;nbsp;will add Kconfig defined in the following files:&lt;br /&gt;\&amp;lt;&lt;span&gt;ncs_&lt;/span&gt;&lt;span&gt;sdk_folder&amp;gt;&lt;/span&gt;\nrf\samples\bluetooth\direct_test_mode\src\fem\Kconfig&lt;br /&gt;\&lt;span&gt;&amp;lt;ncs_sdk_folder&amp;gt;&lt;/span&gt;\nrf\samples\bluetooth\direct_test_mode\Kconfig&lt;br /&gt;\&amp;lt;&lt;span&gt;ncs_&lt;/span&gt;&lt;span&gt;sdk_folder&lt;/span&gt;&amp;gt;\nrf\samples\peripheral\radio_test\Kconfig&lt;/p&gt;
&lt;p&gt;Going over all the configuration, you can see that&amp;nbsp;you it has the Kconfig &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_FEM&lt;/span&gt;, &lt;span style="text-decoration:line-through;"&gt;which is on by default&lt;/span&gt;, and will include the MPSL in FEM only mode for you.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Update: &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_FEM&lt;/span&gt; is not enabled by default. See my next reply.&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;The second approach is to follow the guide linked below and add&amp;nbsp;enable the following Kconfig&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_MPSL&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_MPSL_FEM_ONLY&lt;br /&gt;&lt;/span&gt;Guide referred:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/app_dev/working_with_fem/index.html"&gt;Working with RF front-end modules — nRF Connect SDK 2.3.0 documentation (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;But as we see from the first approach, those configurations are turned on by default due to the project&amp;#39;s setup.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/415275?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 14:54:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ed83683-21d8-4e72-8d64-18fab6d68a0b</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;Hi Hieu&lt;/p&gt;
&lt;p&gt;thank you for the response! I read this. The issue I am facing is that how to add the &lt;strong&gt;MPSL&lt;/strong&gt; library into the NCS vs code. studio.Because its required to set the gain of nrf21540. Can you please refer to some examples available for that?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Muhammad Usman&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf21540 gain control</title><link>https://devzone.nordicsemi.com/thread/414836?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2023 09:54:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eebe133c-74b0-429a-8199-0f2ab3fd66b7</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Muhammad,&lt;/p&gt;
&lt;p&gt;You can find the guide to use the FEM together with the Radio Test in the Radio Test documentation:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/samples/peripheral/radio_test/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/samples/peripheral/radio_test/README.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>