<?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>how to enable 2mbps</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54295/how-to-enable-2mbps</link><description>Hello everybody. 
 I have two boards. I have been trying to build a communication between my boards for a time. I could not manage to have 2mbps data transfer rate. 
 Boards : nRF52832 DK(PCA10040) and nRF52840 Dongle(PCA10059) SDK version : 15.3.0 SoftDevice</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Feb 2024 22:09:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54295/how-to-enable-2mbps" /><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/469326?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2024 22:09:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0519f902-a224-4984-a921-8b52d72d0c16</guid><dc:creator>Parker Bondi</dc:creator><description>&lt;p&gt;Is this thread still relevant today for setting up a 2MBPS UART Peripheral?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/269125?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 10:05:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a19fc85a-5b73-477c-a56e-a979970acc48</guid><dc:creator>astella</dc:creator><description>&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v6.1.1%2Fgroup___b_l_e___g_a_p___p_e_r_i_p_h_e_r_a_l___p_h_y___u_p_d_a_t_e.html&amp;amp;cp=4_5_3_2_2_1_3_7_1"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/269089?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 07:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:091a589c-d80e-4861-9b07-d32ccf503440</guid><dc:creator>astella</dc:creator><description>&lt;p&gt;Hi, in order to activate 2Mbps phy, you coud get an ordinary 1 Mbps example. Then, after a ble connection is established, in the ble event handler &amp;#39;on_connect&amp;#39; like event you just call something like this&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;m_test_params.phys.tx_phys = BLE_GAP_PHY_2MBPS;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;m_test_params.phys.rx_phys = BLE_GAP_PHY_2MBPS;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;err_code = sd_ble_gap_phy_update(m_conn_handle, &amp;amp;m_test_params.phys);&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;And the trick is done..&amp;nbsp;&lt;/div&gt;
