<?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>can&amp;#39;t send packet in specified time interval</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75685/can-t-send-packet-in-specified-time-interval</link><description>Hi all. 
 I want to send my packets in the negotiated time interval. 
 I sat the NRF_SDH_BLE_GAP_EVENT_LENGTH to 6. 
 The negotiated TI is 36 ms. 
 the results are 
 1- the number of packets when I receive the hvx_complete event is always 1. (in the picture</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 May 2021 16:33:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75685/can-t-send-packet-in-specified-time-interval" /><item><title>RE: can't send packet in specified time interval</title><link>https://devzone.nordicsemi.com/thread/312455?ContentTypeID=1</link><pubDate>Fri, 28 May 2021 16:33:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81876543-466c-4d68-8c16-71f17881df72</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="ali_dehghan_nayeri"]yes, debug is enabled.[/quote]
&lt;p&gt;Are you getting any error messages in your log, when you have DEBUG defined?&lt;/p&gt;
[quote user="ali_dehghan_nayeri"]can you adwise me for changing that?[/quote]
&lt;p&gt;If you intend to send multiple packets each connection event, you will indeed need to have a queue size longer than 1. If you are not explicitly setting the queue size anywhere in your code it will use the default value, which is 1. This means that only 1 packet can be queued for sending each connection event. If you would like to change this, you can use the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fgroup___b_l_e___c_o_m_m_o_n___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga4edae2bac8c68b672c0fa101ed2c687f"&gt;sd_ble_cfg_set&lt;/a&gt;&amp;nbsp;function to do so. &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/27628/changing-hvn_tx_queue_size-with-s132-v5-1"&gt;You can see how this could be done in the answer by my colleague Petter in this ticket&lt;/a&gt;. You must make this configuration before enabling the SoftDevice, as mentioned in the functions API reference.&lt;br /&gt;&lt;br /&gt;Are you familiar with &lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE"&gt;the nRF Sniffer tool&lt;/a&gt;? It is a powerful tool to wield when developing with BLE, as it lets you see all the on-air BLE traffic. It would help a lot if you could setup a sniffer, to see how many packets are being sent every connection event.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can't send packet in specified time interval</title><link>https://devzone.nordicsemi.com/thread/312348?ContentTypeID=1</link><pubDate>Fri, 28 May 2021 11:43:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b6dd686-7a21-4cb9-b343-a327515f90a2</guid><dc:creator>ali_dehghan_nayeri</dc:creator><description>&lt;p&gt;thanks for your response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;yes, debug is enabled.&lt;/p&gt;
&lt;p&gt;changing the queue size was my goal in the first but I couldn&amp;#39;t change it.&lt;/p&gt;
&lt;p&gt;I issued that on&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/75621/nrf_error_svc_handler_missing-in-sd_ble_cfg_set"&gt;this page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;can you adwise me for changing that?&lt;/p&gt;
&lt;p&gt;thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can't send packet in specified time interval</title><link>https://devzone.nordicsemi.com/thread/312275?ContentTypeID=1</link><pubDate>Fri, 28 May 2021 07:18:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecdecc31-a10e-4579-bbe4-29d78af14584</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="ali_dehghan_nayeri"]Interrupt of timer0&amp;nbsp; was the problem.[/quote]
&lt;p&gt;Yes, &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/sd_resource_reqs/hw_block_interrupt_vector.html"&gt;TIMER0 is in use by the SoftDevice&lt;/a&gt;, and may not be used by the application when the SoftDevice is enabled, this will cause the SoftDevice to assert.&lt;br /&gt;&lt;br /&gt;You mention that you get error for resources, could you make sure to have DEBUG defined in your preprocessor defines, like shown in the included image?&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/6327.enabling_5F00_debug_5F00_SES.PNG" /&gt;&lt;br /&gt;This will make the logger output a detailer error message whenever a non-NRF_SUCCESS error is passed to an APP_ERROR_CHECK.&lt;br /&gt;If you are getting NRF_ERROR_RESOURCES from &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fgroup___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga313fe43c2e93267da668572e885945db"&gt;sd_ble_gatts_hvx&lt;/a&gt; then that means that you are queueing notifications faster than you are sending them, leading to the buffer filling up.&lt;/p&gt;
[quote user="ali_dehghan_nayeri"]so can we set sending ble packet priority more than the interrupt priority of timer0?[/quote]
&lt;p&gt;You do not need to worry about prioritizing to send packets - the SoftDevice handles all this for you.&lt;br /&gt;I think the issue here is that your notification buffer is full, so that you are unable to queue all the packets you want to have sent. What &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fstructble__gatts__conn__cfg__t.html&amp;amp;anchor=ae2a1156d8b06a6ccc70696f2372226cc"&gt;queue size are you using&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can't send packet in specified time interval</title><link>https://devzone.nordicsemi.com/thread/312177?ContentTypeID=1</link><pubDate>Thu, 27 May 2021 15:18:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2288ea2-9677-428e-bdcc-6ec9c04a8cda</guid><dc:creator>ali_dehghan_nayeri</dc:creator><description>&lt;p&gt;so can we set sending ble packet priority more than the interrupt priority of timer0?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can't send packet in specified time interval</title><link>https://devzone.nordicsemi.com/thread/312061?ContentTypeID=1</link><pubDate>Thu, 27 May 2021 11:39:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:290e2e39-4e35-4fa6-9deb-9db12aa4ee81</guid><dc:creator>ali_dehghan_nayeri</dc:creator><description>&lt;p&gt;Interrupt of timer0&amp;nbsp; was the problem.&lt;/p&gt;
&lt;p&gt;I got a lot of interrupts from timer0 and nrf couldn&amp;#39;t send my packets in the expected time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>