<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: How to Change the SerialUSB Buffer Size (plus DMA)</title>
		<link>http://forums.leaflabs.com/topic.php?id=225</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:24:59 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=225" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "How to Change the SerialUSB Buffer Size (plus DMA)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=225#post-1660</link>
			<pubDate>Tue, 05 Oct 2010 18:10:26 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">1660@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I've been thinking about this over the last few days. I am interested in quite high data rates from the Maple to host.&#60;/p&#62;
&#60;p&#62;If a Maple program does a write/print/whatever and it's too big to fit into the maplelib buffer, does the function call block?&#60;/p&#62;
&#60;p&#62;I assume it does. &#60;/p&#62;
&#60;p&#62;If that's the case, then I wondered if there might be some value to having a specialised non-blocking 'constant write'? The 'Constant write' contract is that any buffer handed to it must be treated as 'read only' by the users Maple program until it is released. The buffer is read-only by convention (no fancy tricks) until it is released by a 'constant release' function which the user could poll (there may be a callback function registered too). &#60;/p&#62;
&#60;p&#62;To make it easy to implement, there may be an arbitrary, small, limit to the number of buffers, say, 8 outstanding buffers.&#60;/p&#62;
&#60;p&#62;This way, the user could manage the double buffering to suit their purposes, and maplelib could use small buffers, leaving as much space as practical to the user program.&#60;/p&#62;
&#60;p&#62;Just a thought.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "How to Change the SerialUSB Buffer Size (plus DMA)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=225#post-1651</link>
			<pubDate>Tue, 05 Oct 2010 14:40:39 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">1651@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;No DMA in 0.0.7, 0.1.0 though, as planned. &#60;/p&#62;
&#60;p&#62;USB has 3 buffers. The first is a 512 byte dual port SRAM, directly and simultaneously accessed by the hardware and software. However, the packetsize for serial port endpoint (which is a pair of bulk endpoints) is 128 bytes (64 in, 64 out), so the remaining memory in the 512 byte sram is used for other USB stuff (like the ctrl endpoint) or is empty. &#60;/p&#62;
&#60;p&#62;Next, we have a 64 byte receive buffer, that is a ring buffer (circular) that gets filled by copying data out of the 64 byte packet memory (which cant be used as a buffer since it overwrites that hardware packet memory from 0 at every new usb transaction).  &#60;/p&#62;
&#60;p&#62;Finally the tx buffer, which is not a ring buffer (should be though...) is 64 bytes that just directly copies into the packet memory. In future revisions, we should have 1024B of a circular tx buffer, which should do wonders for the SerialUSB stability (albeit not a 100% fix, since theres still the DTR based auto-reset issue). &#60;/p&#62;
&#60;p&#62;As for how to change all these things? There is no API for this, its all configured in libmaple/usb/usb_config.h   &#60;/p&#62;
&#60;p&#62;Currently, the size of the receive buffer is set to VCOM_RX_EPSIZE, same as the packet memory itself, which is not really so great. This buffer is established in usb_callbacks.c&#60;/p&#62;
&#60;p&#62;For 0.1.0, what wed like to do is have configurable RX and TX buffer sizes (both ring buffers) with 64 byte default sizes and an API to tweak these ranges. Until then, happy hacking!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "How to Change the SerialUSB Buffer Size (plus DMA)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=225#post-1637</link>
			<pubDate>Tue, 05 Oct 2010 13:12:38 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">1637@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Tuesday September 05, 2010&#60;/p&#62;
&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I am glad to see a burst of activity since Maple IDE 0.0.7 was released.  Did I miss the 0.0.7 alpha/beta releases?&#60;/p&#62;
&#60;p&#62;I recently used a software USB sniffer, not the hardware sniffer option &#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=209#post-1514&#34;&#62;described by gbulmer&#60;/a&#62;, with a Maple Rev 3 connected.&#60;/p&#62;
&#60;p&#62;If I understand the readout correctly, the Maple seems to be configured to use a 64 byte buffer.&#60;/p&#62;
&#60;p&#62;With the hardware sniffer gbulmer reported seeing 16 byte packets during USB transmission (and an Arduino).  I will try to learn how to use the software sniffer to determine the packet size with a Maple.&#60;/p&#62;
&#60;p&#62;In the mean time, is there a way to increase the size of the USB buffer size to 128 bytes or 256 bytes?&#60;/p&#62;
&#60;p&#62;I want to quickly see if changing the USB buffer size affects the SerialUSB.print() problem I still experience with my LabVIEW/Maple project.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=209&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=209&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;If there are 512 bytes available for USB configuration how are the other bytes currently used?&#60;/p&#62;
&#60;p&#62;Also, what is the status of DMA in Maple IDE 0.0.7?  I did not see any mention of DMA in the 0.0.7 documents.&#60;/p&#62;
&#60;p&#62;Many thanks for your hard work!&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
