tag:blogger.com,1999:blog-49945705738167155662024-03-12T23:17:12.379-07:00Belcarra USB Composite Device FrameworkBelcarra's Composite Device Framework is a comprehensive USB client driver and management system designed to give a device the flexibility to provide the USB host with precisely the function(s) necessary for a particular situation, in almost any combination.jackhttp://www.blogger.com/profile/07754050276288850739noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-4994570573816715566.post-63003158496274762402015-08-07T15:55:00.000-07:002015-08-07T15:55:03.045-07:00CDC-EEM for a microcontroller<div style="line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt; text-align: center;">
<span style="font-family: 'Trebuchet MS'; font-size: 21.3333333333333px; line-height: 1.38; text-align: left; white-space: pre-wrap;">Basics</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">A USB device presents various </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">descriptors</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> to the host in one or more </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">configurations</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">. If the first configuration matches an\ driver information (INF) file on Windows, then a matching driver in Windows will be loaded. The driver will then examine additional descriptors from the device, and if it is satisfied, it will issue a </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Set Configuration</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> request to the device, and the device will now be </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">enumerated</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">All of the major microcontrollers have libraries that implement the foregoing for simple cases. To implement a custom protocol, such as CDC-EEM, you need to do the following</span></div>
<b style="font-weight: normal;"><br /></b>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Modify the </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Device Descriptor</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> to conform to the requirements of the protocol. Specifically, you need to set the following values:</span></div>
</li>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: circle; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Class --0x2 = networking device</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: circle; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Subclass - 0xc</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: circle; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Protocol- 0x7</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: circle; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Vendor ID </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: circle; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Product ID</span></div>
</li>
</ul>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Modify the Configuration Descriptor and supplementary descriptors (interface, endpoint, string descriptors) to match</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Modify your network subsystem transmit to fill EEM frames. Your code fills EEM buffers with one or more network frames, and when a buffer is deemed ready, start transmitting it </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The USB OUT (receive) subsystem will receive 1 EEM frame in a </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">USB transfer</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, consisting of 1 or more </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">USB packets</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> of maximum length (64 bytes for full speed, 512 bytes for high speed USB) followed by a short or ZLP (zero-length packet). We assume there already support for low-level USB operations. In particular, at interrupt time we can be informed that a packet of data has been received. If we are in the process of building an EEM frame, the a full-speed packet is copied to the frame. The EEM standard doesn’t say how big an EEM frame is but USBLAN provides a way for both sides to agree on the maximum size.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">When an incoming EEM frame is complete, a loop should be triggered that unpacks it into its component parts (1 or more Ethernet frames) which end become incoming frames to the network subsystem.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">During the time that incoming EEM frame is being unpacked, new OUT (incoming) data needs to be directed to another buffer. So the system needs at least two EEM frames in each direction, one to feed the network subsystem and the other to feed the USB subsystem.</span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;">
<span style="background-color: transparent; color: black; font-family: 'Trebuchet MS'; font-size: 21.333333333333332px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The EEM Standard</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The </span><a href="http://www.usb.org/developers/docs/devclass_docs/CDC_EEM10.pdf" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">EEM Standard</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> document not only specifies the frame formats and other technical data in the usual terse language of standards, but contains a number of explanatory appendices which give a lot of guidance on how to implement and use EEM.</span></div>
<br />jv@belcarra.comhttp://www.blogger.com/profile/00089781526611128997noreply@blogger.comtag:blogger.com,1999:blog-4994570573816715566.post-33142362205514455172013-12-17T16:23:00.001-08:002020-12-09T14:24:55.813-08:00Microchip PIC32 Networking over USB<span face="Arial, Tahoma, Helvetica, FreeSans, sans-serif" style="background-color: white; color: #222222; font-size: 13px; line-height: 18px;">Belcarra’s implementation of Networking over USB for the Microchip PIC32 is a very low cost networking solution for PIC32 projects, eliminating the need to add an Ethernet chip while using less Flash and RAM resources.</span><br />
<span face="Arial, Tahoma, Helvetica, FreeSans, sans-serif" style="background-color: white; color: #222222; font-size: 13px; line-height: 18px;"><br /></span>
<span face="Arial, Tahoma, Helvetica, FreeSans, sans-serif" style="background-color: white; color: #222222; font-size: 13px; line-height: 18px;"><br /></span>
<span face="Arial, Tahoma, Helvetica, FreeSans, sans-serif" style="background-color: white; color: #222222; font-size: 13px; line-height: 18px;">Full details and demonstration kit download </span><a href="https://links.belcarra.com/USBLAN_Demo_for_Microchip_PIC32" style="background-color: white; color: #20124d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;" target="_blank">available here.</a>jv@belcarra.comhttp://www.blogger.com/profile/00089781526611128997noreply@blogger.comtag:blogger.com,1999:blog-4994570573816715566.post-60628892712563286402013-03-26T15:40:00.002-07:002020-12-09T14:28:18.738-08:00PandaBoardsBelcarra's <a href="https://links.belcarra.com/USB_Testdrive_Overview">TestDrive environment</a> for USB Networking protocols has been revisited using TI's PandaBoards. <br />
<br />
A full description: <a href="https://links.belcarra.com/Testdrive_Panda" target="_blank">Installing and using TestDrive-Panda</a> is <a href="https://links.belcarra.com/Testdrive_Panda" target="_blank">available here</a>.<br />
<br />jv@belcarra.comhttp://www.blogger.com/profile/00089781526611128997noreply@blogger.comtag:blogger.com,1999:blog-4994570573816715566.post-10964309007375466722012-01-16T15:48:00.001-08:002020-12-09T14:29:40.243-08:00USB TestDrive Network Scripts<span face="Arial, Helvetica, sans-serif">The <a href="https://downloads.belcarra.com/">TestDrive</a> scripts described here can be used to load the appropriate modules for all of the various network protocols and variants supported by USBLAN. In the case of RNDIS, it is also possible to tell Windows to use the built-in VID/PID values (therefore not using USBLAN). This allows USBLAN/native RNDIS comparison.</span><br />
<br /><span face="Arial, Helvetica, sans-serif">The scripts described here are the foundation: they load network protocols. After this has been done, various network tests can be run. These are described elsewhere.</span><br /><br />
<b style="font-family: Arial, Helvetica, sans-serif;">Supported Protocols</b><br />
<div>
<div>
<span id="internal-source-marker_0.5351884679403156"><span face="Arial, Helvetica, sans-serif">The supported protocols are:</span></span><br />
<ul><span id="internal-source-marker_0.5351884679403156"><span face="Arial, Helvetica, sans-serif">
<li>ECM</li>
<li>EEM</li>
<li>NCM</li>
<li>ECM subset</li>
<li>SAFE (another ECM subset)</li>
<li>RNDIS</li>
</span></span></ul>
<span id="internal-source-marker_0.5351884679403156"><span face="Arial, Helvetica, sans-serif">
<b>Stacks</b></span></span></div>
<div>
<span face="Arial, Helvetica, sans-serif">All the protocols, can be loaded with the std (Gadget) implementation in the Linux kernel, or the btc (Belcarra) implementation. In particular Belcarra’s implementation of NCM and EEM is more advanced in important ways that are explained below.<br /><br />Basic invocation modelThe scripts use a uniform invocation model as follows<br /><i><span style="font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">stack</span><span style="font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">protocol</span><span style="font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> [-q] </span><span style="font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">VID PID [IP]</span></i></span><br />
<a name='more'></a><span face="Arial, Helvetica, sans-serif"><br />Here, stack is one of the following: std (for Gadget) or btc (for Belcarra)<br />The protocol is one of the following</span><br />
<ul>
<li><span face="Arial, Helvetica, sans-serif">ecm</span></li>
<li><span face="Arial, Helvetica, sans-serif">eem</span></li>
<li><span face="Arial, Helvetica, sans-serif">ncm</span></li>
<li><span face="Arial, Helvetica, sans-serif">ecm.subset</span></li>
<li><span face="Arial, Helvetica, sans-serif">safe (BTC stack only)</span></li>
<li><span face="Arial, Helvetica, sans-serif">rndis (STD stack only)</span></li>
</ul>
<span face="Arial, Helvetica, sans-serif">Two arguments are surrounded by [ ] meaning that they are optional.</span><br />
<ul>
<li><span face="Arial, Helvetica, sans-serif">-q means <i>quick</i>. If this option is given the action is taken without interactive confirmation. Otherwise, the user is presented with a summary of the proposed actions and asked for confirmation before the modules are loaded.</span></li>
<li><span face="Arial, Helvetica, sans-serif">VID is the USB Vendor ID. For Belcarra the value is 15ec. Note that this value must not be preceded by 0x</span></li>
<li><span face="Arial, Helvetica, sans-serif">PID is the USB Product ID. For the Demo edition of USBLAN, available from Windows Update, this is one of the following three values: D020, D021, D022. As with VID, these values are not preceded by 0x.</span></li>
<li><span face="Arial, Helvetica, sans-serif">IP is the designated IP address of the interface once it is created. If this argument is omitted or set to the special value 0.0.0.0 then no IP value is set by the script -- in this case the IP address may (see below) be set by USBLAN’s DHCP</span><span face="Arial, Helvetica, sans-serif"> service</span></li>
</ul>
<span face="Arial, Helvetica, sans-serif"><b>Belcarra EEM</b></span><span face="Arial, Helvetica, sans-serif"><br /><span style="font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The Belcarra implementation of EEM offers a number of enhancements compared to the Gadget implementation, as described in the following subsections</span></span><br />
<br />
<b>The device receive buffer</b></div>
<div>
<span face="Arial, Helvetica, sans-serif">The EEM protocol allows for aggregation of frames in both directions, and also for larger USB transfers. However, the EEM standard does not specify a mechanism whereby a host driver (running under Windows) can discover the capabilities of a device.</span><br />
<br />
<b>RNDIS</b></div>
<div>
The Testdrive environment includes the Gadget version <br />
<br />
<b>Special handling of RNDIS VID/PID</b></div>
<div>
If the protocol is RNDIS and VID/PID are both omitted, then this means that the internal defaults of Gadget RNDIS are used, meaning that Windows will use the built-in RNDIS, not the USBLAN implementation.<br />
<br />
<b>Loading RNDIS support in Windows</b><br />
When using the RNDIS support built into USBLAN, RNDIS becomes available whenever USBLAN has been installed for a given VID/PID combination, even if another protocol was used. For instance, consider the following sequence of events<br />
<ul>
<li>run std-rndis -q 15ec d021 </li>
<li>Connect the USB cable</li>
<li>Follow prompts in Windows to connect to Windows Update</li>
</ul>
</div>
After this, the following command activates ECM on the same NDIS interface in Windows:<br />
std-ecm -q 15ec d021<br />
<br />
To use the built-in (Microsoft) implementation of RNDIS, omit the VID and PID from the std-rndis command. Then after connecting the USB cable, you will be prompted to connect to Windows update (as before), but the Microsoft driver will be activated instead of USBLAN. This will create a new NDIS (network) interface. Therefore, you can always tell which version of RNDIS is active from the Control Panel in Windows.<br />
<div>
<br />
<b>Summary of scripts</b><br />
<ul>
<li><span face="Arial, Helvetica, sans-serif">btc-ecm [-q] <i>VID PID [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">Unload all loaded network modules, then load Belcarra implementation of ECM with the specified parameters.If IP address is non-zero, then set the given IP address after a short delay.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">btc-ecm.subset [-q] <i>VID PID [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">Unload all loaded network modules, then load Belcarra implementation of an ECM subset with the specified parameters.If IP address is non-zero, then set the given IP address after a short delay. This subset is useful on hardware which cannot implement the full ECM protocol.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">btc-safe [-q]<i> VID PID [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">Unload all loaded network modules, then load Belcarra implementation of the SAFE subset of ECM with the specified parameters.If IP address is non-zero, then set the given IP address after a short delay. SAFE is a slightly less restricted subset tan the preceding subset. Neither subset is needed on the Overo, but may be on other older hardware, and are provided here for demonstration purposes.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">btc-eem [-q]<i> VID PID [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">Unload all loaded network modules, then load Belcarra implementation of EEM with the specified parameters. If the optional IP address is non-zero, then set the given IP address after a short delay. The Belcarra implementation of EEM has significant improvements compared to that available in the Gadget implementation. Refer to Belcarra EEM section below for details.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">btc-ncm [-q] <i>VID PID [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">Unload all loaded network modules, then load Belcarra implementation of NCM with the specified parameters. If optional IP address is non-zero, then set the given IP address after a short delay.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">std-ecm [-q]<i> VID PID [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">Unload all loaded network modules, then load standard (Gadget) implementation of ECM with the specified parameters.If IP address is non-zero, then set the given IP address after a short delay.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">std-ecm.subset [-q] <i>VID PID [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">Unload all loaded network modules, then load standard (Gadget) implementation of a subset of ECM with the specified parameters.If IP address is non-zero, then set the given IP address after a short delay. The subset implemented here is identical that implemented by btc-ecm.subset.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">std-eem [-q] <i>VID PID [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">Unload all loaded network modules, then load standard (Gadget) implementation of EEM with the specified parameters.If IP address is non-zero, then set the given IP address after a short delay.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">std-ncm [-q] <i>VID PID [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">Unload all loaded network modules, then load standard (Gadget) implementation of NCM with the specified parameters.If IP address is non-zero, then set the given IP address after a short delay.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">std-rndis -q <i>[IP</i>]</span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">unload all network modules already loaded</span></li>
<li><span face="Arial, Helvetica, sans-serif">load the Gadget version of RNDIS, using the internal (default) vendor and product ID. </span></li>
<li><span face="Arial, Helvetica, sans-serif">If a cable is now connected to a Windows 7 box, then the Microsoft implementation of RNDIS, using an Acer VID/PID combination will be loaded from Windows Update</span></li>
<li><span face="Arial, Helvetica, sans-serif">If the optional IP address is specified, its value is set as the IP address of usb0 after a short delay.</span></li>
</ul>
<li><span face="Arial, Helvetica, sans-serif">std-rndis -q VID PID<i> [IP]</i></span></li>
<ul>
<li><span face="Arial, Helvetica, sans-serif">unload all network modules already loaded</span></li>
<li><span face="Arial, Helvetica, sans-serif">load the Gadget version of RNDIS, using the internal (default) vendor and product ID. </span></li>
<li><span face="Arial, Helvetica, sans-serif">If a cable is now connected to a Windows 7 box, and the VID/PID match a USBLAN INF file (for example 15ec/d021 for the Demo version of USBLAN) then the Belcarra implementation of RNDIS, using the specified combination will be loaded, possibly from Windows Update.</span></li>
<li><span face="Arial, Helvetica, sans-serif">If the optional IP address is specified, its value is set as the IP address of usb0 after a short delay.</span></li>
</ul>
</ul>
</div>
</div>
<div>
<span face="Arial, Helvetica, sans-serif"><br /></span></div>
<div>
<span face="Arial, Helvetica, sans-serif"><br /></span></div>
<div>
<span face="Arial, Helvetica, sans-serif"><br /></span></div>
<div>
<span face="Arial, Helvetica, sans-serif"><br /></span></div>jv@belcarra.comhttp://www.blogger.com/profile/00089781526611128997noreply@blogger.comtag:blogger.com,1999:blog-4994570573816715566.post-68971177790047078802011-11-01T16:40:00.000-07:002011-11-01T11:20:50.349-07:00USB Device Framework OverviewBelcarra’s USB Device Framework, a comprehensive USB client driver and management system, allows for fast and efficient implementation of both Simple and Composite USB Devices.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivmfoxX9AwEUmXxo4lhMb5fBE2OTx8UNRXL85swZvOK_wIk7o6ziIrftgBdMb1m-M-kE1ZzofyEjJ5so94NqvKgeWnoV62ao69WNyPgbf0CeEG15SMdAHKnb_0DyLXkNXUwjKOInmePOc/s1600/USBCompositeFrameworkOverview.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="316" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivmfoxX9AwEUmXxo4lhMb5fBE2OTx8UNRXL85swZvOK_wIk7o6ziIrftgBdMb1m-M-kE1ZzofyEjJ5so94NqvKgeWnoV62ao69WNyPgbf0CeEG15SMdAHKnb_0DyLXkNXUwjKOInmePOc/s400/USBCompositeFrameworkOverview.jpg" width="400" /></a></div>
<br />
Available in two forms:<br />
<ul>
<li>A source-code product as is,</li>
<li>A kit customized for a specific platform and operating system.</li>
</ul>
Belcarra's Framework has the following subsystems:<br />
<b>Kernel tools</b><br />
<ol>
<li>USB InterfaceFunctions -</li>
<li>Composite Support</li>
<li>USB Core Layer</li>
<li>Peripheral Control Drivers - hardware specific</li>
</ol>
<b>Admin Tools</b> - Provided as extensible API’s to select different runtime configurations; control the mass-storage subsystem.jackhttp://www.blogger.com/profile/07754050276288850739noreply@blogger.comtag:blogger.com,1999:blog-4994570573816715566.post-62253231725190237852011-03-22T18:00:00.000-07:002011-07-11T10:25:49.386-07:00USB TestDrive Setup<b><u>Overo Setup and Testing Overview</u></b><br />
<br />
This document is an overview of the setup for USB Device testing using <a href="http://link.belcarra.com/TestDriveOverview">Belcarra’s USB TestDrive </a>Environment (download available <a href="http://link.belcarra.com/TestDrivePublicDownloads">here</a>), a Linux test system based on the Gumstix Overo board. The Overo board is a low cost hardware development system using TI’s Omap 3530 SOC that supports USB 2.0 for both host and client implementations.<br />
<br />
<b><u>Introduction</u></b><br />
The TestDrive system can be used to test and evaluate various USB Networking protocols and implementations:<br />
<ul><li>Gadget based network and filestorage function drivers</li>
<li>Belcarra based network and mass storage function drivers</li>
<li>Belcarra Windows USBLAN class driver</li>
</ul><b><u>Preparing to Install</u></b><br />
This requires an SD card with at least 4GB of space. A <a href="http://www.gumstix.org/create-a-bootable-microsd-card.html">page</a> at gumstix.org shows how to create a basic 2-partition SD card. For our demo kit, follow the same procedure, but create three partitions. See <a href="http://link.belcarra.com/PreparingOveroMemoryCard">Preparing a Micro-SD Memory Card for use with Gumstix COM </a>for further detail.<br />
<ul><li>Partition 1 FAT32 (per manufacturer’s page), but allow at least 250MB to allow for kernel backups</li>
<li>Partition 2 ext3, about 2GB (use for the ROOTFS)</li>
<li>Partition 3 FAT32, remainder of the disk, used for a mass storage volume.</li>
</ul><div><b><u>Installation of the TestDrive Kit</u></b></div><div>The following is an example of how to install the kit. We have made a few assumptions:<br />
<a name='more'></a><ul><li>The SD card as inserted in the Linux host machine maps to devices /dev/sd<span class="Apple-style-span" style="color: red;">e</span>, /dev/sd<span class="Apple-style-span" style="color: red;">e</span>1, /dev/sd<span class="Apple-style-span" style="color: red;">e</span>2, and /dev/sd<span class="Apple-style-span" style="color: red;">e</span>3. The key thing is the letter in red. This letter may be different in your environment, depending on what other devices are installed, but the rest should be the same. </li>
<li>The archive file you downloaded above is located in the current directory (otherwise step 6 below will require revision). </li>
<li>There is no directory called “extract” in the current directory </li>
<li>You have prepared the partitions as described above, and the card is inserted into a SD card reader on your Linux host machine</li>
<li>You have permission, either as the root user, or via the sudo permission table to execute all the commands below. In particular, the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">tar</span> command in step 6 needs root permission.</li>
</ul> 1. On host machine create an empty directory (we’ll call it “extract” for now)<br />
2. <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">cd extract</span><br />
3. <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mkdir p1 p2 p3</span><br />
4. Unmount partitions from wherever they are mounted and mount them on p1, p2, and p3. Here’s a sample sequence to achieve this: </div><div> a .<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">sudo umount /dev/sde[123]</span> You will see error messages if some or all of the partitions are not currently mounted<br />
b. <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">sudo mount /dev/sde1 p1</span><br />
c. <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">sudo mount /dev/sde2 p2</span><br />
d. <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">sudo mount /dev/sde3 p3</span><br />
5. Write your local versions of MLO and u-boot to p1 (optional). They are available from <a href="http://cumulus.gumstix.org/images/angstrom/factory/overo-201004270808/">here</a>. <b>Note: MLO must be the first file copied onto extract/p1 due to a size restricion of the Overo’s boot loader.</b><br />
6. Extract the contents of the archive, using a command similar to the following:<br />
<span class="Apple-style-span" style="font-size: x-small;"> <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">sudo tar xfj</span></span></div><div><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"> ../belcarra-gumstix-overo-kit-2011-03-17.tar.bz2</span><br />
7. Populate the third partition as follows:<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"> </span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">cd p3;sudo unzip ../p3.zip</span><br />
8. Unmount the volumes<br />
a. <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">cd ..</span></div><div> b. <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">sudo umount /dev/sde[123]</span></div><div><br />
<b><u>The TestDrive Environment</u></b></div><div>After preparing the SD card, use it to boot the Overo. There are three facilities of note:<br />
<ul><li>The Apache web server. The document root is /usr/share/apache2/httpdocs This directory is pre-populated with a number of useful test files</li>
<li>The iperf network test-tool</li>
<li>CrystalDiskMark (for mass storage testing)</li>
</ul><div><b><u>Belcarra Windows USBLAN Evaluation Driver</u></b></div><div><br />
<a href="http://usblan.belcarra.com/p/usblan-deployment-guide.html">Belcarra’s USBLAN Evaluation Driver </a>is available via Windows Update. It is available for use when a device using either of the following Vendor / Product ID’s is plugged into Windows.<br />
<ol><li>15ec / d001 - enable the built-in DHCP service</li>
<li>15ec / d002 - disable the built-in DHCP service</li>
</ol>Please note that the evaluation driver will only work for sixty minutes at a time.</div><div><br />
</div><u><b>Setting up EEM or ECM on the Overo</b></u></div><div><br />
Using Belcarra modules -- Demo versions<br />
<br />
When the Overo boots, a number of shell functions are available to set up common test requirements. There are 2 “Demo” USB Vendor/Product ID pairs:<br />
<ul><li>15ec/d001 Belcarra Demo #1. </li>
<li>15ec/d002 Belcarra Demo #2</li>
</ul>For each of these pairs, an evaluation version of Belcarra USBLAN is available from Windows Update for either the EEM or ECM network protocol. For Demo #1, the built-in DHCP feature of DHCP is activated. For Demo #2, the built-in DHCP feature is not active. See here for more information on USBLAN features, including the built-in DHCP server.<br />
<ul><li>eem1-Load Belcarra modules. Select configuration for Demo #1, EEM protocol. Enable USB. </li>
<li>eem2-Load Belcarra modules. Select configuration for Demo #2, EEM protocol. Enable USB.</li>
<li>ecm1-Load Belcarra modules. Select configuration for Demo #1, ECM protocol. Enable USB</li>
<li>ecm2-Load Belcarra modules. Select configuration for Demo #2, ECM protocol. Enable USB</li>
</ul>Note: if ecm2, for example, is already active, then eem1 will do the following:<br />
<ul><li>disable USB</li>
<li>select configuration for Demo #1, EEM mode</li>
<li>enable USB</li>
</ul>This abbreviated sequence is possible because the modules are already loaded.<br />
<br />
Supplementary net command:<br />
<ul><li>netwait<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"> </span><span class="Apple-style-span" style="font-family: inherit;"><i>ipaddress</i></span> Waits for the network interface to be created (if necessary) and then sets the ipaddress. </li>
</ul><b>Using Belcarra modules -- general VID/PID</b><br />
<br />
If you have your own version of Belcarra USBLAN with your own values of Vendor ID and Product ID, then you can set up EEM or ECM as follows. Here VID stands for your own vendor ID and PID for your own Product ID<br />
<ul><li>BTCDOWN -- this command only needed if you have previously loaded Belcarra modules using the command shown above </li>
<li>BTC_EEM <i>VID PID ipaddress</i> Set up the CDC-EEM protocol on the given Vendor and Product ID. Then set the ip address using netwait (see above). The third argument is optional. If it is absent, the IP address is not set by this command (this is suitable for instance for DHCP).</li>
<li>BTC_ECM <i>VID PID ipaddres</i>s Same as BTC_EEM but for the CDC-ECM protocol</li>
</ul>Note: after using either of these modules, you must run BTCDOWN before the other functions (eem1, eem2, ecm1, ecm2) will work.</div><div><br />
<b>Using the Gadget modules - </b><b>CDC-EEM mode</b><br />
<blockquote>modprobe g_ether idVendor=VID idProduct=PID</blockquote>If you have already loaded Belcarra modules first do this: BTCDOWN (see above)<br />
<br />
Replace VID and PID with your own values<br />
<ul><li>15ec/d001 for USBLAN Demo #1</li>
<li>15ec/d002 for USBLAN Demo #2</li>
</ul><b><span class="Apple-style-span" style="font-weight: normal;"><b>Using the Gadget modules - </b></span>CDC-ECM mode</b><br />
<br />
Loading this mode is exactly the same except that we need an additional parameter in loading g_ether:<br />
<blockquote>modprobe g_ether idVendor=VID idProduct=PID eem_mode=0</blockquote><b>Switching to Belcarra mode</b><br />
<br />
The gadget modules can be unloaded as follows:<br />
<blockquote><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">rmmod g_ether<br />
rmmod musb_hdrc</span></blockquote>After this, all the Belcarra configurations as described above are available.</div><div><br />
<b><u>Network Testing</u></b><br />
There are two major methods available for network benchmarking and stress testing<br />
<ul><li>Several large test files of progressively larger sizes are available in the Apache document root. These can be retrieved by a host-based shell script.</li>
<li>For testing the speed of uploads, the wget program is available on the Overo. This can be used to retrieve files of any size from a host PC. To avoid issues with flash size and speed, the --output-document option of wget can be used to send the data to /dev/null.</li>
<li>For loopback testing, the iperf utility is ideal</li>
</ul><b><u>Mass Storage Testing</u></b><br />
Mass storage testing is done as follows<br />
<ul><li>If network testing is in progress, unload the network modules, as described above</li>
<li>Run MSCMOUNT (no arguments required). This function will unmount the third partition of your SD card locally, and offer it as a USB mass storage volume</li>
<li>Run MSCWAIT (no arguments required) This function will wait until the user has ejected the volume on the PC, and then re-mount the volume locally.</li>
<li>While the volume is available to the PC, the <a href="http://crystalmark.info/software/CrystalDiskMark/index-e.html">CrystalDiskMark tool</a> is available within the volume. This can be use for either stress or speed testing. Note: the CrystalDiskMark tool was designed for hard disks, not flash disks. The difference can be readily seen if a test is run on both a hard disk and a flash disk. Only the “sequential” tests (first row of tests) produce comparable results. The other tests are severely affected by the high wait times for flash erases.</li>
</ul><div><div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><u><b>Additional Documentation</b></u></div><ul><li><a href="http://link.belcarra.com/TestDriveOveroSetup">Overo USB TestDrive Setup</a> - an overview document of USB Device testing using Belcarra’s Overo USB Test Environment.</li>
<li><a href="http://link.belcarra.com/TestDriveWindowsSetup">Windows USB TestDrive Setup</a> an overview of setting up a Microsoft Windows system to do testing of USB devices with tools such as Apache and Cygwin. <br />
<a href="http://link.belcarra.com/TestDriveOverview">Belcarra USB TestDrive</a> - an overview document of Belcarra’s USB TestDrive Environment.</li>
<li><br />
</li>
</ul></div><div></div></div></div>jackhttp://www.blogger.com/profile/07754050276288850739noreply@blogger.comtag:blogger.com,1999:blog-4994570573816715566.post-84887115689395754232011-03-18T17:26:00.001-07:002020-12-09T14:31:52.806-08:00Belcarra Overo DEMO Project<div style="text-align: center;"><b><span class="Apple-style-span" face="Verdana, sans-serif">Preparing a Micro-SD Memory Card for use with Gumstix COM</span></b></div><br />
<a href="http://link.belcarra.com/PreparingOveroMemoryCard">This document</a> describes how to partition, format, and copy files to a 4GB Micro-SD memory card for use in a <a href="http://www.gumstix.com/">Gumstix </a>for the<a href="https://links.belcarra.com/Overo_USB_TestDrive_Setup"> Belcarra Overo DEMO project</a>.<br />
<br />
<a name='more'></a><br />
<br />
General note: User input is shown in <b>bold face non-italic type</b>.<br />
<br />
Required equipment:<br />
<ul><li>A Linux-based PC - any distribution should work. The machine used in this example is running Ubuntu 10.04. RedHat systems will work with no changes to the commands you will need to use. <br />
<i><b> NOTE: </b>If you are a “regular” user then “sudo” will need to be set up so that you can obtain “root” permissions.</i></li>
<li>A suitable SD card or Micro-SD card reader/writer which plugs into a USB port.</li>
<li>A Micro-SD card (with SD adapter) 4GB in size. This example uses a Kingston Technology card, other makes should work as well.</li>
</ul>Insert the Micro-SD card into the reader/writer - you may have to use the SD card adapter. There are Micro-SD card readers/writers available. Use one of those if you have access to one.<br />
<br />
Insert the SD/Micro-SD card reader/writer into a USB port on the PC.<br />
<br />
If your Linux machine mounts partitions automatically (as on an Ubuntu system) any partition(s) on the Micro-SD card will be mounted. Use the “mount” command to show what’s ..<a href="http://www.blogger.com/goog_466487530">..</a><i><b><a href="https://docs.google.com/document/pub?id=1zv0h0Brn5_UAOQNZWIoVjNvk4E_qe7DrZvtygFDrqow">read on</a> </b></i>jackhttp://www.blogger.com/profile/07754050276288850739noreply@blogger.comtag:blogger.com,1999:blog-4994570573816715566.post-16363328045132028972011-01-22T16:48:00.000-08:002011-01-26T13:30:47.211-08:00Network Control Model Protocol<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Network Control Model</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Belcarra USB Composite Device Framework now supports Network Control Model a multi-frame protocol designed and developed that will allow for much higher throughput (150-250Mbits) than either the CDC Ethernet Control Model or the Ethernet Emulation Model by allowing for multiple frames per transfer and for the device to optimally specify frame alignment on transfers. (<i><a href="mailto:info@belcarra.com">for more information</a>)</i></div>jackhttp://www.blogger.com/profile/07754050276288850739noreply@blogger.comtag:blogger.com,1999:blog-4994570573816715566.post-8350005979144530632010-09-19T17:46:00.000-07:002011-11-14T13:52:37.023-08:00USB Support for Gumstix Overo and Verdex Pro COM'sBelcarra is pleased to announce Composite USB Client support is available for both Gumstix products<br />
<br />
<ul>
<li>Texas Instruments OMAP based</li>
<li>Marvell X-Scale Verdex</li>
</ul>jackhttp://www.blogger.com/profile/07754050276288850739noreply@blogger.comtag:blogger.com,1999:blog-4994570573816715566.post-55051121381716162202007-11-14T13:22:00.000-08:002011-01-28T09:11:31.835-08:00Composite Solution for TI OMAP 3430 ArchitectureBelcarra's Composite Device Framework allows an OMAP34xx embedded device to utilize multiple different types of USB Functions, composite configuration combinations of Networking, Mass Storage , Serial emulation, and vendor-specific USB Functions. Each of these would appear to a Windows system as a USB Device separate and independent from the others. (<i><a href="http://www.prweb.com/releases/2007/11/prweb568498.htm">more ...</a></i> )jackhttp://www.blogger.com/profile/07754050276288850739noreply@blogger.com