<?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>NCS and nRF21540 with custom protocol</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91220/ncs-and-nrf21540-with-custom-protocol</link><description>Hello, 
 First, by &amp;quot;Custom Protocol&amp;quot; I mean that I need to directly access the radio to transmit or receive packets without the L2 layer of Zephyr (IEEE802.15.4 RAW mode). 
 With this custom protocol, I would like to use the nRF21540 amplifier but I can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Feb 2023 20:33:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91220/ncs-and-nrf21540-with-custom-protocol" /><item><title>RE: NCS and nRF21540 with custom protocol</title><link>https://devzone.nordicsemi.com/thread/411788?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2023 20:33:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5ef3a84-2fb9-4c68-bb53-f5b303801c25</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please create a new support case for a different issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS and nRF21540 with custom protocol</title><link>https://devzone.nordicsemi.com/thread/411694?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2023 14:26:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8703808-14d2-4bfd-92ea-73d32059736d</guid><dc:creator>AndrewSafehear</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have another question. How can I configure a custom TX gain with the MPSL library ?&lt;/p&gt;
&lt;p&gt;I want to have an output power of 8 dBm on the nRF21540.&lt;/p&gt;
&lt;p&gt;I tried to change the&amp;nbsp;MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA and set&amp;nbsp;&lt;span&gt;CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL&amp;nbsp;&lt;/span&gt;configs but the signal on a analyzer was -23dBm and not near 8 dBm as I wanted.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I just use the default value of 10 dBm, the analyzer get a power near 10 dBm as wanted.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Andrew&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS and nRF21540 with custom protocol</title><link>https://devzone.nordicsemi.com/thread/383672?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2022 12:13:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2144e9a-b488-4dd1-861e-06e80d33b47a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is no dedicated API to control the ANT_SEL pin, but this can be done by controlling the ANT_SEL pin with GPIO API like done in &lt;a title="https://github.com/nrfconnect/sdk-nrf/blob/5e9c27fae2c56666be32046b98aded5912cd185a/samples/bluetooth/direct_test_mode/src/fem/nrf21540.c#l478" href="https://github.com/nrfconnect/sdk-nrf/blob/5e9c27fae2c56666be32046b98aded5912cd185a/samples/bluetooth/direct_test_mode/src/fem/nrf21540.c#L478" rel="noopener noreferrer" target="_blank"&gt;this sample&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &amp;quot;Antenna Diversity&amp;quot; feature as described&amp;nbsp;&lt;a title="https://developer.nordicsemi.com/nrf_connect_sdk/doc/latest/nrfxlib/nrf_802154/doc/antenna_diversity.html" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_802154/doc/antenna_diversity.html" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;&amp;nbsp;for 802.15.4 protocol only and never went out of the experimental stage, so there are no easy Kconfigs to simply turn on this feature.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS and nRF21540 with custom protocol</title><link>https://devzone.nordicsemi.com/thread/383104?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2022 14:06:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:800aff1b-dd64-4df4-96c4-923769fcc1e7</guid><dc:creator>AndrewSafehear</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
[quote userid="77782" url="~/f/nordic-q-a/91220/ncs-and-nrf21540-with-custom-protocol/383072"]Did you make it work with the setting?[/quote]
&lt;p&gt;Yes it&amp;#39;s working, the logs are saying that the output tx power is 13 dBm and my RSSI change when I tweak the parameter.&lt;/p&gt;
[quote userid="77782" url="~/f/nordic-q-a/91220/ncs-and-nrf21540-with-custom-protocol/383072"]&lt;span&gt;You can use&amp;nbsp;&lt;/span&gt;&lt;code&gt;&lt;span&gt;ant-sel-gpios&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;- GPIO characteristic of the device to control the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;&lt;span&gt;&lt;span&gt;ANT_SEL&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;signal of the nRF21540[/quote]
&lt;p&gt;I can manually control this GPIO without going through the MSPL library but it&amp;#39;s not really zephyr friendly... As I access a GPIO controlled by a driver while bypassing it.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="77782" url="~/f/nordic-q-a/91220/ncs-and-nrf21540-with-custom-protocol/383072"]&lt;p&gt;Do you get any errors? It would help if you could provide the log.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;When I use those function I don&amp;#39;t get any log error and they return 1 as the set was correctly done.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I debug the card with Ozone, a hard fault is detected when I try to send a packet with the tx function of the ieee802154_radio_api.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;The target stopped in HardFault exception state.

