<?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>Get RSSI through DTM routines</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51890/get-rssi-through-dtm-routines</link><description>Hi 
 I want to get the RSSI value of the received packet through the DTM test routine. Here is my DTM test routine, where I changed it 
 
 I got the result 
 &amp;gt;&amp;gt; RSSI: -127 &amp;gt;&amp;gt; RSSI: -127 &amp;gt;&amp;gt; RSSI: -127 &amp;gt;&amp;gt; RSSI: -127 &amp;gt;&amp;gt; RSSI: -127 &amp;gt;&amp;gt; RSSI: -127 &amp;gt;&amp;gt; RSSI:</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Sep 2019 10:39:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51890/get-rssi-through-dtm-routines" /><item><title>RE: Get RSSI through DTM routines</title><link>https://devzone.nordicsemi.com/thread/209133?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 10:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee65101f-32fe-4a83-9723-69c7ad598c16</guid><dc:creator>gfdd</dc:creator><description>&lt;p&gt;Einar Thorsrud&amp;nbsp;,Thank you very much for your response.&lt;/p&gt;
&lt;p&gt;As I tried before, I made the following changes and met my expectations.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for preparing the radio. At start of each test: Turn off RF, clear interrupt flags of RF, initialize the radio
 *        at given RF channel.
 *
 *@param[in] rx     boolean indicating if radio should be prepared in rx mode (true) or tx mode.
 */
static void radio_prepare(bool rx)
{
    dtm_turn_off_test();
    NRF_RADIO-&amp;gt;CRCPOLY      = m_crc_poly;
    NRF_RADIO-&amp;gt;CRCINIT      = m_crc_init;
    NRF_RADIO-&amp;gt;FREQUENCY    = (m_phys_ch &amp;lt;&amp;lt; 1) + 2;                  // Actual frequency (MHz): 2400 + register value
    NRF_RADIO-&amp;gt;PACKETPTR    = (uint32_t)&amp;amp;m_pdu;                      // Setting packet pointer will start the radio
    NRF_RADIO-&amp;gt;EVENTS_READY = 0;
    NRF_RADIO-&amp;gt;SHORTS       = (1 &amp;lt;&amp;lt; RADIO_SHORTS_READY_START_Pos) |  // Shortcut between READY event and START task
                              (1 &amp;lt;&amp;lt; RADIO_SHORTS_END_DISABLE_Pos)|
	                          //changed
							  RADIO_SHORTS_ADDRESS_RSSISTART_Msk  |
                              RADIO_SHORTS_DISABLED_RSSISTOP_Msk;   // Shortcut between END event and DISABLE task
    if (rx)
    {
        NRF_RADIO-&amp;gt;EVENTS_END = 0;
        NRF_RADIO-&amp;gt;TASKS_RXEN = 1;  // shorts will start radio in RX mode when it is ready
    }
    else // tx
    {
        NRF_RADIO-&amp;gt;TXPOWER = m_tx_power;
    }
}


uint32_t dtm_wait(void)
{
    // Enable wake-up on event
    SCB-&amp;gt;SCR |= SCB_SCR_SEVONPEND_Msk;

    for (;;)
    {
        // Event may be the reception of a packet -
        // handle radio first, to give it highest priority:
        if (NRF_RADIO-&amp;gt;EVENTS_END != 0)
        {
            NRF_RADIO-&amp;gt;EVENTS_END = 0;
            NVIC_ClearPendingIRQ(RADIO_IRQn);

            if (m_state == STATE_RECEIVER_TEST)
            {
                NRF_RADIO-&amp;gt;TASKS_RXEN = 1;
                if ((NRF_RADIO-&amp;gt;CRCSTATUS == 1) &amp;amp;&amp;amp; check_pdu())
                {
                    // Count the number of successfully received packets	
                    m_rx_pkt_count++;  	
					//NRF_RADIO-&amp;gt;TASKS_RSSISTART = 1;
                }
                // Note that failing packets are simply ignored (CRC or contents error).
				
                // Zero fill all pdu fields to avoid stray data
                memset(&amp;amp;m_pdu, 0, DTM_PDU_MAX_MEMORY_SIZE);
            }
            // If no RECEIVER_TEST is running, ignore incoming packets (but do clear IRQ!)
        }
		
        if(NRF_RADIO-&amp;gt;EVENTS_RSSIEND != 0)
		{
			rssi_pkt_count++;
			NRF_RADIO-&amp;gt;EVENTS_RSSIEND = 0;
			int8_t rssi_c =  -1 * NRF_RADIO-&amp;gt;RSSISAMPLE;
			rssi_result += rssi_c;
			printf(&amp;quot;&amp;gt;&amp;gt; RSSI: %d pkt=%d\r\n&amp;quot;,rssi_c,rssi_pkt_count);
		
		}
		
        // Check for timeouts:
        if (mp_timer-&amp;gt;EVENTS_COMPARE[0] != 0)
        {
            mp_timer-&amp;gt;EVENTS_COMPARE[0] = 0;
        }
        else if (mp_timer-&amp;gt;EVENTS_COMPARE[1] != 0)
        {
            // Reset timeout event flag for next iteration.
            mp_timer-&amp;gt;EVENTS_COMPARE[1] = 0;
            NVIC_ClearPendingIRQ(m_timer_irq);
            return ++m_current_time;
        }

        // Other events: No processing
    }
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I got the result：&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568198182453v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Thank you once again.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get RSSI through DTM routines</title><link>https://devzone.nordicsemi.com/thread/208861?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 10:22:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2200f2bd-a8e6-448d-a99a-040ee0c7b409</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am having a bit of a problem seeing the timing in my head. Can you try to wait for the RSSIEND event in the same block, and see if that works? In other words, do it as suggested&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/17051/problem-facing-with-rssi-value-in-nrf51822/65393#65393"&gt;here&lt;/a&gt;, or simply just use&amp;nbsp;anomaly_172_rssi_check() from SDK 15.3.&lt;/p&gt;
&lt;p&gt;Note that DTM is highly specialized and standardized, so since you want to measure RSSI I wonder if perhaps you are doing some more custom radio tests? If so, then the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/nrf_radio_test_example.html?cp=5_1_4_6_29"&gt;Radio Test Example&lt;/a&gt;&amp;nbsp;may be better suited.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>