<?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>Old GPIOTE bug on softdevice S140 7.0.1</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74385/old-gpiote-bug-on-softdevice-s140-7-0-1</link><description>Hello, I am using nRF52840, SDK v16.0, mesh SDK 4.2.0 and softdevice S140 7.0.1. I am following this example to experiment PA/LNA features, namely controlling the pins that enable TX and RX in a front-end radio amplifier. 
 What happens is that I am able</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 May 2021 13:29:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74385/old-gpiote-bug-on-softdevice-s140-7-0-1" /><item><title>RE: Old GPIOTE bug on softdevice S140 7.0.1</title><link>https://devzone.nordicsemi.com/thread/308762?ContentTypeID=1</link><pubDate>Fri, 07 May 2021 13:29:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52949af5-7687-473f-a115-04b6dcd45e42</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I did not test this on the mesh, but tested this directly on the softdevice HRS example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tested this on port 0 (pint 30 and 31)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/602x79/__key/communityserver-discussions-components-files/4/pastedimage1620392571607v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The below is from P1.01 and P1.03 which also seems to work.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/629x238/__key/communityserver-discussions-components-files/4/pastedimage1620392705993v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;So this is clearly not the problem with softdevice and it seems like they infact have fixed it.&lt;/p&gt;
&lt;p&gt;The problem must be in the Mesh code you are using. I noticed that you not checking the return value of&amp;nbsp; mesh_pa_lna_gpiote_enable function which is written to fail&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason is that the check inside mesh_pa_lna_gpiote_enable is wrong&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;/span&gt;&lt;span&gt;p_params&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;lna_cfg&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;gpio_pin&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;gt;=&amp;nbsp;&lt;/span&gt;&lt;span&gt;ARRAY_SIZE&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;NRF_GPIO&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;PIN_CNF&lt;/span&gt;&lt;span&gt;))&amp;nbsp;||&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;/span&gt;&lt;span&gt;p_params&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;pa_cfg&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;gpio_pin&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;gt;=&amp;nbsp;&lt;/span&gt;&lt;span&gt;ARRAY_SIZE&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;NRF_GPIO&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;PIN_CNF&lt;/span&gt;&lt;span&gt;)))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The above is a bug since it only checks the gpio pin to be under port0 size and not on port1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;You should change the function to below&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;pre class="ui-code" data-mode="text"&gt;uint32_t mesh_pa_lna_gpiote_enable(const mesh_pa_lna_gpiote_params_t * p_params)
{
    if (p_params == NULL)
    {
        return NRF_ERROR_NULL;
    }
    if ((p_params-&amp;gt;ppi_ch_id_set &amp;gt;= TIMER_PPI_CH_START &amp;amp;&amp;amp;
         p_params-&amp;gt;ppi_ch_id_set &amp;lt;= TIMER_PPI_CH_STOP) ||
        (p_params-&amp;gt;ppi_ch_id_clr &amp;gt;= TIMER_PPI_CH_START &amp;amp;&amp;amp;
         p_params-&amp;gt;ppi_ch_id_clr &amp;lt;= TIMER_PPI_CH_STOP) ||
        (p_params-&amp;gt;ppi_ch_id_set &amp;gt;= ARRAY_SIZE(NRF_PPI-&amp;gt;CH)) ||
        (p_params-&amp;gt;ppi_ch_id_clr &amp;gt;= ARRAY_SIZE(NRF_PPI-&amp;gt;CH)) ||
        (p_params-&amp;gt;ppi_ch_id_set == p_params-&amp;gt;ppi_ch_id_clr) ||
        (p_params-&amp;gt;gpiote_ch_id &amp;gt;= ARRAY_SIZE(NRF_GPIOTE-&amp;gt;CONFIG)) ||
        (p_params-&amp;gt;lna_cfg.gpio_pin &amp;gt;= 48) ||
        (p_params-&amp;gt;pa_cfg.gpio_pin &amp;gt;= 48))
    {
        return NRF_ERROR_INVALID_PARAM;
    }
    m_gpiote.enabled = false;
    m_gpiote.params = *p_params;
    m_gpiote.enabled = true;
    pin_init(&amp;amp;p_params-&amp;gt;lna_cfg);
    pin_init(&amp;amp;p_params-&amp;gt;pa_cfg);
    return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Old GPIOTE bug on softdevice S140 7.0.1</title><link>https://devzone.nordicsemi.com/thread/308458?ContentTypeID=1</link><pubDate>Thu, 06 May 2021 07:44:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:253ec080-3358-4453-a9b3-e9360e2d3777</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Sorry for late response, i was on sick leave. I will take a look at it today, and if i can reproduce this with the softdevice you mentioned, then i need to contact the softdevice team to get more explanation on it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Old GPIOTE bug on softdevice S140 7.0.1</title><link>https://devzone.nordicsemi.com/thread/308002?ContentTypeID=1</link><pubDate>Mon, 03 May 2021 17:16:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:643193d8-dc84-4bab-a932-8d72186f9c27</guid><dc:creator>rmarques</dc:creator><description>&lt;p&gt;Hello, I am attaching the light switch example, modified as per the recommendations of &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v4.1.0%2Fmd_doc_user_guide_modules_pa_lna_support.html"&gt;this example&lt;/a&gt;.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8231.light_5F00_switch.zip"&gt;devzone.nordicsemi.com/.../8231.light_5F00_switch.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I purposedly modified the project&amp;nbsp;light_switch_server_nrf52840_xxAA_s140_7_0_1 in a clean SDK and Mesh SDK and tested this in a nRF52840 DK board to be sure everything was as vanilla as possible.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If I use pin 0.31 for TX and 0.30 for RX I get the following signals in the oscilloscope:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/WhatsApp-Image-2021_2D00_05_2D00_03-at-18.08.49.jpeg" /&gt;&lt;/p&gt;
&lt;p&gt;If I use pin 1.01 for TX and 1.03 for RX I get the following signals in the oscilloscope:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/WhatsApp-Image-2021_2D00_05_2D00_03-at-18.09.13.jpeg" /&gt;&lt;/p&gt;
&lt;p&gt;The module I am using that has PA/LNA has the pins in port 1 and not on port 0. I would like to not have to design my board with two wires connecting pins from port 0 to port 1, but I could do it as a last measure.&lt;/p&gt;
&lt;p&gt;I also tried other pins on both port 0 and port 1 and the behaviour is the same. RX is never pulled up to 3V on port 1 pins after the periodic transmissions. This only works on pins of port 1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Old GPIOTE bug on softdevice S140 7.0.1</title><link>https://devzone.nordicsemi.com/thread/307002?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 11:47:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0162af8-0934-4dcc-8259-97ca2912cdd3</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is fixed in SD_140 v6.1.0 and have not heard or seen this problem in later softdevice. Can you attach your project so that i can try to replicate your problem on my desk?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>