<?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>Multiprotocol and radio RXIDLE state</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7790/multiprotocol-and-radio-rxidle-state</link><description>Hi nrf51 developers, 
 I&amp;#39;m developing multiprotocol application by combining BLE and a proprietary protocol. I&amp;#39;m using concurrent multiprotocol timeslots API. Started with the ble_app_hrs_with_timeslot example.
In that example timer0 generates interrupt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 25 Jun 2015 12:51:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7790/multiprotocol-and-radio-rxidle-state" /><item><title>RE: Multiprotocol and radio RXIDLE state</title><link>https://devzone.nordicsemi.com/thread/27749?ContentTypeID=1</link><pubDate>Thu, 25 Jun 2015 12:51:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53e978c0-7c21-4a0b-98ef-d45a4a61e61a</guid><dc:creator>chinargor</dc:creator><description>&lt;p&gt;The problem Is solved. One need to  reset all states in the radio peripheral at first. By setting&lt;/p&gt;
&lt;p&gt;NRF_RADIO-&amp;gt;POWER = 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiprotocol and radio RXIDLE state</title><link>https://devzone.nordicsemi.com/thread/27748?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2015 12:34:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1821c160-5852-4236-a505-592b487d6207</guid><dc:creator>chinargor</dc:creator><description>&lt;p&gt;For the rest of the code I&amp;#39;m using exactly ble_app_hrs_with_timeslot.zip this example code.
I changed the timeslot time, but seems it&amp;#39;s not the reason.
Thanks in advance for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiprotocol and radio RXIDLE state</title><link>https://devzone.nordicsemi.com/thread/27747?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2015 12:25:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:608f6618-66cb-4bce-9308-5fdaa183184d</guid><dc:creator>chinargor</dc:creator><description>&lt;p&gt;nrf_radio_signal_callback_return_param_t * m_radio_callback(uint8_t signal_type)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{   

		switch(signal_type)
    {
        case NRF_RADIO_CALLBACK_SIGNAL_TYPE_START:
						start_timer();
						radio_configure(); // general radio configuration from radio_config.c
						/* Enable interrupt on events */
						NRF_RADIO-&amp;gt;INTENSET = RADIO_INTENSET_ADDRESS_Msk | RADIO_INTENSET_DISABLED_Msk | RADIO_INTENSET_READY_Msk;
						/* Enable RADIO interrupts */
						NVIC_ClearPendingIRQ(RADIO_IRQn);
						NVIC_EnableIRQ(RADIO_IRQn);
					
						NRF_RADIO-&amp;gt;PACKETPTR = (uint32_t)&amp;amp;packet;
						
						read_packet();
											
						signal_callback_return_param.params.request.p_next = NULL;
						signal_callback_return_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE;
						break;
				
        case NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0:
						m_configure_normal_timeslot();
						signal_callback_return_param.params.request.p_next = &amp;amp;m_timeslot_request;
						signal_callback_return_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END;  //End the current timeslot and request a new one
						nrf_gpio_pin_toggle(LED_2);
						NRF_TIMER0-&amp;gt;TASKS_STOP = 1;
						break;
				
        case NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO:
						signal_callback_return_param.params.request.p_next = NULL;
						signal_callback_return_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE;
						// not Implemented yet, Because never reaches to this brench
						break;
		}
		return (&amp;amp;signal_callback_return_param);

}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiprotocol and radio RXIDLE state</title><link>https://devzone.nordicsemi.com/thread/27746?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2015 12:24:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81e51dff-7c32-4a77-a352-a9d052cd6e84</guid><dc:creator>chinargor</dc:creator><description>&lt;p&gt;void read_packet(void)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{


   NRF_RADIO-&amp;gt;EVENTS_READY = 0U;

    // Enable radio and wait for ready

    NRF_RADIO-&amp;gt;TASKS_RXEN = 1U;

    while (NRF_RADIO-&amp;gt;EVENTS_READY == 0U)

    {

        // wait

    }

    NRF_RADIO-&amp;gt;EVENTS_END = 0U;
    // Start listening and wait for address received event
    NRF_RADIO-&amp;gt;TASKS_START = 1U;

    // Wait for end of packet or buttons state changed
    while (NRF_RADIO-&amp;gt;EVENTS_END == 0U)

    {

        // wait

    }


    NRF_RADIO-&amp;gt;EVENTS_DISABLED = 0U;
    // Disable radio
    NRF_RADIO-&amp;gt;TASKS_DISABLE = 1U;

    while (NRF_RADIO-&amp;gt;EVENTS_DISABLED == 0U)
    {
        // wait
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiprotocol and radio RXIDLE state</title><link>https://devzone.nordicsemi.com/thread/27745?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2015 12:21:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78237adc-eea1-4c4f-88f1-0fdb1f37b830</guid><dc:creator>chinargor</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your response, Please find source code bellow.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void m_configure_earliest_timeslot(void)

{

    m_timeslot_request.request_type                = NRF_RADIO_REQ_TYPE_EARLIEST;
    m_timeslot_request.params.earliest.hfclk       = NRF_RADIO_HFCLK_CFG_DEFAULT;
    m_timeslot_request.params.earliest.priority    = NRF_RADIO_PRIORITY_HIGH;
    m_timeslot_request.params.earliest.length_us   = 50000; 
    m_timeslot_request.params.earliest.timeout_us  = 1000000;
}


void m_configure_normal_timeslot(void)

{

    m_timeslot_request.request_type                = NRF_RADIO_REQ_TYPE_NORMAL;
    m_timeslot_request.params.normal.hfclk         = NRF_RADIO_HFCLK_CFG_DEFAULT;
    m_timeslot_request.params.normal.priority      = NRF_RADIO_PRIORITY_HIGH;
    m_timeslot_request.params.normal.length_us     = 50000; 
    m_timeslot_request.params.normal.distance_us   = 1000000;

}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiprotocol and radio RXIDLE state</title><link>https://devzone.nordicsemi.com/thread/27744?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2015 11:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94fc53df-187a-4f25-b25f-e4ebe6e92b67</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It might be that you have requested a timeslot that is too short, so that your application will not have time to finish. Could you post the configuration of the radio and the timeslot setup?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiprotocol and radio RXIDLE state</title><link>https://devzone.nordicsemi.com/thread/27743?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2015 11:10:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9ef535a-3f84-4b1f-a5cc-23456be537c5</guid><dc:creator>chinargor</dc:creator><description>&lt;p&gt;Hi Øyvind, Thanks for you response and advice. But my problem is that I&amp;#39;m not getting out of the &lt;strong&gt;while(NRF_RADIO-&amp;gt;EVENTS_READY == 0U) {}&lt;/strong&gt; loop. It seems that it never become 1U.
If I understand timslots currectly, I assume my program should work in a following way.
In one timeslot the m_radio_callback function should be called 3 times. First NRF_RADIO_CALLBACK_SIGNAL_TYPE_START Indicate start of the timeslot and wait for the interrupt, than radio interrupt should occur and it should go NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO case statement and wait for the packages and when the timeslot time is done, timer interrupt should occur and NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0 brench should execute and request a new timeslot.
My problem is that I&amp;#39;m not getting NRF_RADIO-&amp;gt;EVENTS_READY. Please correct me if I&amp;#39;m thinking wrong way.
Thanks again for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiprotocol and radio RXIDLE state</title><link>https://devzone.nordicsemi.com/thread/27742?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2015 09:24:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c31c37e7-5b35-4840-8859-b2f792f87e5f</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi Gor,&lt;/p&gt;
&lt;p&gt;For these things it is a good idea to debug using printf statements, as the SoftDevice may cause hanging when you step or stop the debugger.&lt;/p&gt;
&lt;p&gt;Note that if you want to recieve a packet you will want to do this as well after getting &lt;code&gt;NRF_RADIO-&amp;gt;EVENTS_READY&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    NRF_RADIO-&amp;gt;EVENTS_READY = 0U;
    // Enable radio and wait for ready
    NRF_RADIO-&amp;gt;TASKS_RXEN = 1U;

    while (NRF_RADIO-&amp;gt;EVENTS_READY == 0U)
    {
        // wait
    }
    NRF_RADIO-&amp;gt;EVENTS_END = 0U;
    // Start listening and wait for address received event
    NRF_RADIO-&amp;gt;TASKS_START = 1U;

    // Wait for end of packet or buttons state changed
    while (NRF_RADIO-&amp;gt;EVENTS_END == 0U)
    {
        // wait
    }

    if (NRF_RADIO-&amp;gt;CRCSTATUS == 1U)
    {
        result = packet;
    }
    NRF_RADIO-&amp;gt;EVENTS_DISABLED = 0U;
    // Disable radio
    NRF_RADIO-&amp;gt;TASKS_DISABLE = 1U;

    while (NRF_RADIO-&amp;gt;EVENTS_DISABLED == 0U)
    {
        // wait
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>