<?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>DTS files for a custom board NRF5340 + NRF21540</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108609/dts-files-for-a-custom-board-nrf5340-nrf21540</link><description>Hi guys, 
 I&amp;#39;ve done a custom board with NRF5340 + NRF21540 and I&amp;#39;m not sure the right way to link the cpuapp and cpunet for control the output power of NRF21540. 
 I tried to following the documentation https://developer.nordicsemi.com/nRF_Connect_SDK</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 03 Mar 2024 19:34:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108609/dts-files-for-a-custom-board-nrf5340-nrf21540" /><item><title>RE: DTS files for a custom board NRF5340 + NRF21540</title><link>https://devzone.nordicsemi.com/thread/471923?ContentTypeID=1</link><pubDate>Sun, 03 Mar 2024 19:34:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a317e3e-004a-46f0-89b5-a684c06fbe59</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I recommend to attach a spectrum analyzer for proper measurements. In general you&amp;nbsp;may&amp;nbsp;not see a difference on the output power with and without nRF21540. Instead you have the possibility to set higher output power than what the nRF5340 alone can support, the library will use the PA gain + nRF output power to get the closest setting that combined give the output power you want.&lt;/p&gt;
&lt;p&gt;But to answer your question, you likely should set CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=20. Also you may find this useful:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/device_guides/working_with_fem.html#ug-radio-fem"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/device_guides/working_with_fem.html#ug-radio-fem&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTS files for a custom board NRF5340 + NRF21540</title><link>https://devzone.nordicsemi.com/thread/471646?ContentTypeID=1</link><pubDate>Thu, 29 Feb 2024 20:22:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bd7dbc7-952f-4f6c-871f-3a11b768311e</guid><dc:creator>msfassarella</dc:creator><description>&lt;p&gt;Hi Kenneth.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First of all, thanks for your reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In these days I was trying to confirm the hardware design and for this purpose the NRF21540 GPIOs were manually controlled. I confirmed that the hardware design is working and the RF power control by the Mode pin is ok too.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tried configure CPU Net like described above and stopped the manual control over it (ant-sel-gpios and spi-if&amp;nbsp; were removed)&lt;/p&gt;
&lt;p&gt;Inside the &lt;span&gt;\build\hci_rpmsg\zephyr\zephyr.dts I found the following references to FEM&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	radio: radio@41008000 {
			compatible = &amp;quot;nordic,nrf-radio&amp;quot;;
			reg = &amp;lt; 0x41008000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x8 0x5 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			dfe-supported;
			ieee802154-supported;
			ble-2mbps-supported;
			ble-coded-phy-supported;
			fem = &amp;lt; &amp;amp;nrf_radio_fem &amp;gt;;
			ieee802154: ieee802154 {
				compatible = &amp;quot;nordic,nrf-ieee802154&amp;quot;;
				status = &amp;quot;okay&amp;quot;;
			};
		};&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;and&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="markdown"&gt;	nrf_radio_fem: nrf21540_fem {
		compatible = &amp;quot;nordic,nrf21540-fem&amp;quot;;
		tx-en-gpios = &amp;lt; &amp;amp;gpio1 0xd 0x0 &amp;gt;;
		rx-en-gpios = &amp;lt; &amp;amp;gpio0 0x1e 0x0 &amp;gt;;
		pdn-gpios = &amp;lt; &amp;amp;gpio0 0x1a 0x0 &amp;gt;;
		mode-gpios = &amp;lt; &amp;amp;gpio1 0xe 0x0 &amp;gt;;
		supply-voltage-mv = &amp;lt; 0xce4 &amp;gt;;
		phandle = &amp;lt; 0x2 &amp;gt;;
	};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;the&amp;nbsp;&lt;span&gt;\build\hci_rpmsg\zephyr\.config has the following&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="markdown"&gt;# CONFIG_SHELL_BT_NUS is not set