&lt;div&gt;You can add&amp;nbsp;&lt;span&gt;BLE_GAP_EVT_PHY_UPDATE (and not BLE_GAP_EVT_PHY_UPDATE_REQUEST in this case)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;in you ble_evt_handler so to get a confirmation about the phy modification, that has been initiated when calling&amp;nbsp;sd_ble_gap_phy_update&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;To sum up, about using 2Mbps phy, according to my tests now it could be achieved without using a special flag set during advertisement phase, but after the ble connection is established, I just call in the ble device sd_ble_gap_phy_update. So this command notifies the host that the device wants to change phy, if the host just agrees BLE_GAP_EVT_PHY_UPDATE is generated from the device ble stack. So that device knows if what has requested has gone ok.&amp;nbsp;
&lt;div&gt;
&lt;div&gt;The Nordic Sniffer tool shows a change in the used phy&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Maybe there is another procedure, and a device can indeed advertise its 2M capabilities,&lt;/div&gt;
&lt;div&gt;then&amp;nbsp;&lt;span&gt;BLE_GAP_EVT_PHY_UPDATE_REQUEST is generated, to finish phy modification in this case (sd_ble_gap_phy_update is used to finish the procedure in this case).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;But I couldn&amp;#39;t find an example of that.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Hope that Nordic can provide a very simple explanation about this point.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/1_5F00_2.png" alt=" " /&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/220741?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 08:52:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0be58878-5813-4beb-8386-0c55ea68b693</guid><dc:creator>cann0021</dc:creator><description>&lt;p&gt;Functions you wanted to check:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_init(void)
{
    uint32_t               err_code;
    ble_advertising_init_t init;

    memset(&amp;amp;init, 0, sizeof(init));

    init.advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance = false;
    init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;
    init.evt_handler = on_adv_evt;

    init.config.ble_adv_primary_phy      = BLE_GAP_PHY_2MBPS; 
    init.config.ble_adv_secondary_phy    = BLE_GAP_PHY_2MBPS; 
    init.config.ble_adv_extended_enabled = true;             
   

    err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_start(void)
{
    uint32_t err_code = ble_advertising_start(&amp;amp;m_advertising, BLE_ADV_MODE_FAST);
    printf(&amp;quot;err_code: %d\r\n&amp;quot;,err_code); nrf_delay_ms(500);
    APP_ERROR_CHECK(err_code);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am still getting error_code:7&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/220733?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 08:29:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d8506d7-f7eb-49bf-9f9b-2d4f35a23829</guid><dc:creator>cann0021</dc:creator><description>&lt;p&gt;I decided to use the most current SDK (16.0.0). I wrote a function that works to test throughput. It works in peripheral side. Please tell me if I am doing something uncorrect.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint16_t data_point_to_transmit = 244;
uint8_t data_to_transmit[244]   = {0};

void throughput_test() {
  static int payload_per_second = 0;
  ret_code_t my_err_code = 0;
  ret_code_t err_code;
    
  if (isConnected) 
  {
    do 
    {
      err_code = ble_nus_data_send(&amp;amp;m_nus, data_to_transmit, &amp;amp;data_point_to_transmit, m_conn_handle);
      if(err_code != NRF_SUCCESS){
        printf(&amp;quot;err_code: %d\r\n&amp;quot;,err_code);
      }
    } while ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY) &amp;amp;&amp;amp; (err_code == NRF_SUCCESS));
    if (timer_flag == false) 
    {
      payload_per_second = payload_per_second + data_point_to_transmit;
    } 
    else 
    {
      timer_flag         = false;
      printf(&amp;quot;Throughput: %d KB - %d Bytes - %d bits per second\r\n&amp;quot;,
          payload_per_second / 1024,
          payload_per_second,
          payload_per_second * 8);
      
      payload_per_second = 0;
    }
  } 
  else 
  {
    payload_per_second = 0;
  }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;for (;;)
    {
        throughput_test();
        idle_state_handle();
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am getting an error (19). What is wrong with this ?&lt;/p&gt;
&lt;p&gt;Best regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/220588?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2019 13:14:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2a1c468-a552-4d7a-8087-a47ed8678211</guid><dc:creator>cann0021</dc:creator><description>&lt;p&gt;Sorry, I clicked &amp;quot;Verify Answer&amp;quot; button mistakenly. I do not want&amp;nbsp;that the ticket be closed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/220582?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2019 13:10:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b010167a-3d24-4664-bf55-490c4293d5ac</guid><dc:creator>cann0021</dc:creator><description>&lt;p&gt;Hi Mr.Simonr.&lt;/p&gt;
&lt;p&gt;I am using default SDK 15.3.0 examples. I have not changed anything from default _init() and _start() functions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/220095?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 14:09:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d8031c1-5279-43ca-8a96-b00cb61f394b</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Can you upload the full advertising_init() and advertising_start() functions in your application so I can have a look?&lt;/p&gt;
&lt;p&gt;error code 7 does indeed mean that you have an invalid parameter somewhere, so one or more of your m_adv_params. are not set correctly. For example, what is your interval set to? This must be between 0x0020 and 0x4000 to be valid.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/220007?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 08:53:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:586b33b6-f11e-412b-af1e-b249687d4498</guid><dc:creator>cann0021</dc:creator><description>&lt;p&gt;Hi, thanks for the response.&lt;/p&gt;
&lt;p&gt;I have already added that code snippet into my code. As I said before, it causes FATAL_ERROR.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void advertising_start(void) {
  uint32_t err_code = ble_advertising_start(&amp;amp;m_advertising, BLE_ADV_MODE_FAST);
  NRF_LOG_INFO(&amp;quot;err_code: %d&amp;quot;,err_code);
  APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It returns:&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: err_code: 7&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;When I check the meaning of 7:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define NRF_ERROR_INVALID_PARAM               (NRF_ERROR_BASE_NUM + 7)  ///&amp;lt; Invalid Parameter&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It should not be hard that much to have 2 mbps transfer rate. I&amp;#39;m stuck here and I have to find a solution in 6 days.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/219979?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 07:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2eaf1e43-e423-4cb1-93ed-49a83729efc6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Try adding the following to your advertising_init() function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    init.config.ble_adv_primary_phy      = BLE_GAP_PHY_2MBPS;
    init.config.ble_adv_secondary_phy    = BLE_GAP_PHY_2MBPS;
    init.config.ble_adv_extended_enabled = true;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/219887?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 12:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19f1df2f-f29f-4ff1-b2fa-18a915c2c59e</guid><dc:creator>cann0021</dc:creator><description>&lt;p&gt;For the peripheral, there is nothing like adv_params. Instead of it, I added &lt;em&gt;&lt;strong&gt;i&lt;/strong&gt;&lt;strong&gt;nit.config.ble_adv_primary_phy = BLE_GAP_PHY_2MBPS;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;But now, it causes FATAL_ERROR.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/219810?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 07:39:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ad234ac-7ed5-4108-af0b-a9413768b375</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;On the peripheral side, you can add&amp;nbsp;&lt;strong&gt;adv_params.primary_phy =&amp;nbsp;BLE_GAP_PHY_2MBPS;&amp;nbsp;&lt;/strong&gt;to the advertising_init() function. On the central side, you can add&amp;nbsp;&amp;nbsp;&lt;strong&gt;.scan_phys&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;BLE_GAP_PHY_2MBPS&amp;nbsp;&lt;/strong&gt;to the ble_gap_scan_params_t function. You should also add&amp;nbsp;&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;strong&gt; .rx_phys&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;=&amp;nbsp;BLE_GAP_PHY_2MBPS,&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.tx_phys&amp;nbsp;=&amp;nbsp;BLE_GAP_PHY_2MBPS,&lt;/strong&gt;&lt;/div&gt;
&lt;p&gt;to the BLE_GAP_EVT_PHY_UPDATE_REQUEST.&lt;/p&gt;
&lt;div&gt;Please check out &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/39787/verifying-connection-event-length-extension-and-data-length-extension"&gt;this case&lt;/a&gt; for how to enable and check for Data Length Extension and MTU.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Best regards,&lt;/div&gt;
&lt;div&gt;Simon&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/219723?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 15:07:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cabf753-1da6-4bb0-9b0e-40857bae18c8</guid><dc:creator>cann0021</dc:creator><description>&lt;p&gt;Hello Mr. Simonr.&lt;br /&gt;&lt;br /&gt;Thank you for the answer. How can I set BLE_GAP_PHY_2MBPS ? Where to set ? How can I enable Data Length Extension? By the way, I have already read that blog post. But how can I implement those things with nRF ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable 2mbps</title><link>https://devzone.nordicsemi.com/thread/219702?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 14:13:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88174a09-7b99-4d67-9c13-2637026cb755</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;To ensure 2Mbps, please make sure that the PHY you&amp;#39;re using is&amp;nbsp;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;BLE_GAP_PHY_2MBPS&amp;nbsp;&lt;/strong&gt;in both central and peripheral. In order to maximize the throughput, you should also sett the ATT MTU to 247 bytes, enable Data Length Extension (DLE), and increase your connection interval. You can check out&lt;a href="https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/"&gt; this blog post&lt;/a&gt;, where the maximum throughout in BLE 5.0 has been tested using two nRF52840 chips.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>