<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>Radio transmit and receive in timeslot</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88354/radio-transmit-and-receive-in-timeslot</link><description>Hi, 
 I am developing a project that includes transmission and reception in particular timeslots. I checked the radio example in nrf5 sdk and copied the trasmission part to my timeslot file. Now first transmission is happening but afer that transmission</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Mon, 06 Jun 2022 05:30:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88354/radio-transmit-and-receive-in-timeslot" /><item><title>RE: Radio transmit and receive in timeslot</title><link>https://test-devzone.nordicsemi.com/thread/370980?ContentTypeID=1</link><pubDate>Mon, 06 Jun 2022 05:30:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:823cbfb8-a4a9-4e94-a8a6-7968364c60ab</guid><dc:creator>user116508</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;I got the code working by resetting radio register in radio callback case.&lt;pre class="ui-code" data-mode="text"&gt;    // Disable and enable the Radio to reset the RADIO registers, needed from S1xx v8.x
    NRF_RADIO-&amp;gt;POWER = ((RADIO_POWER_POWER_Disabled &amp;lt;&amp;lt; RADIO_POWER_POWER_Pos) &amp;amp; RADIO_POWER_POWER_Msk);
    NRF_RADIO-&amp;gt;POWER = ((RADIO_POWER_POWER_Enabled &amp;lt;&amp;lt; RADIO_POWER_POWER_Pos) &amp;amp; RADIO_POWER_POWER_Msk);&lt;/pre&gt;thanks for your support and timely responses.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio transmit and receive in timeslot</title><link>https://test-devzone.nordicsemi.com/thread/370880?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 12:33:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:833c33f8-3878-4130-83a7-9d151401a328</guid><dc:creator>user7377</dc:creator><description>&lt;p&gt;Do you see this error if you keep all the low-level radio code but remove the SoftDevice and timeslot related code, so that you always have full access to the radio etc? If not (or in any case), can you check if this issue also happens if you do everything in a single timeslot?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio transmit and receive in timeslot</title><link>https://test-devzone.nordicsemi.com/thread/370790?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 06:23:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f948004d-aa1b-47a2-a8a2-8197bf0d0f6e</guid><dc:creator>user116508</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**@brief Request next timeslot event in earliest configuration
 */
uint32_t request_next_event_earliest(void) {
  m_slot_length = 50000;
  m_timeslot_request.request_type = NRF_RADIO_REQ_TYPE_EARLIEST;
  m_timeslot_request.params.earliest.hfclk = NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED;
  m_timeslot_request.params.earliest.priority = NRF_RADIO_PRIORITY_NORMAL;
  m_timeslot_request.params.earliest.length_us = m_slot_length;
  m_timeslot_request.params.earliest.timeout_us = 1000000;
  return sd_radio_request(&amp;amp;m_timeslot_request);
}

/**@brief Configure next timeslot event in earliest configuration
 */
void configure_next_event_earliest(void) {
  m_slot_length = 50000;
  m_timeslot_request.request_type = NRF_RADIO_REQ_TYPE_EARLIEST;
  m_timeslot_request.params.earliest.hfclk = NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED;
  m_timeslot_request.params.earliest.priority = NRF_RADIO_PRIORITY_NORMAL;
  m_timeslot_request.params.earliest.length_us = m_slot_length;
  m_timeslot_request.params.earliest.timeout_us = 1000000;
}

/**@brief Configure next timeslot event in normal configuration
 */
void configure_next_event_normal(void) {
  m_slot_length = 50000;
  m_timeslot_request.request_type = NRF_RADIO_REQ_TYPE_NORMAL;
  m_timeslot_request.params.normal.hfclk = NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED;
  m_timeslot_request.params.normal.priority = NRF_RADIO_PRIORITY_HIGH;
  m_timeslot_request.params.normal.distance_us = 1000000;
  m_timeslot_request.params.normal.length_us = m_slot_length;
}

/**@brief Timeslot signal handler
 */