# CONFIG_SHELL_IPC is not set
# CONFIG_MPSL_FEM_ONLY is not set
CONFIG_MPSL_FEM_ANY_SUPPORT=y
CONFIG_MPSL_FEM_NRF21540_GPIO_SUPPORT=y
CONFIG_MPSL_FEM_NCS_SUPPORTED_FEM_USED=y
CONFIG_MPSL_FEM_API_AVAILABLE=y
CONFIG_MPSL_FEM=y
CONFIG_MPSL_FEM_NRF21540_GPIO=y
CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=10
CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA=20
CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTB=10
CONFIG_MPSL_FEM_NRF21540_RX_GAIN_DB=13
# CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL is not set
# CONFIG_MPSL_FEM_POWER_MODEL is not set
CONFIG_MPSL_FEM_DEVICE_CONFIG_254=y
CONFIG_MPSL_THREAD_COOP_PRIO=6
CONFIG_MPSL_WORK_STACK_SIZE=1024
CONFIG_MPSL_TIMESLOT_SESSION_COUNT=0
# CONFIG_MPSL_ASSERT_HANDLER is not set

CONFIG_DT_HAS_NORDIC_NRF21540_FEM_ENABLED=y&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;the&amp;nbsp;the&amp;nbsp;\build\zephyr\zephyr.dts has the following&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	gpio_fwd: nrf-gpio-forwarder {
		compatible = &amp;quot;nordic,nrf-gpio-forwarder&amp;quot;;
		status = &amp;quot;okay&amp;quot;;
		nrf21540-gpio-if {
			gpios = &amp;lt; &amp;amp;gpio1 0xd 0x0 &amp;gt;, &amp;lt; &amp;amp;gpio0 0x1e 0x0 &amp;gt;, &amp;lt; &amp;amp;gpio0 0x1a 0x0 &amp;gt;, &amp;lt; &amp;amp;gpio1 0xe 0x0 &amp;gt;;
		};
	};&lt;/pre&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I redo the test and both scan and advertisment are working.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;However, the advertisement has a less rssi power than I expected.&lt;/p&gt;
&lt;p&gt;When I did the same test, but controlling the gpios directly like described in NRF21540 datasheet, the RSSI was bigger.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How can I make sure that the NRF21540 is working with 20dB configuration instead of 10dB?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How CPU Net choose the value on NRF21540 pin Mode ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTS files for a custom board NRF5340 + NRF21540</title><link>https://devzone.nordicsemi.com/thread/470831?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 17:22:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83041e93-4f25-48b1-be6a-16cc5152e3a2</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The easiest may be to look at the added overlay files when including the nrf21540ek shield:&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/main/boards/shields/nrf21540ek"&gt;https://github.com/nrfconnect/sdk-nrf/tree/main/boards/shields/nrf21540ek&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When building for instance the peripheral uart with the nrf21540ek you simply follow:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_uart/README.html#fem-support"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_uart/README.html#fem-support&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/device_guides/working_with_fem.html#programming"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you want to observe what is actually added&amp;nbsp;during build you can checkout dts and kconfig in:&lt;br /&gt;appcore: \build\peripheral_uart\zephyr\zephyr.dts&amp;nbsp;(\build\peripheral_uart\zephyr\.config)&lt;br /&gt;netcore: \build\hci_ipc\zephyr\zephyr.dts&amp;nbsp; (\build\hci_ipc\zephyr\.config)&lt;/p&gt;
&lt;p&gt;Alternatively here is how to add the nrf21540ek&amp;nbsp;shield for a generic nRF5340 example:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/device_guides/working_with_fem.html#programming"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/device_guides/working_with_fem.html#programming&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This example show how to&amp;nbsp;set&amp;nbsp;CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL to control output power dynamically:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/bluetooth/hci_pwr_ctrl/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/bluetooth/hci_pwr_ctrl/README.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTS files for a custom board NRF5340 + NRF21540</title><link>https://devzone.nordicsemi.com/thread/470564?ContentTypeID=1</link><pubDate>Sat, 24 Feb 2024 23:56:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a207910-b9b1-4d2f-b637-76691ebb43a7</guid><dc:creator>dstarling</dc:creator><description>&lt;p&gt;I also have a similar issue with a custom board, any response? Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>