Reason: A fault with configurable priority has been escalated to a HardFault exception at 0x0001BC38.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The problem is that I don&amp;#39;t know if the antenna diversity module is correctly configured inside the MPSL proprietary library. Is there any API function that I can call directly from my application to change the antenna&amp;nbsp; selection or even check if the antenna diversity module is correctly configured ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Line 331 of the mpsl_fem.c file, I see that the ANT_SEL pin is configured as inactive but I don&amp;#39;t see any other function inside this file that use the ANT_SEL pin...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), ant_sel_gpios)
	err = inactive_pin_configure(
		DT_GPIO_PIN(DT_NODELABEL(nrf_radio_fem), ant_sel_gpios),
		DT_GPIO_LABEL(DT_NODELABEL(nrf_radio_fem), ant_sel_gpios),
		DT_GPIO_FLAGS(DT_NODELABEL(nrf_radio_fem), ant_sel_gpios));

	if (err) {
		return err;
	}
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The only examples for the nRF21540 antenna selection&amp;nbsp;are without the use of MPSL, creating directly a custom driver for the nRF21540.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Andrew&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS and nRF21540 with custom protocol</title><link>https://devzone.nordicsemi.com/thread/383072?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2022 12:50:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db0bc155-7b3f-42c5-ac69-b9252a1f7dfd</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Andrew,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="AndrewSafehear"]CONFIG_NET_CONFIG_IEEE802154_RADIO_TX_POWER to 13 and leave&amp;nbsp;MPSL_FEM_NRF21540_TX_GAIN_DB to the default value, is that correct ?[/quote]
&lt;p&gt;&lt;span&gt;Yes, this is the way.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="AndrewSafehear"]how can I choose which antenna is used (ANT_SEL pin) in my application with the MPSL library ?[/quote]
&lt;p&gt;&lt;span&gt;You can use&amp;nbsp;&lt;/span&gt;&lt;code&gt;&lt;span&gt;ant-sel-gpios&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;- GPIO characteristic of the device to control the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;&lt;span&gt;&lt;span&gt;ANT_SEL&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;signal of the nRF21540.&amp;nbsp;See&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_radio_fem.html?highlight=ant_sel#id12"&gt;Optional properties&lt;/a&gt;.&amp;nbsp;&lt;span&gt;If pulled low = 0 then only ANT 1. If pulled high = 1, the ANT 2 is used. Also, see this&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/f7b06162027da4421bd7df097137b601a21ceb8d/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts#L119"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/f7b06162027da4421bd7df097137b601a21ceb8d/boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts#L119&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user="AndrewSafehear"]I&amp;#39;ve&amp;nbsp;tried to use those function but when I use them, the radio is not working anymore.&amp;nbsp;[/quote]
&lt;p&gt;Do you get any errors? It would help if you could provide the log.&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS and nRF21540 with custom protocol</title><link>https://devzone.nordicsemi.com/thread/382937?ContentTypeID=1</link><pubDate>Tue, 23 Aug 2022 13:15:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29faaee7-e7e1-4afa-b48d-e0ce27417b9d</guid><dc:creator>AndrewSafehear</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;Thank you for the quick reply!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;So if I want a final power of 13dBm, I need to set&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-size:inherit;"&gt;CONFIG_NET_CONFIG_IEEE802154_RADIO_TX_POWER to 13 and leave&amp;nbsp;MPSL_FEM_NRF21540_TX_GAIN_DB to the default value, is that correct ?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size:inherit;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size:inherit;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size:inherit;"&gt;Also, how can I choose which antenna is used (ANT_SEL pin) in my application with the MPSL library ?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;I&amp;#39;ve&amp;nbsp;tried to use those function but when I use them, the radio is not working anymore.&amp;nbsp;&lt;/span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_802154_antenna_diversity_tx_mode_set(NRF_802154_SL_ANT_DIV_MODE_MANUAL);
nrf_802154_antenna_diversity_tx_antenna_set(NRF_802154_SL_ANT_DIV_ANTENNA_2);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Andrew&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS and nRF21540 with custom protocol</title><link>https://devzone.nordicsemi.com/thread/382929?ContentTypeID=1</link><pubDate>Tue, 23 Aug 2022 12:42:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1998c69d-5303-4ea9-9260-6ea468c4e984</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Andrew,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the team:&lt;/p&gt;
&lt;p&gt;The TX power being logged in the nrf802154_nrf5.c file&amp;nbsp;&lt;a title="https://github.com/nrfconnect/sdk-zephyr/blob/42a1b2637a135036c5355473058cef3d2821af2c/drivers/ieee802154/ieee802154_nrf5.c#l363" href="https://github.com/nrfconnect/sdk-zephyr/blob/42a1b2637a135036c5355473058cef3d2821af2c/drivers/ieee802154/ieee802154_nrf5.c#L363"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/42a1b2637a135036c5355473058cef3d2821af2c/drivers/ieee802154/ieee802154_nrf5.c#L363&lt;/a&gt;&amp;nbsp;is the&amp;nbsp;power requested on the antenna. Changing mentioned&amp;nbsp;Kconfigf gain parameters of the FEM does not affect what the application requests for tx power.&amp;nbsp;The nRF 802.15 4 Radio Driver takes the requested value&amp;nbsp;and&amp;nbsp;passes it to Front-End Support Module in MPSL which performs split of the power between SoC and FEM.&lt;/p&gt;
&lt;p&gt;Having a higher gain Kconfig option will simply lead to use lower power on the SoC.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The application must request more power in runt-time.&lt;/p&gt;
&lt;p&gt;The second potential misuse is that these Kconfig options MPSL_FEM_NRF21540_TX_GAIN_DB don&amp;#39;t physically set the gain that will be achieved by the nRF21540. This value is not transferred to the nRF21540 chip. It rather informs software about the gain that the given nRF21540 used on the target board is calibrated for. Default values are 10 and 20 dB.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda&lt;/p&gt;
&lt;div&gt;
&lt;dl&gt;
&lt;dd&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dd&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>