<?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>Esb Packet gap issue and packet “mtu”</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92858/esb-packet-gap-issue-and-packet-mtu</link><description>Hi， 
 I developed with ncs 2.1 samples esb ptx and prx using nrf52840 make a low latency application，There are two problems 
 
 ①On the ptx side, packets are sent twice in a row；At the receiving end, the packet gap is about 8 milliseconds。How much milliseconds</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Oct 2022 07:43:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92858/esb-packet-gap-issue-and-packet-mtu" /><item><title>RE: Esb Packet gap issue and packet “mtu”</title><link>https://devzone.nordicsemi.com/thread/390908?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 07:43:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0394d604-5b89-4b74-b434-c8c5bafd2d83</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Don&amp;#39;t print in the event_handler. This applies to both PRX and PTX project.&lt;/p&gt;
&lt;p&gt;This is because the default setting is that you log in-place.&lt;/p&gt;
&lt;p&gt;You can override this by setting:&lt;/p&gt;
&lt;p&gt;&amp;quot;CONFIG_LOG_MODE_DEFERRED=y&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Your PTX seems to send only when flag &amp;quot;ready&amp;quot; is set. However, the main loop also includes a k_sleep():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (ready) {
	/* Send logic here */
}
k_sleep(K_MSEC(1000));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Try changing the k_sleep(..) to a k_cpu_idle() call instead.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Esb Packet gap issue and packet “mtu”</title><link>https://devzone.nordicsemi.com/thread/390881?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 02:02:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11e8664e-8561-46f5-8200-1acc4e5fe086</guid><dc:creator>sean</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; According to your modification, 252 bytes work fine。On the tx side, I&amp;#39;m sending data in the send success callback, which is a huge gap every 252 bytes，About 6.7 ms，How to reduce every 252 bytes gap？As shown in the picture below&lt;/p&gt;
&lt;p&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/_014F1A4EAE5FE14F2A62FE565F00_16659718663003.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Esb Packet gap issue and packet “mtu”</title><link>https://devzone.nordicsemi.com/thread/390777?ContentTypeID=1</link><pubDate>Fri, 14 Oct 2022 10:12:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9639a543-d8cc-4aa1-a66e-bab22c004347</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]①On the ptx side, packets are sent twice in a row；At the receiving end, the packet gap is about 8 milliseconds。How much milliseconds the esb minimum packet gap ?How to reduce packet gap？[/quote]
&lt;p&gt;&amp;nbsp;The time for one transaction depends on the packet length. If your overall on-air payload is 250 bytes, the calculation is:&lt;/p&gt;
&lt;p&gt;Tramp-up + Tpayload = 130 us + 250 bytes * 8 bit * 1/2Mbit = 1130 us.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also have to account for the ACK from the PRX.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]②Use the maximum 252 packets to send it return “Payload write failed, err -122”，esb_start_tx() it retun -61，It took many days to debug there is no progress，The attachments are code and configuration[/quote]
&lt;p&gt;ptx/src/main.c::154 sets the payload length to 126. Try setting this to 252.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, you should set the .protocol to &amp;quot;ESB_PROTOCOL_ESB_DPL&amp;quot; and consider using 2 byte CRC. This change must be applied to both PRX and PTX.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>