<?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>USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60143/usb-throughput-for-nrf52840</link><description>I have developed USB firmware for the 840 based on the USBD example so that we can use WINUSB (WCID) for the host. The design is for USB 2.0 full speed with EPIN1 for device to host transfers and EPOUT1 for host to device transfers The firmware passes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Apr 2020 07:14:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60143/usb-throughput-for-nrf52840" /><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/247454?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2020 07:14:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49e0497f-c401-4834-9654-fd70a22ead23</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="henryh"]I am using v16[/quote]
&lt;p&gt;That is good.&lt;/p&gt;
&lt;p&gt;Do you have performance issues with sizes ending up in a short packet or ZLP?&lt;/p&gt;
&lt;p&gt;By looking at usbd.c::usbd_send_data_to_host(), it seems that ZLP isn&amp;#39;t handled.&lt;/p&gt;
&lt;p&gt;Try implementing something like this when sending:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    else
    {
      // Send data
      usb_tx_xfer.p_data.tx = buff;
      usb_tx_xfer.size = size;

      tx_flag = true;
      /* Check if ZLP flag should be set */
      if ((size &amp;gt; NRF_DRV_USBD_EPSIZE) &amp;amp;&amp;amp; (size % NRF_DRV_USBD_EPSIZE == 0)) 
      {
        usb_tx_xfer.flags |= NRFX_USBD_TRANSFER_ZLP_FLAG;
      } else {
        /* ZLP not needed, in case your structure is using global memory and not stacked, we clear the .flags */
        usb_tx_xfer.flags = 0;
      }
      ret_val=nrf_drv_usbd_ep_transfer(NRF_DRV_USBD_EPIN1,&amp;amp;usb_tx_xfer);
    
      ret_val=NRF_SUCCESS;
    }&lt;/pre&gt;&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><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/247343?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 12:42:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a44c145-af99-4b03-8e8f-50b8ef0dc2c3</guid><dc:creator>henryh</dc:creator><description>&lt;p&gt;I am using v16&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/247333?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 12:25:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35c61f16-24ee-4af8-8b63-703b4820c01a</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;I&amp;#39;m glad to hear that some of the issues are resolved.&amp;nbsp;&lt;/p&gt;
