USBデバイス (CDC, MSC)
    
        Page last updated  
27 Feb 2012, by 
  Suga koubou
  Suga koubou.
    
    
        
            
                
                    1 reply
                
            
        
    
         
        
            CDC, 
        
            
msc, 
        
            
USB
        
    
    USB デバイス (CDC, MSC)
Samuel Mokrani氏の USBDevice ライブラリを使用したUSBデバイスのサンプル。
動くものができたが、これで正しいかはよくわからん。求む検証。
- HID(Keyboard、Mouse)、MIDIのプログラムが内包されている。
- LPC11U のソースも含まれてるので、LPC1768(Cotex-M3)だけでなくLPC11U24(Cotex-M0)のmbedでも動くかもしれない。
USB CDC and MSC composite device
下の USB CDC と USB MSC をあわせたUSB複合デバイス。
ディスクとCOMポートが同時に使える。
USB CDC (serial) and USB MSC (strage) Composite Device.
http://mbed.org/users/okini3939/notebook/USB_Device/
 

USB CDC (Communications Device Class)
ドライバ不要(.infファイルのみ)のCOMポートとして使える。
USB MSC (Mass Storage Class)
USBメモリ(ディスク)として認識し、mbedへ接続したSDメモリーカードが読み書きできる。
備考
 
1 comment on USBデバイス (CDC, MSC):
    
    
    
    
        
            
            
                
                    
                       It really works. The point is to uninstall any previous driver and to modify serial.inf...
Here is the serial_msd.inf
 
;************************************************************
; Windows USB CDC ACM Setup File
; Copyright (c) 2000 Microsoft Corporation
[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MFGNAME%
LayoutFile=layout.inf
CatalogFile=%MFGFILENAME%.cat
DriverVer=11/15/2007,5.1.2600.0
[Manufacturer]
%MFGNAME%=DeviceList, NTamd64
[DestinationDirs]
DefaultDestDir=12
;------------------------------------------------------------------------------
;  Windows 2000/XP/Vista-32bit Sections
;------------------------------------------------------------------------------
[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg
[DriverCopyFiles.nt]
usbser.sys,,,0x20
[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt
[DriverService.nt]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys
;------------------------------------------------------------------------------
;  Vista-64bit Sections
;------------------------------------------------------------------------------
[DriverInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg
[DriverCopyFiles.NTamd64]
%DRIVERFILENAME%.sys,,,0x20
[DriverInstall.NTamd64.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[DriverInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64
[DriverService.NTamd64]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys
;------------------------------------------------------------------------------
;  Vendor and Product ID Definitions
;------------------------------------------------------------------------------
; When developing your USB device, the VID and PID used in the PC side
; application program and the firmware on the microcontroller must match.
; Modify the below line to use your VID and PID.  Use the format as shown below.
; Note: One INF file can be used for multiple devices with different VID and PIDs.
; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
;------------------------------------------------------------------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_1F00&PID_2012&MI_00
[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall, USB\VID_1F00&PID_2012&MI_00
;------------------------------------------------------------------------------
;  String Definitions
;------------------------------------------------------------------------------
;Modify these strings to customize your device
;------------------------------------------------------------------------------
[Strings]
MFGFILENAME="Virtual Serial port"
DRIVERFILENAME ="usbser"
MFGNAME="http://www.mbed.org"
INSTDISK="Mbed Virtual Serial Port Installer"
DESCRIPTION="Mbed Compozite Virtual Serial Port"
SERVICE="USB RS-232 Emulation Driver"
 
                
             
         
     
 
Please log in to post comments.
    
 
    
It really works. The point is to uninstall any previous driver and to modify serial.inf...
Here is the serial_msd.inf
;************************************************************ ; Windows USB CDC ACM Setup File ; Copyright (c) 2000 Microsoft Corporation [Version] Signature="$Windows NT$" Class=Ports ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} Provider=%MFGNAME% LayoutFile=layout.inf CatalogFile=%MFGFILENAME%.cat DriverVer=11/15/2007,5.1.2600.0 [Manufacturer] %MFGNAME%=DeviceList, NTamd64 [DestinationDirs] DefaultDestDir=12 ;------------------------------------------------------------------------------ ; Windows 2000/XP/Vista-32bit Sections ;------------------------------------------------------------------------------ [DriverInstall.nt] include=mdmcpq.inf CopyFiles=DriverCopyFiles.nt AddReg=DriverInstall.nt.AddReg [DriverCopyFiles.nt] usbser.sys,,,0x20 [DriverInstall.nt.AddReg] HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,%DRIVERFILENAME%.sys HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" [DriverInstall.nt.Services] AddService=usbser, 0x00000002, DriverService.nt [DriverService.nt] DisplayName=%SERVICE% ServiceType=1 StartType=3 ErrorControl=1 ServiceBinary=%12%\%DRIVERFILENAME%.sys ;------------------------------------------------------------------------------ ; Vista-64bit Sections ;------------------------------------------------------------------------------ [DriverInstall.NTamd64] include=mdmcpq.inf CopyFiles=DriverCopyFiles.NTamd64 AddReg=DriverInstall.NTamd64.AddReg [DriverCopyFiles.NTamd64] %DRIVERFILENAME%.sys,,,0x20 [DriverInstall.NTamd64.AddReg] HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,%DRIVERFILENAME%.sys HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" [DriverInstall.NTamd64.Services] AddService=usbser, 0x00000002, DriverService.NTamd64 [DriverService.NTamd64] DisplayName=%SERVICE% ServiceType=1 StartType=3 ErrorControl=1 ServiceBinary=%12%\%DRIVERFILENAME%.sys ;------------------------------------------------------------------------------ ; Vendor and Product ID Definitions ;------------------------------------------------------------------------------ ; When developing your USB device, the VID and PID used in the PC side ; application program and the firmware on the microcontroller must match. ; Modify the below line to use your VID and PID. Use the format as shown below. ; Note: One INF file can be used for multiple devices with different VID and PIDs. ; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. ;------------------------------------------------------------------------------ [SourceDisksFiles] [SourceDisksNames] [DeviceList] %DESCRIPTION%=DriverInstall, USB\VID_1F00&PID_2012&MI_00 [DeviceList.NTamd64] %DESCRIPTION%=DriverInstall, USB\VID_1F00&PID_2012&MI_00 ;------------------------------------------------------------------------------ ; String Definitions ;------------------------------------------------------------------------------ ;Modify these strings to customize your device ;------------------------------------------------------------------------------ [Strings] MFGFILENAME="Virtual Serial port" DRIVERFILENAME ="usbser" MFGNAME="http://www.mbed.org" INSTDISK="Mbed Virtual Serial Port Installer" DESCRIPTION="Mbed Compozite Virtual Serial Port" SERVICE="USB RS-232 Emulation Driver"