<?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 Full-Speed Transfer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91753/usb-full-speed-transfer</link><description>Hello 
 I am looking to use [as much as possible of] the full-speed USB bandwidth of 12 Mbps (or 1.5 MBps). 
 I have been able to use the USB MSC for my initial testing (with the only modification of expanding the file system size to the full 8 MB of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Oct 2025 10:08:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91753/usb-full-speed-transfer" /><item><title>RE: USB Full-Speed Transfer</title><link>https://devzone.nordicsemi.com/thread/551557?ContentTypeID=1</link><pubDate>Wed, 15 Oct 2025 10:08:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e894e01-d2f2-49ca-b599-62aa869b1fc1</guid><dc:creator>Kyrre Aalerud</dc:creator><description>&lt;p&gt;I know this is old, but I have successfully pushed the nRF5340 to over 600kByte/s using a hybrid ISR approach.&lt;/p&gt;
&lt;p&gt;Data is being read asynchronously from a external flash and queued up in chunks and the ISR checks the capacity of the tx fifo using the latest api from SDK 3.x sending a semaphore to the actual transmit thread. This is done since the transmit thread is doing other work too which was not feasible in a isr. However the key is to make sure the fifo is always filled instead of relying on the ISR to add more data to it. There is a problem with filling it 100% also, as this creates data corruption due to the pointer-style fifo design. By increasing the fifo size to a few bytes more than the chunk size times number of buffers used and waiting for fifo to have free space of at least chunk size +1 we ensure no corruption and keep the fifo full always. Resulting transfer is a&amp;nbsp;good 600-616 kByte/second.&lt;br /&gt;The tx thread being triggered by the semaphore allows no delays&amp;nbsp;to be used, and buffers copied to fifo can then be re-filled asynchronously again. The call to fifo_fill has to be surrounded by interrupt protection as this call is originally intended to be called from within the ISR. The available space is also updated from inside ISR by calling the&amp;nbsp;uart_irq_update() and&amp;nbsp;uart_irq_tx_ready() from within the ISR and storing result for use by the tx thread then seems adequate to make it thread-safe.&lt;/p&gt;
&lt;p&gt;I wish there was a way to adjust bandwidth allocation on the CDC ACM as I believe there is more speed to be had. It seems to be 50/50 up/downstream somehow?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB Full-Speed Transfer</title><link>https://devzone.nordicsemi.com/thread/387125?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 14:20:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:830f499f-2175-48be-b524-48a39ac71d95</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="Robert de Brum"]Full-Speed USB should be able to achieve up to 1.2 MBps. This is calculated by the same 64B per frame that you mentioned, so where does the 125 us that you mention come into play? It is also mentioned in here that Full-Speed does not use microframes.[/quote]
&lt;p&gt;My apologies for misinforming you. You&amp;#39;re right, the full speed PHY does not have microframes, but high speed (ie. usb 2.0) has.&lt;/p&gt;
&lt;p&gt;The USBD peripheral is USB 2.0 compliant, but operates on USB 1.1 PHY, and I mixed up the properties of these two.&amp;nbsp;&lt;/p&gt;
[quote user="Robert de Brum"]How fast can we expect transfer speeds to be with an HID[/quote]
&lt;p&gt;HID is interrupt based, which has a restriction of 64 kB/s max (64 bytes each 1 ms).&lt;/p&gt;
[quote user="Robert de Brum"]CDC USB sample running on the n4f5340?[/quote]
&lt;p&gt;CDC is also bulk. You will get similar numbers&amp;nbsp;as with MSC.&lt;/p&gt;
[quote user="Robert de Brum"]At the very least, could we implement DPPI or EasyDMA in any way to get closer to the calculated max speed of 500KBps? How would you propose we implement these components?[/quote]
&lt;p&gt;I have reported to R&amp;amp;D that they should look at the overall throughput, but the limiting factor here looks to be the processing in the zephyr usb subsys and the nrfx layer.&lt;/p&gt;
&lt;p&gt;When doing a test at 128 MHz (by setting HFCLKCTRL register:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/clock/doc/clock.html?cp=3_0_0_3_10_2_43#register.HFCLKCTRL"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/clock/doc/clock.html?cp=3_0_0_3_10_2_43#register.HFCLKCTRL&lt;/a&gt;) I was able to get a bit&amp;nbsp;better throughput.&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 Full-Speed Transfer</title><link>https://devzone.nordicsemi.com/thread/386955?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 17:53:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1f52c0e-44ea-421f-be6f-7d0f61b82279</guid><dc:creator>Robert de Brum</dc:creator><description>&lt;p&gt;Hello Hakon,&lt;/p&gt;
&lt;p&gt;Thanks very much for your help on this. I appreciate your time.&lt;/p&gt;
&lt;p&gt;Could you advise/elaborate a little further on some of these topics then? I would love to be able to make some progress as quickly as possible:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We went with the nrf5340 thinking that we could utilize the Full-Speed USB bus to transfer up to 230MB in under 6 minutes (This is&amp;nbsp; 232 / (6*60) = 0.640 MBps). The specification of 12Mbps was very appealing to us. Is there is any hope that we can achieve 640+ KBps USB speeds?&lt;/li&gt;
&lt;li&gt;How fast can we expect transfer speeds to be with an HID or CDC USB sample running on the n4f5340? This would get us away from the Bulk Endpoint, correct?&lt;/li&gt;
&lt;li&gt;According to the USB&amp;nbsp;Developers Guide (&lt;a id="" href="https://doc.lagout.org/science/0_Computer%20Science/9_Others/9_Misc/USB%20Complete%20The%20Developer%27s%20Guide%204th%20Ed.pdf"&gt;https://doc.lagout.org/science/0_Computer%20Science/9_Others/9_Misc/USB%20Complete%20The%20Developer%27s%20Guide%204th%20Ed.pdf&lt;/a&gt;&amp;nbsp;- page 74), Full-Speed USB should be able to achieve up to 1.2 MBps. This is calculated by the same 64B per frame that you mentioned, so where does the 125 us that you mention come into play? It is also mentioned in here that Full-Speed does not use microframes.&lt;/li&gt;
&lt;li&gt;At the very least, could we implement DPPI or EasyDMA in any way to get closer to the calculated max speed of 500KBps? How would you propose we implement these components?&lt;/li&gt;
&lt;/ol&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/pastedimage1663609870472v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB Full-Speed Transfer</title><link>https://devzone.nordicsemi.com/thread/385431?ContentTypeID=1</link><pubDate>Fri, 09 Sep 2022 07:36:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd0e894c-2729-4deb-b716-92d773b4ba1a</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="Robert de Brum"]the nrf5340 supports 12 Mbps (full speed). How can I accomplish this?[/quote]
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;Well, the PHY can technically do this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;However, with a restriction of 64 bytes on a non-isochronous EP, you&amp;#39;re limited to sending 64 bytes each microframe (125 us).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;This gives: 64b / 0.125 ms = 500 kB/s.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Given that there&amp;#39;s also a filesystem + external flash in the loop here, it is safe to assume that you&amp;#39;re reaching the roof of what the&amp;nbsp;USBD peripheral can do on a generic bulk EP. I was able to see similar readings as you, ranging up to 400 kB/s.&lt;/p&gt;
[quote user="Robert de Brum"]Is that relevant to ncs 2.0.0 and the nrf5340?[/quote]
&lt;p&gt;Yes, it is the same USBD peripheral that is present in both the nRF52840 and nRF5340.&lt;/p&gt;
[quote user="Robert de Brum"]Thanks for the clarification. Could you elaborate on &amp;quot;sync&amp;quot;, I am not familiar with that command.[/quote]
&lt;p&gt;&amp;quot;sync&amp;quot; ensures that any on-going transfers between disks or other mediums are actually finished, and not a cached operation.&lt;/p&gt;
&lt;p&gt;What filesystems can do is to copy the content to a temp location, and schedule the operation &amp;quot;in-the-background&amp;quot;. This is one of the reasons why you should never unplug a USB stick without first clicking the &amp;quot;safely eject&amp;quot; option.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;*edit* Striked out the incorrect part. Sorry for misinforming you!&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 Full-Speed Transfer</title><link>https://devzone.nordicsemi.com/thread/385404?ContentTypeID=1</link><pubDate>Fri, 09 Sep 2022 00:32:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65447a2c-c5f6-4b88-b7c2-28d685adaf44</guid><dc:creator>Robert de Brum</dc:creator><description>&lt;p&gt;As a note, this is my code - adapted from the USB MSC and flash sample.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/mass.zip"&gt;devzone.nordicsemi.com/.../mass.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB Full-Speed Transfer</title><link>https://devzone.nordicsemi.com/thread/385403?ContentTypeID=1</link><pubDate>Fri, 09 Sep 2022 00:30:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23f1a902-aaa0-4f8c-b3fb-2391294de711</guid><dc:creator>Robert de Brum</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
&lt;p&gt;I wanted to reach out again regarding some topics that I spoke about with a local FAE. In short summary, I am searching for what would be the bottleneck in why I am experiencing a USB speed of 0.3 MBps instead of the theoretical 1.5 MBps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Using the basic USB MSC Sample, if I increase the sck-frequency, I assume the USB transfer speed would speed up.
&lt;ol&gt;
&lt;li&gt;The default frequency was 8 MHz, and I was able to bump this up to 32 MHz. I saw that the transfer speed went from 383 KBps to 407 KBps.&lt;/li&gt;
&lt;li&gt;I notice that I am unable to set a sck-frequency of &amp;gt; 32 MHz even though it is supposed to be able to go up to 96 MHz. I am hoping that setting to the full speed of 96 MHz will help with my USB transfer speeds.&lt;/li&gt;
&lt;li&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;qspi {
	status = &amp;quot;okay&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;qspi_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;qspi_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	mx25r64: mx25r6435f@0 {
		compatible = &amp;quot;nordic,qspi-nor&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		/* MX25R64 supports only pp and pp4io */
		writeoc = &amp;quot;pp4io&amp;quot;;
		/* MX25R64 supports all readoc options */
		readoc = &amp;quot;read4io&amp;quot;;
		sck-frequency = &amp;lt;32000000&amp;gt;;
		label = &amp;quot;MX25R64&amp;quot;;
		jedec-id = [c2 28 17];
		sfdp-bfp = [
			e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
			10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
		];
		size = &amp;lt;67108864&amp;gt;;
		has-dpd;
		t-enter-dpd = &amp;lt;10000&amp;gt;;
		t-exit-dpd = &amp;lt;35000&amp;gt;;
	};
};&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;I am also looking to verify that the flash chip is set to QSPI mode to enable all 4 IO channels.
&lt;ol&gt;
&lt;li&gt;Specifically, I am pursuing the 80 MHz FAST_READ capability of the MX25R64 chip.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you let me know what your input on these topics are? I am sure that I should be able to use the 1.5 MBps USB speed easily, however I am seeing in this blog (despite the different platform and SDK) that only a speed of 4Mbps can be achieved. (&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/73742/nrf52840-usb-throughput"&gt;nRF52840 USB throughput&lt;/a&gt;&amp;nbsp;). Is that relevant to ncs 2.0.0 and the nrf5340?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB Full-Speed Transfer</title><link>https://devzone.nordicsemi.com/thread/385357?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2022 15:27:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d809192-2529-47d3-b3f4-c58ab9ae2489</guid><dc:creator>Robert de Brum</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Thanks for the clarification. Could you elaborate on &amp;quot;sync&amp;quot;, I am not familiar with that command.&lt;/p&gt;
&lt;p&gt;The requirement for transfer speed is to simply be as fast as possible -&amp;gt; the nrf5340 supports 12 Mbps (full speed). How can I accomplish this?&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB Full-Speed Transfer</title><link>https://devzone.nordicsemi.com/thread/385264?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2022 12:10:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9040c869-389d-4c8b-9e11-5b8b3a36959e</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;You&amp;#39;re reaching speeds of 400 kByte/s, ie. 8 MByte transferred after 22 sec -&amp;gt; ~0.38 MByte per sec. Your dd command tries to read 32MB, by the way. So if you want to reverse the command, ie. copy&amp;nbsp;to the flash, you&amp;#39;ll have to adjust the size.&lt;/p&gt;
&lt;p&gt;Actual throughput is probably lower, as you&amp;#39;re not running &amp;quot;sync&amp;quot; after the dd command.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What&amp;#39;s your&amp;nbsp;requirement towards speed?&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>