[quote user="henryh"]The delays we have been seeing seem to be related to packets falling on the EP size (ZLP?) and maybe short packets.&amp;nbsp; I noticed that ZLP handling can be enabled using a flag in the transfer data structure.&amp;nbsp; Is this normally enabled?&amp;nbsp;[/quote]
&lt;p&gt;Zero length packets (ZLP) depends on how you send data. If your application sends larger frames, and set the packet size to be bMaxPacketSize=512, but you want to send 1024 bytes of data (1024 modulo 512 = 0), then you send a ZLP at the end to state that the transfer is finished. In the case you send 513 bytes, the next transfer is 1 byte (a short packet), so no ZLP needed in that scenario.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you send packets that are equal or less than bMaxPacketSize, no ZLP is needed. If larger, then yes, but only sent if size % bMaxPacketSize == 0.&lt;/p&gt;
&lt;p&gt;If no ZLP is sent to indicate that the transfer is complete, you&amp;#39;ll see a &amp;quot;lag&amp;quot; in the data on the host side, where you get the former data on the current transfer, etc. It will not look as &amp;quot;seamless&amp;quot; as it should be if you are inspecting the data. Example: If you&amp;#39;re sending data over CDC (usb serial port) and looking at it, then it looks a bit strange if you send strings with length of 2*bMaxPacketSize without ZLP.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="henryh"]We also use some Atmel products and noted an improvement in performance when short packet handling was enabled.&amp;nbsp; Is there a related issue with short packets when using the Nordic USB library?&amp;nbsp;[/quote]
&lt;p&gt;Short packets should be handled. Which SDK version are you using?&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><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/247142?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2020 14:22:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1540c793-f5a3-46b5-9fdd-65254e992dcb</guid><dc:creator>henryh</dc:creator><description>&lt;p&gt;This problem has been mostly resolved but there are a couple of questions still.&amp;nbsp; The throughput issue is related to how packet are handled by the test tool and we have had some success in fixing it.&amp;nbsp; On the Nordic side, I was using the nrfx_usbd_ep_transfer() function incorrectly, slicing transfers up instead of just calling the function with a stable transfer buffer and blocking until the transfer completes.&amp;nbsp; In the future I may move this to a handled function to avoid blocking but the simpler implementation will do for now in this application.&amp;nbsp; I have been able to get reasonable transfer times (1.28 MS for 512 byte packets @ 4 MS; the &amp;quot;transfer time&amp;quot; is elapsed time for the stack to go back to idle after calling nrfx_usbd_ep_transfer() ).&lt;/p&gt;
&lt;p&gt;The delays we have been seeing seem to be related to packets falling on the EP size (ZLP?) and maybe short packets.&amp;nbsp; I noticed that ZLP handling can be enabled using a flag in the transfer data structure.&amp;nbsp; Is this normally enabled?&amp;nbsp; We also use some Atmel products and noted an improvement in performance when short packet handling was enabled.&amp;nbsp; Is there a related issue with short packets when using the Nordic USB library?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/247133?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2020 14:06:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fe2dad4-089f-49c3-bc43-d8ff55baa5a0</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;Could you share a updated .zip file of your project, including the sdk_config? Is your printf routed to UART (this will increase latency)?&lt;/p&gt;
&lt;p&gt;Which SDK version are you using?&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><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/246362?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2020 21:18:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87b031ea-67f6-4357-8ad2-6cb0610feed6</guid><dc:creator>henryh</dc:creator><description>&lt;p&gt;Can you provide some insight into the nrfx_usbd_ep_transfer function?&amp;nbsp; I am trying to run 512 byte data over bulk endpoints at a sustained frame rate (say 5 MS) and am having some trouble.&amp;nbsp; The code is based on your USBD example with modifications to convert to bulk transfers, add EPOUT2 and EPIN1 endpoints and modify the descriptors to identify as a WINUSB (WCID) device.&amp;nbsp; The code connects to the WINUSB driver and correctly responds to manually triggered data but is dropping frames in this sustained testing.&amp;nbsp; My understanding is that the ep_transfer() function accepts any size packet and will packetize it (64 byte packets for bulk) and also attach a zero length packet (ZLP) in this case since the data size is a multiple of the endpoint buffer size.&amp;nbsp; In my code, I transfer the buffer and then wait for the endpoint transfer to complete using nrfx_drv_usbd_ep_is_busy() function before exciting my transfer function.&amp;nbsp; This sequence would seem to make my transfer function block and therefore ensure that the endpoint is ready for another transaction once I have exited to main.&amp;nbsp; The system is behaving like it has a race condition and it is sensitive to the frame time but performance does not improve when extending the frame (even to 100 MS).&amp;nbsp; I am also seeing large delays in the completion time for the USB transfer, up to around 7 MS in some cases.&amp;nbsp; Any suggestions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/245861?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 13:46:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28babc44-be3e-43f0-b15e-0239e3436011</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am not very familiar with this driver, so I am not certain. Could it be that that the call to&amp;nbsp;&lt;span&gt;nrfx_usbd_ep_transfer&lt;/span&gt; failed with error and you did not handle it? saying this since your code ignores the return value to the call&amp;nbsp;&lt;span&gt;nrfx_usbd_ep_transfer.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/245663?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 20:44:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4131240-6225-4d76-a32e-7cdd7411ab84</guid><dc:creator>henryh</dc:creator><description>&lt;p&gt;I am using your USB stack from the USBD example.&amp;nbsp; All I have done is add an EPOUT2 endpoint to the code.&amp;nbsp; I am using nrfx_usbd_ep_transfer() to push 64 bytes into/out of the stack. Can I get some help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/245661?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 20:42:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a73beff2-8237-4155-9c05-a8b59cfbc418</guid><dc:creator>henryh</dc:creator><description>&lt;p&gt;Can I get some help here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/245023?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 13:46:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd678f64-b548-4d1c-92d6-3f3fa0589f41</guid><dc:creator>henryh</dc:creator><description>&lt;p&gt;I&amp;#39;ve chosen to build this on the USBD example to avoid uses classes since I have never used them.&amp;nbsp; The examples that use app_usbd are all based on class usage and seem pretty complex as opposed to the USBD example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/245019?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 13:38:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20c79645-8f1f-4eb8-8e2d-a555bb4319be</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;well it is not the matter of &amp;quot;have to&amp;quot;. It is just that using app_usbd for handled trasactions would make the behavior more predictable and easier for us&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/245012?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 13:28:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f29ed413-4e9f-4638-9f6f-f05cd38c8e7d</guid><dc:creator>henryh</dc:creator><description>&lt;p&gt;Do I have to use app_usbd for handled transactions to work?&amp;nbsp; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/244994?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 12:35:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a69f5bbe-c9e1-41a1-8e57-1a1c6d8cb77d</guid><dc:creator>henryh</dc:creator><description>&lt;p&gt;I&amp;#39;m using the NORDIC USB stack; built my code on the USBD example which uses the USBD driver.&amp;nbsp; There is no example that implements WINUSB (WCID) which was a requirement for the implementation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/244955?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 11:20:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccec7954-790d-4a6f-8133-1f79822d1fc7</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Henry,&lt;/p&gt;
&lt;div&gt;Seems like you are using your own USB stack? I think you should try app_usbd and see if it works&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB throughput for nRF52840</title><link>https://devzone.nordicsemi.com/thread/244820?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 21:16:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39f9df02-dafc-4f8d-85df-203859a55834</guid><dc:creator>henryh</dc:creator><description>&lt;p&gt;update:&amp;nbsp; I was able to get the USBD code to hook up to WINUSB and it is currently running about 200 KB/s using nrfx_usbd_ep_transfer() with the event handler.&amp;nbsp; I would increase throughput by implementing handled transactions but was unable to get that working.&amp;nbsp; After calling nrfx_usbd_ep_handled_transfer() for EPIN1 I can follow execution into the callback function but the endpoint never seems to send the data.&amp;nbsp; I can&amp;#39;t find anything wrong with the functions involved but have included them below.&amp;nbsp; Any ideas?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;//&amp;nbsp; *****************************************************************&lt;br /&gt;//&amp;nbsp; function: usbd_start_tx&lt;br /&gt;//&amp;nbsp; purpose:&amp;nbsp; start a handled TX transaction.&amp;nbsp; This code starts up&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the TX using a handled transaction that automatically&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; will pull data from the TX FIFO until it is emptied&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using a call back function.&lt;br /&gt;//&amp;nbsp; passed:&amp;nbsp;&amp;nbsp; nothing&lt;br /&gt;//&amp;nbsp; returns:&amp;nbsp; nothing&lt;br /&gt;//&amp;nbsp; notes:&amp;nbsp;&amp;nbsp;&amp;nbsp; none&lt;br /&gt;//&amp;nbsp; *****************************************************************&lt;br /&gt;inline void usbd_start_tx(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; if(nrf_drv_usbd_ep_is_busy(NRFX_USBD_EPIN1)==false)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(fifo_empty(TX_FIFO)==false)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //data available so start a handled transaction&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tx_flag=true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nrfx_err_t err_code=nrfx_usbd_ep_handled_transfer(NRFX_USBD_EPIN1,&amp;amp;usbd_tx_handler);&lt;br /&gt;/*&lt;br /&gt;//non-handled transactions&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t size=fifo_rd_tx_fifo((uint8_t*)usb_tx_buff,64);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (size&amp;gt;0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //push next packet into stack&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; usb_tx_xfer.size=size;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tx_flag=true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nrfx_usbd_ep_transfer(NRFX_USBD_EPIN1,&amp;amp;usb_tx_xfer);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;*/&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; return;&lt;br /&gt;&lt;br /&gt;}//end function&lt;br /&gt;&lt;br /&gt;//&amp;nbsp; *****************************************************************&lt;br /&gt;//&amp;nbsp; function: usbd_tx_feeder&lt;br /&gt;//&amp;nbsp; purpose:&amp;nbsp; push data into the USB stack for TX based on calls from&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the stack itself.&amp;nbsp; This should increase TX throughput&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by avoiding using SW events for TX processing.&lt;br /&gt;//&amp;nbsp; passed:&amp;nbsp;&amp;nbsp; p_next&amp;nbsp; transfer structure&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_context&amp;nbsp;&amp;nbsp; pointer to context&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ep_size&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endpoint size&lt;br /&gt;//&amp;nbsp; returns:&amp;nbsp; true&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; more data for xfer&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; false&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; no more data&lt;br /&gt;//&amp;nbsp; notes:&amp;nbsp;&amp;nbsp;&amp;nbsp; this function is part of a &amp;quot;handled&amp;quot; TX transfer and &lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is a callback for TX transfers once they have been&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; started&lt;br /&gt;//&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cannot transfer data from flash - RAM ONLY!&lt;br /&gt;//&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; we return false with ep_size=0 for no data this can occur&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if the FIFO is loaded with only 64 bytes&lt;br /&gt;////&amp;nbsp; *****************************************************************&lt;br /&gt;bool usbd_tx_feeder(nrfx_usbd_ep_transfer_t *p_next, void*p_context,size_t ep_size)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; //get a 64 byte temporary buffer&lt;br /&gt;&amp;nbsp; uint8_t *buff;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; //pop data off the TX fifo&amp;nbsp; into the temp buffer&lt;br /&gt;&amp;nbsp; buff=nrfx_usbd_feeder_buffer_get(); &amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; //get some data&lt;br /&gt;&amp;nbsp; ep_size=fifo_rd_tx_fifo((uint8_t*)usb_tx_buff,64);&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; //update parameters&lt;br /&gt;&amp;nbsp; usb_tx_xfer.p_data.tx=(uint8_t*)usb_tx_buff;&lt;br /&gt;&amp;nbsp; usb_tx_xfer.size=ep_size;&lt;br /&gt;&amp;nbsp; p_next=&amp;amp;usb_tx_xfer;&lt;br /&gt;//&amp;nbsp; p_context=NULL;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; //is there any more data in TX FIFO?&lt;br /&gt;&amp;nbsp; if(fifo_empty(TX_FIFO))&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //flag feeder needs priming&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tx_flag=false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(false);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; else&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(true);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}//end function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>