void nrf_evt_signal_handler(uint32_t evt_id) {
  uint32_t err_code;

  switch (evt_id) {
  case NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN:
    //No implementation needed
    break;
  case NRF_EVT_RADIO_SESSION_IDLE:
    //No implementation needed
    break;
  case NRF_EVT_RADIO_SESSION_CLOSED:
    //No implementation needed, session ended
    break;
  case NRF_EVT_RADIO_BLOCKED:
    //Fall through
  case NRF_EVT_RADIO_CANCELED:
    err_code = request_next_event_earliest();
    APP_ERROR_CHECK(err_code);
    break;
  default:
    break;
  }
}
uint32_t timeslot_sd_init(void) {
  uint32_t err_code;

  err_code = sd_radio_session_open(radio_callback);
  if (err_code != NRF_SUCCESS) {
    return err_code;
  }

  err_code = request_next_event_earliest();
  if (err_code != NRF_SUCCESS) {
    (void)sd_radio_session_close();
    return err_code;
  }
  return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio transmit and receive in timeslot</title><link>https://test-devzone.nordicsemi.com/thread/370209?ContentTypeID=1</link><pubDate>Tue, 31 May 2022 12:29:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7519af16-c5b2-4422-9055-00bef7c464a5</guid><dc:creator>user7377</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That is unexpected.&amp;nbsp;Do the two transmits (the first successful and second failing) happen in the same timeslot? Or could it be that the SoftDevice is using the radio in the meantime. It does not look like that from the code snippets but perhaps they do not shot the full picture. Can you share more of your code so that I get a fuller picture of what is happening?&lt;/p&gt;
&lt;p&gt;Also, can you check with a debugger if execution is really halted in the while waiting loop and not just check if something afterwards is happening or not (without it, there could theoretically be another problem somewhere else with higher priority that prevents this code snippet from running, so it would be good to know with certainty that you see that execution is &amp;quot;stuck&amp;quot; in this waiting loop.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio transmit and receive in timeslot</title><link>https://test-devzone.nordicsemi.com/thread/370073?ContentTypeID=1</link><pubDate>Tue, 31 May 2022 04:18:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50cdb151-624d-4932-b42e-fca7c8eea69c</guid><dc:creator>user116508</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I removed all printf and checked using 2 devices. In one device the above code (transmission and time slot combined ) and in other the radio receiver example code. And put two devices in debugging mode. I found that only one packet is received in the receiving side. &lt;span&gt;I have checked and confirmed that one transmission is working and for the second transmission, the lines after while loop in the send_packet() function are not functioning&lt;/span&gt;. So the code is getting stuck in that while loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio transmit and receive in timeslot</title><link>https://test-devzone.nordicsemi.com/thread/369994?ContentTypeID=1</link><pubDate>Mon, 30 May 2022 12:54:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b017eabf-1628-46cc-b85b-af7fecbdb3d6</guid><dc:creator>user7377</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see.&amp;nbsp;EVENTS_READY should come some time after you trigger the TXEN task, and there are no other requirements (see figure 8 in &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/radio.html?cp=4_1_0_5_17"&gt;the Radio chapter in the PS&lt;/a&gt;). How did you verify that it blocks here? What happens if you remove the printf statement?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio transmit and receive in timeslot</title><link>https://test-devzone.nordicsemi.com/thread/369819?ContentTypeID=1</link><pubDate>Fri, 27 May 2022 15:39:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be77a2b6-4225-4f99-b45d-982fe4807486</guid><dc:creator>user116508</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry. I was not in that while .. it is in events ready while loop. while (NRF_RADIO-&amp;gt;EVENTS_READY == 0U) . I tested by debugging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio transmit and receive in timeslot</title><link>https://test-devzone.nordicsemi.com/thread/369805?ContentTypeID=1</link><pubDate>Fri, 27 May 2022 13:50:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7da74206-8c26-485a-b36b-78af12566f0b</guid><dc:creator>user7377</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]I think its getting stuck in this while loop.&amp;nbsp;&amp;nbsp; while (NRF_RADIO-&amp;gt;EVENTS_DISABLED == 0U)&amp;nbsp;[/quote]
&lt;p&gt;I do not immediately see how it could be stuck here (you should get the DISABLED event shortly after writing to the DISABLE task. As you write &amp;quot;think&amp;quot; I wonder if you have actually verified with a debugger that this is the case? If not, can you do it?&lt;/p&gt;
&lt;p&gt;If it is indeed the case, then the only reason that comes to mind is if this triggers an interrupt or for some other reason a higher priority piece of code runs before your loop and sets EVENTS_DISABLED to 0 again. That is just an hypothesis, though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>