<?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>number of the tranmitted packets of BLE PER</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94007/number-of-the-tranmitted-packets-of-ble-per</link><description>i use 2x nRF52840 DK as DUT and Lower tester and DUT, my windows laptop as the Upper tester, and use python code from nan_34 Setting up production test using DTM. 
 as below photo from BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 6, Part F DTM Transmitter</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Dec 2022 13:07:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94007/number-of-the-tranmitted-packets-of-ble-per" /><item><title>RE: number of the tranmitted packets of BLE PER</title><link>https://devzone.nordicsemi.com/thread/398769?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 13:07:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04e105aa-4fd8-4526-a9ed-3263886bfd96</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi damienking,&lt;/p&gt;
&lt;p&gt;The &lt;span style="text-decoration:line-through;"&gt;0.625ms&lt;/span&gt; interval between packets comes from the Bluetooth specs for DTM.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7450.pastedimage1669985105518v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;ceil((L + 249)/625) &lt;em&gt;&lt;strong&gt;should&lt;/strong&gt; &lt;/em&gt;be calculated to 1 in our setup, and thus the interval should be 0.625 ms. I need to double check more in the code or with a different engineer&amp;nbsp;to confirm this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Assuming the 0.625ms number is correct, 1180/1600 is horrible. I am not too familiar with DTM, much less&amp;nbsp;the Python approach in nAN 34, so please&amp;nbsp;help with a few questions:&lt;/p&gt;
&lt;p&gt;- Are you sure the test is 1 second? Is it designed that way in the Python application?&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;Can you repeat the test with the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/direct_test_mode/README.html#testing-with-another-development-kit"&gt;Test with another development kit&lt;/a&gt; or the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/direct_test_mode/README.html#testing-with-nrf-connect-for-desktop"&gt;Testing with nRF Connect for Desktop&lt;/a&gt; option?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: number of the tranmitted packets of BLE PER</title><link>https://devzone.nordicsemi.com/thread/398419?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2022 22:49:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6bb3080-9eec-4cc8-a9f0-6aca9ef871a3</guid><dc:creator>damienking</dc:creator><description>&lt;p&gt;Hi Hieu:&lt;/p&gt;
&lt;p&gt;thanks for your help.&lt;/p&gt;
&lt;p&gt;yes, i am using the DTM sample &amp;amp; Testing with nRF Connect for Desktop.&lt;/p&gt;
&lt;p&gt;and now i trying to use the python example from nan34 ( dtm.py) not dtm.c&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_appnotes%2Fstruct%2Fappnotes_nan34.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_appnotes%2Fstruct%2Fappnotes_nan34.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;in dtm.py:&lt;/p&gt;
&lt;p&gt;it used (total running time)/(calculateTimeForPackage) as the total transmitted packet,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="background-color:#ff0000;"&gt;and&amp;nbsp;calculateTimeForPackage is 0.625ms, how does this 0.625 been calculated?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="background-color:#ff0000;"&gt;why it&amp;#39;s 0.625ms?&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;i have tried test PER with conducted connection between 2 nrf52840 Kit, &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;so this means the lost packet should be very little, &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;and the 2nd nRf52840 kit Rx got around 1180 packets per second in this test setup.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;according to the dtm.py, total packet per second should be 1/0.625ms= 1600 packets.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;python code of dtm.py:&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; _calculateTimeForPackage (self):&lt;/p&gt;
&lt;p class="p2"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;&amp;quot;&amp;quot;&amp;quot;Calculate how long time from start of one package to the start of next&amp;quot;&amp;quot;&amp;quot;&lt;/p&gt;
&lt;p class="p3"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color:#ff0000;"&gt;&lt;b&gt;return&lt;/b&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="s3"&gt;0.625&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; _calculatePER(self, receivedPackages):&lt;/p&gt;
&lt;p class="p2"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;&amp;quot;&amp;quot;&amp;quot;Calculates the PER&amp;quot;&amp;quot;&amp;quot;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span style="background-color:#ff0000;"&gt;maxpackages = int (round(self.runtimeinms / self._calculateTimeForPackage ()))&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;lostpackages = maxpackages - receivedPackages&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;lostpackages = max(&lt;span class="s3"&gt;0&lt;/span&gt;, lostpackages)&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;self._debug(&lt;span class="s4"&gt;&amp;quot;Received: %s Max: %s Lost: %s&amp;quot;&lt;/span&gt; % (receivedPackages, maxpackages, lostpackages))&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;per = int (round((float(lostpackages) / float(maxpackages)) * &lt;span class="s3"&gt;100&lt;/span&gt;))&lt;/p&gt;
&lt;p class="p3"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;return&lt;/b&gt;&lt;span class="s2"&gt; per&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: number of the tranmitted packets of BLE PER</title><link>https://devzone.nordicsemi.com/thread/397514?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 22:06:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bcf493c-081a-41c9-84a9-c438676c3f58</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi damienking,&lt;/p&gt;
&lt;p&gt;I found something yesterday.&lt;/p&gt;
&lt;p&gt;You can find in dtm.c the function &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.1.2/samples/bluetooth/direct_test_mode/src/dtm.c#L2080"&gt;on_radio_end_event()&lt;/a&gt;. It is used to handle &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/radio/hal.html#c.nrf_radio_event_t.NRF_RADIO_EVENT_END"&gt;NRF_RADIO_EVENT_END&lt;/a&gt;&amp;nbsp;event. Currently the function is implemented to only count RX packets. But you can&amp;nbsp;expand it to count TX packets as well.&lt;/p&gt;
&lt;p&gt;From my understanding, the &amp;quot;&lt;span&gt;number_of_packers&amp;quot;&amp;nbsp;you see is the RX packet count, and that is sent in &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.1.2/samples/bluetooth/direct_test_mode/src/dtm.c#L1799"&gt;on_test_end_cmd()&lt;/a&gt;. You&amp;nbsp;will also need to look into how to expand that function to report TX packet count as well.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This answer is&amp;nbsp;assuming you use the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/direct_test_mode/README.html"&gt;DTM sample&lt;/a&gt;. Please let me know if you are using a different setup.&lt;/p&gt;
&lt;p&gt;I hope all of that helps.&lt;/p&gt;
&lt;p&gt;Again, as I am out of office Thursday and Friday. Don&amp;#39;t hesitate to reply if you need further support, and I will follow-up on those when I get back to office.&lt;/p&gt;
&lt;p&gt;If you need it urgently, please let me know and&amp;nbsp;we could arrange an alternative.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: number of the tranmitted packets of BLE PER</title><link>https://devzone.nordicsemi.com/thread/397257?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2022 16:38:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1cdcf3c-665f-49d4-95b2-9439bb902149</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi damienking,&lt;/p&gt;
&lt;p&gt;My apology for returning later than I said I would.&lt;/p&gt;
&lt;p&gt;I was able to learn and understand a little about DTM and the structure of the DTM sample now.&lt;/p&gt;
&lt;p&gt;However, I now see that the packet transmit is done by PPI instead of a timer handler, I am not sure how we can get&amp;nbsp;be informed of the TX event to do the counting.&lt;br /&gt;Replacing the PPI setup with a handler setup might&amp;nbsp;be a problem since the timer period is&amp;nbsp;625 us, very short.&lt;/p&gt;
&lt;p&gt;I will ask our internal team about this. As I am out of office Thursday and Friday, I will follow up with you latest by Tue 29 Nov.&lt;/p&gt;
&lt;p&gt;If you need it urgently, please let me know and&amp;nbsp;we could arrange an alternative.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: number of the tranmitted packets of BLE PER</title><link>https://devzone.nordicsemi.com/thread/396486?ContentTypeID=1</link><pubDate>Fri, 18 Nov 2022 19:53:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51303fc6-5f8f-4ddf-bab9-1cf13b41e482</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi damienking,&lt;/p&gt;
&lt;p&gt;Just want to let you know I&amp;nbsp;am assigned to this ticket. This part of BLE is&amp;nbsp;one I am unfamiliar with. I will need some time to look into it. I will get back to you latest by the end of Tue 22 Nov&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: number of the tranmitted packets of BLE PER</title><link>https://devzone.nordicsemi.com/thread/396326?ContentTypeID=1</link><pubDate>Fri, 18 Nov 2022 04:20:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d1a9608-8f33-43df-848c-7c75250e87e6</guid><dc:creator>damienking</dc:creator><description>&lt;p&gt;i just find out that number_of_packers will always be 0x0000 for tranmitter test, so we have to count the total transmitted packet on our own.&lt;/p&gt;
&lt;p&gt;any advice for counting the packet for different BLE format?&amp;nbsp; thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>