目次

last update: 2024/09

embOS RTOS用BSPパッケージ
第4章: USB-Hostインターフェース
評価ボード:AP-RX651-0A




テストサンプル

Demo Sample Application Folder:

Application
 └ _Exclude
     ├ USBH  ..... USB Host各種クラス機能のデモサンプル
Sample説明
USBH_Printer_Startプリンタクラスドライバのデモサンプル
USBH_MTP_StartUSBホストのMTPクラスドライバの使用方法を示すデモサンプル
USBH_MSD_StartMSDクラスのデモアプリケーション(ファイルシステムが必要です)
USBH_HID_Start標準HIDキーボード・マウスデバイス用デモサンプル
USBH_FT232_StartFTDI FT232クラスドライバのデモサンプル
USBH_CreateInterfaceListUSBポートに接続されているデバイスのステータス及びデバイス情報をIOコンソールに表示します
USBH_CDC_StartUSBホストのCDC-ACMクラスドライバのデモサンプル
USBH_CCID_StartCCID通信デバイスクラスドライバのデモサンプル
USBH_BULK_StartBULK(VENDOR)クラスドライバのデモサンプル
USBH_AUDIO_SpeakerAUDIO(スピーカーデバイス)クラスドライバのデモサンプル
USBH_AUDIO_ScanDevicesUSBポートにAUDIOクラスデバイスが接続された時にデバイスのベンダ・コンフィグレーション情報を表示します
USBH_AUDIO_MicrophoneAUDIO(マイクロフォンデバイス)クラスドライバのデモサンプル

関連設定ファイル:

BSP
 |- BSP_USB.c  .......... ボード依存の初期化設定ファイル(USB-HOST)
 |
 |- Setup
     |- USBH_Config_Renesas_RX_RX651.c  ..... USB-HOSTドライバ設定ファイル

Config
 |- USBH_Conf.h  ............... コンフィグレーション設定ファイル
 |
 |- IO
 |   |- USBH_ConfigIO.c  ....... デバッグコンソールIOインターフェース設定ファイル
 |
 |- OS
     |- lib_embOSLayer_RXv2_L.lib  ..... OSインターフェース設定ファイル

ビルド・動作確認方法

プロジェクト設定では「\Application\_Exclude\USBH」フォルダはビルド対象外に設定しています。以下のどちらかの方法で動作確認を行うサンプルアプリケーションを選択します。

  1. 「\_Exclude\USBH」フォルダ下の対象テストサンプルファイルをビルド対象設定の「\Application」フォルダ下にコピーします。
  2. 「\_Exclude\USBH」フォルダ下の対象テストサンプルファイルのみ「ビルド対象外」の設定を解除します。

各テストアプリケーションの動作確認方法はテストサンプルアプリケーションのヘッダのコメント情報を参照ください。

プロジェクトを再ビルドし、AP-RX651-0A評価ボードに接続してデバッグセッションを開始します。
テストアプリケーションの要件に合わせてUSBホストボードにデバイスを接続してプログラムを実行します。デバッガのIOコンソールのログ画面から結果を確認します。

USBH_MSD_Start:サンプルビルド方法

USBディスクドライブインターフェースを使用しますので、以下の手順でファイルシステム(emFile)のドライバ設定をUSBディスクドライブに変更してください。

  1. 「\BSP\Setup\FS_ConfigMMC_RX_RX651.c」ファイルを「ビルド対象外」に設定します。
  2. 「\BSP\Setup\_Exclude」フォルダ下の「FS_USBH_MSDConfig.c」ファイルをビルド対象設定の「\BSP\Setup」フォルダ下にコピーします。又は「FS_USBH_MSDConfig.c」ファイルのをビルド対象に設定します。

USBポートのホストモードハードウエア設定:

評価ボードの「JSW5」DIPスイッチを「HOST」に設定でUSB機能をホストモードに変更します。

JSW5 SWUSB機能
HOSTUSBホスト機能
FUNCUSBデバイス・ファンクション機能

テストレポート

(クラス情報の確認)Sample: USBH_CreateInterfaceList

操作手順:プログラム起動してUSBポートにUSBデバイスを挿入します。対象デバイスのクラス、Vendor情報はログウインドウから確認します。以下、LANアダプタ及びUSBディスク接続の事例です。

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
RTOS: SEGGER embOS
------------------------------------------------
0:002 MainTask - INIT: emUSB-Host Init started. Version 2.36.5
0:004 MainTask - INIT: *********************************************************************
0:005 MainTask - INIT: *                       emUSB-Host Configuration                    *
0:006 MainTask - INIT: *********************************************************************
0:007 MainTask - INIT: * External hubs are ALLOWED
0:008 MainTask - INIT: * Time before communicating with a newly connected device: 300 ms
0:009 MainTask - INIT: *********************************************************************
0:010 MainTask - INIT: Init completed
0:011 MainTask - INIT: Enumeration of devices enabled
0:012 USBH_Task - INIT: USBH_Task started
0:112 USBH_isr - INIT: USBH_ISRTask started
0:940 USBH_Task - *** Warning *** Device: _ProcessEnum: DEV_ENUM_GET_LANG_ID failed st:USBH_STATUS_BITSTUFFING, len:0 
0:947 USBH_Task - APP: **** Device added [1]

1:012 MainTask - APP: **** Device information for interface with ID 1
1:013 MainTask - APP:    Device ID: 1
1:014 MainTask - APP:    Vendor ID: 0x0409
1:014 MainTask - APP:    Product ID: 0x0059
1:015 MainTask - APP:    BCD device version: 0x100
1:016 MainTask - APP:    Interface number: 0
1:017 MainTask - APP:    Device class: 0x9
1:018 MainTask - APP:    Device subclass: 0x0
1:018 MainTask - APP:    Device protocol: 0x0
1:019 MainTask - APP:    Number of open handles: 0
1:020 MainTask - APP:    Exclusive state: 0
1:021 MainTask - APP:    Speed: FullSpeed
1:022 MainTask - APP:       connected to port 1 of controller 0
12:323 USBH_Task - APP: **** Device added [2]

12:323 MainTask - APP: **** Device information for interface with ID 1
12:324 MainTask - APP:    Device ID: 1
12:324 MainTask - APP:    Vendor ID: 0x0409
12:325 MainTask - APP:    Product ID: 0x0059
12:326 MainTask - APP:    BCD device version: 0x100
12:327 MainTask - APP:    Interface number: 0
12:328 MainTask - APP:    Device class: 0x9
12:329 MainTask - APP:    Device subclass: 0x0
12:329 MainTask - APP:    Device protocol: 0x0
12:330 MainTask - APP:    Number of open handles: 0
12:331 MainTask - APP:    Exclusive state: 0
12:332 MainTask - APP:    Speed: FullSpeed
12:332 MainTask - APP:       connected to port 1 of controller 0
12:333 MainTask - APP: **** Device information for interface with ID 2
12:334 MainTask - APP:    Device ID: 2
12:335 MainTask - APP:    Vendor ID: 0x093A
12:336 MainTask - APP:    Product ID: 0x2510
12:336 MainTask - APP:    BCD device version: 0x100
12:337 MainTask - APP:    Interface number: 0
12:338 MainTask - APP:    Device class: 0x3
12:339 MainTask - APP:    Device subclass: 0x1
12:340 MainTask - APP:    Device protocol: 0x2
12:341 MainTask - APP:    Number of open handles: 0
12:342 MainTask - APP:    Exclusive state: 0
12:343 MainTask - APP:    Speed: LowSpeed
12:350 MainTask - APP:    Manufacturer name: PixArt
12:363 MainTask - APP:    Product name: USB Optical Mouse
12:364 MainTask - APP:       connected to port 2 of HUB 1
12:365 MainTask - APP:       connected to port 1 of controller 0
31:964 USBH_Task - APP: **** Device removed [2]

31:966 MainTask - APP: **** Device information for interface with ID 1
31:967 MainTask - APP:    Device ID: 1
31:968 MainTask - APP:    Vendor ID: 0x0409
31:968 MainTask - APP:    Product ID: 0x0059
31:969 MainTask - APP:    BCD device version: 0x100
31:970 MainTask - APP:    Interface number: 0
31:971 MainTask - APP:    Device class: 0x9
31:972 MainTask - APP:    Device subclass: 0x0
31:973 MainTask - APP:    Device protocol: 0x0
31:973 MainTask - APP:    Number of open handles: 0
31:974 MainTask - APP:    Exclusive state: 0
31:975 MainTask - APP:    Speed: FullSpeed
31:976 MainTask - APP:       connected to port 1 of controller 0

(MSDクラス)Sample: USBH_MSD_Start

操作手順:ファイルシステムのUSBH-MSDドライバ定義ファイル「FS_USBH_MSDConfig.c」をビルド対象に設定してプロジェクトをビルドします。プログラム起動してUSBポートにUSBディスクを挿入します。
テスト完了後に「FS_USBH_MSDConfig.c」をビルド対象外に設定します。

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
RTOS: SEGGER embOS
------------------------------------------------
0:002 MainTask - INIT: emUSB-Host Init started. Version 2.36.5
0:004 MainTask - INIT: *********************************************************************
0:005 MainTask - INIT: *                       emUSB-Host Configuration                    *
0:006 MainTask - INIT: *********************************************************************
0:007 MainTask - INIT: * External hubs are ALLOWED
0:009 MainTask - INIT: * Time before communicating with a newly connected device: 300 ms
0:010 MainTask - INIT: *********************************************************************
0:011 MainTask - INIT: Init completed
0:012 MainTask - INIT: Enumeration of devices enabled
0:013 USBH_Task - INIT: USBH_Task started
0:113 USBH_isr - INIT: USBH_ISRTask started
45:442 USBH_Task - APP: **** Device added [0]
45:443 MainTask - APP: The following device was detected:

45:444 MainTask - APP: VendorId:           0x0411
45:445 MainTask - APP: ProductId:          0x023A
45:446 MainTask - APP: VendorName:         BUFFALO 
45:447 MainTask - APP: ProductName:        USB Flash Disk  
45:448 MainTask - APP: Revision:           1.00
45:449 MainTask - APP: NumSectors:         60566016
45:450 MainTask - APP: BytesPerSector:     512
45:451 MainTask - APP: TotalSize:          29573 MByte
45:452 MainTask - APP: HighspeedCapable:   No
45:453 MainTask - APP: ConnectedToRootHub: No
45:454 MainTask - APP: SelfPowered:        No
45:455 MainTask - APP: Reported Imax:      150 mA
45:456 MainTask - APP: Connected to Port:  3
45:456 MainTask - APP: PortSpeed:          FullSpeed

45:457 MainTask - APP: Checking whether the volume is formatted...
45:677 MainTask - APP: Running sample on volume "msd:0:" DevIndex 0, LUN 0
45:678 MainTask - APP: Reading volume information...
45:679 MainTask - APP: **** Volume information for msd:0:
45:680 MainTask - APP:    30270720 KBytes total disk space
45:681 MainTask - APP:    29884224 KBytes available free space
45:682 MainTask - APP:    32768 bytes per cluster
45:683 MainTask - APP:    945960 clusters available on volume
45:684 MainTask - APP:    933882 free cluster available on volume
45:685 MainTask - APP: Creating file msd:0:\TestFile.txt...
45:702 MainTask - APP: Ok
45:702 MainTask - APP: Contents of msd:0: 
45:703 MainTask - APP:        Attributes: A--- Size: 0
45:704 MainTask - APP: TestFile.txt       Attributes: A--- Size: 358
45:706 MainTask - APP: Firmware.old (Dir) Attributes: ---- Size: 0
45:707 MainTask - APP: Firmware (Dir) Attributes: ---- Size: 0
45:708 MainTask - APP: System Volume Information (Dir) Attributes: --HS Size: 0
45:709 MainTask - APP: First_RX65N (Dir) Attributes: ---- Size: 0
45:710 MainTask - APP: **** Unmount ****

(HIDクラス)Sample: USBH_HID_Start

操作手順:プログラム起動してUSBポートにHID キーボード又はマウスデバイスを挿入します。マウス操作又はキーボードデバイスからキーを入力してレスポンスをログコンソールから確認します。

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
RTOS: SEGGER embOS
------------------------------------------------
0:002 MainTask - INIT: emUSB-Host Init started. Version 2.36.5
0:004 MainTask - INIT: *********************************************************************
0:005 MainTask - INIT: *                       emUSB-Host Configuration                    *
0:006 MainTask - INIT: *********************************************************************
0:007 MainTask - INIT: * External hubs are ALLOWED
0:008 MainTask - INIT: * Time before communicating with a newly connected device: 300 ms
0:009 MainTask - INIT: *********************************************************************
0:010 MainTask - INIT: Init completed
0:011 MainTask - INIT: Enumeration of devices enabled
0:012 USBH_Task - INIT: USBH_Task started
0:113 USBH_isr - INIT: USBH_ISRTask started
7:354 USBH_Task - APP: **** Device added [0]
13:442 MainTask - APP: Mouse: xRel: 21, yRel: 5, WheelRel: 0, ButtonState: 0
13:444 MainTask - APP: Mouse: xRel: 2, yRel: 0, WheelRel: 0, ButtonState: 0
13:445 MainTask - APP: Mouse: xRel: 3, yRel: 0, WheelRel: 0, ButtonState: 0
13:446 MainTask - APP: Mouse: xRel: 6, yRel: 2, WheelRel: 0, ButtonState: 0
13:447 MainTask - APP: Mouse: xRel: 3, yRel: 1, WheelRel: 0, ButtonState: 0
13:448 MainTask - APP: Mouse: xRel: 6, yRel: 2, WheelRel: 0, ButtonState: 0
13:449 MainTask - APP: Mouse: xRel: 2, yRel: 1, WheelRel: 0, ButtonState: 0
13:450 MainTask - APP: Mouse: xRel: 8, yRel: 1, WheelRel: 0, ButtonState: 0
13:452 MainTask - APP: Mouse: xRel: 16, yRel: 6, WheelRel: 0, ButtonState: 0
13:453 MainTask - APP: Mouse: xRel: 3, yRel: 2, WheelRel: 0, ButtonState: 0
13:455 MainTask - APP: Mouse: xRel: 3, yRel: 6, WheelRel: 0, ButtonState: 0
13:456 MainTask - APP: Mouse: xRel: 4, yRel: 0, WheelRel: 0, ButtonState: 0
13:458 MainTask - APP: Mouse: xRel: 8, yRel: 1, WheelRel: 0, ButtonState: 0
13:459 MainTask - APP: Mouse: xRel: 2, yRel: 1, WheelRel: 0, ButtonState: 0
13:460 MainTask - APP: Mouse: xRel: 8, yRel: 2, WheelRel: 0, ButtonState: 0
13:461 MainTask - APP: Mouse: xRel: 127, yRel: 11, WheelRel: 0, ButtonState: 0
13:462 MainTask - APP: Mouse: xRel: 127, yRel: 0, WheelRel: 0, ButtonState: 0
13:463 MainTask - APP: Mouse: xRel: 127, yRel: 0, WheelRel: 0, ButtonState: 0
13:465 MainTask - APP: Mouse: xRel: 29, yRel: 0, WheelRel: 0, ButtonState: 0
13:466 MainTask - APP: Mouse: xRel: 6, yRel: 1, WheelRel: 0, ButtonState: 0
13:467 MainTask - APP: Mouse: xRel: 12, yRel: 0, WheelRel: 0, ButtonState: 0
13:468 MainTask - APP: Mouse: xRel: 5, yRel: 0, WheelRel: 0, ButtonState: 0
13:469 MainTask - APP: Mouse: xRel: 127, yRel: 127, WheelRel: 0, ButtonState: 0
13:470 MainTask - APP: Mouse: xRel: 127, yRel: 16, WheelRel: 0, ButtonState: 0
13:471 MainTask - APP: Mouse: xRel: 127, yRel: 2, WheelRel: 0, ButtonState: 0
13:472 MainTask - APP: Mouse: xRel: 127, yRel: 3, WheelRel: 0, ButtonState: 0
13:473 MainTask - APP: Mouse: xRel: 127, yRel: 3, WheelRel: 0, ButtonState: 0
13:474 MainTask - APP: Mouse: xRel: 127, yRel: 2, WheelRel: 0, ButtonState: 0
13:475 MainTask - APP: Mouse: xRel: 61, yRel: 2, WheelRel: 0, ButtonState: 0
13:476 MainTask - APP: Mouse: xRel: 10, yRel: 1, WheelRel: 0, ButtonState: 0
13:477 MainTask - APP: Mouse: xRel: 127, yRel: 127, WheelRel: 0, ButtonState: 0
13:478 MainTask - APP: Mouse: xRel: 127, yRel: 127, WheelRel: 0, ButtonState: 0
13:480 MainTask - APP: Mouse: xRel: 127, yRel: 106, WheelRel: 0, ButtonState: 0
13:481 MainTask - APP: Mouse: xRel: 127, yRel: 4, WheelRel: 0, ButtonState: 0
13:482 MainTask - APP: Mouse: xRel: 127, yRel: 9, WheelRel: 0, ButtonState: 0
13:483 MainTask - APP: Mouse: xRel: 127, yRel: 4, WheelRel: 0, ButtonState: 0
13:484 MainTask - APP: Mouse: xRel: 127, yRel: 127, WheelRel: 0, ButtonState: 0
13:485 MainTask - APP: Mouse: xRel: 127, yRel: 20, WheelRel: 0, ButtonState: 0
13:486 MainTask - APP: Mouse: xRel: 127, yRel: 0, WheelRel: 0, ButtonState: 0
13:488 MainTask - APP: Mouse: xRel: 127, yRel: 0, WheelRel: 0, ButtonState: 0
13:489 MainTask - APP: Mouse: xRel: 127, yRel: 0, WheelRel: 0, ButtonState: 0
13:491 MainTask - APP: Mouse: xRel: 77, yRel: 0, WheelRel: 0, ButtonState: 0
13:492 MainTask - APP: Mouse: xRel: -1, yRel: 0, WheelRel: 0, ButtonState: 0
13:661 MainTask - APP: Mouse: xRel: -2, yRel: -2, WheelRel: 0, ButtonState: 0
13:662 MainTask - APP: Mouse: xRel: 0, yRel: -3, WheelRel: 0, ButtonState: 0
13:663 MainTask - APP: Mouse: xRel: 0, yRel: -2, WheelRel: 0, ButtonState: 0
13:664 MainTask - APP: Mouse: xRel: 0, yRel: -4, WheelRel: 0, ButtonState: 0
13:665 MainTask - APP: Mouse: xRel: 0, yRel: -1, WheelRel: 0, ButtonState: 0
13:666 MainTask - APP: Mouse: xRel: 1, yRel: -4, WheelRel: 0, ButtonState: 0
13:667 MainTask - APP: Mouse: xRel: 0, yRel: -1, WheelRel: 0, ButtonState: 0
13:668 MainTask - APP: Mouse: xRel: 3, yRel: -6, WheelRel: 0, ButtonState: 0
13:669 MainTask - APP: Mouse: xRel: 51, yRel: -110, WheelRel: 0, ButtonState: 0
13:670 MainTask - APP: Mouse: xRel: 0, yRel: -1, WheelRel: 0, ButtonState: 0
13:671 MainTask - APP: Mouse: xRel: 0, yRel: -6, WheelRel: 0, ButtonState: 0
13:672 MainTask - APP: Mouse: xRel: 1, yRel: 0, WheelRel: 0, ButtonState: 0
13:673 MainTask - APP: Mouse: xRel: 0, yRel: -5, WheelRel: 0, ButtonState: 0
13:674 MainTask - APP: Mouse: xRel: 0, yRel: -2, WheelRel: 0, ButtonState: 0
13:675 MainTask - APP: Mouse: xRel: 0, yRel: -1, WheelRel: 0, ButtonState: 0
13:676 MainTask - APP: Mouse: xRel: -9, yRel: -7, WheelRel: 0, ButtonState: 0
13:716 MainTask - APP: Mouse: xRel: -1, yRel: 0, WheelRel: 0, ButtonState: 0
13:725 MainTask - APP: Mouse: xRel: -2, yRel: 0, WheelRel: 0, ButtonState: 0
13:734 MainTask - APP: Mouse: xRel: -1, yRel: 0, WheelRel: 0, ButtonState: 0
13:759 MainTask - APP: Mouse: xRel: -1, yRel: 0, WheelRel: 0, ButtonState: 0
13:859 MainTask - APP: Mouse: xRel: -1, yRel: 1, WheelRel: 0, ButtonState: 0
13:868 MainTask - APP: Mouse: xRel: -1, yRel: 2, WheelRel: 0, ButtonState: 0
13:869 MainTask - APP: Mouse: xRel: -1, yRel: 1, WheelRel: 0, ButtonState: 0
13:871 MainTask - APP: Mouse: xRel: -2, yRel: 0, WheelRel: 0, ButtonState: 0
13:872 MainTask - APP: Mouse: xRel: -1, yRel: 1, WheelRel: 0, ButtonState: 0
13:881 MainTask - APP: Mouse: xRel: -5, yRel: 2, WheelRel: 0, ButtonState: 0
13:890 MainTask - APP: Mouse: xRel: -1, yRel: 3, WheelRel: 0, ButtonState: 0
13:891 MainTask - APP: Mouse: xRel: 0, yRel: 2, WheelRel: 0, ButtonState: 0
13:892 MainTask - APP: Mouse: xRel: 0, yRel: 1, WheelRel: 0, ButtonState: 0
13:893 MainTask - APP: Mouse: xRel: 23, yRel: 127, WheelRel: 0, ButtonState: 0
13:894 MainTask - APP: Mouse: xRel: 0, yRel: 127, WheelRel: 0, ButtonState: 0
13:895 MainTask - APP: Mouse: xRel: 1, yRel: 8, WheelRel: 0, ButtonState: 0
13:896 MainTask - APP: Mouse: xRel: 0, yRel: 1, WheelRel: 0, ButtonState: 0
13:898 MainTask - APP: Mouse: xRel: 1, yRel: 8, WheelRel: 0, ButtonState: 0
13:899 MainTask - APP: Mouse: xRel: 0, yRel: 2, WheelRel: 0, ButtonState: 0
13:901 MainTask - APP: Mouse: xRel: 1, yRel: 5, WheelRel: 0, ButtonState: 0
13:902 MainTask - APP: Mouse: xRel: 3, yRel: 12, WheelRel: 0, ButtonState: 0
13:904 MainTask - APP: Mouse: xRel: 0, yRel: 2, WheelRel: 0, ButtonState: 0
13:905 MainTask - APP: Mouse: xRel: 1, yRel: 3, WheelRel: 0, ButtonState: 0
13:906 MainTask - APP: Mouse: xRel: 0, yRel: 4, WheelRel: 0, ButtonState: 0
13:907 MainTask - APP: Mouse: xRel: 1, yRel: 1, WheelRel: 0, ButtonState: 0
13:908 MainTask - APP: Mouse: xRel: 1, yRel: 3, WheelRel: 0, ButtonState: 0
13:909 MainTask - APP: Mouse: xRel: 1, yRel: 1, WheelRel: 0, ButtonState: 0
13:910 MainTask - APP: Mouse: xRel: 42, yRel: 1, WheelRel: 0, ButtonState: 0
13:911 MainTask - APP: Mouse: xRel: 0, yRel: -1, WheelRel: 0, ButtonState: 0
13:912 MainTask - APP: Mouse: xRel: 2, yRel: -3, WheelRel: 0, ButtonState: 0
13:913 MainTask - APP: Mouse: xRel: 1, yRel: -1, WheelRel: 0, ButtonState: 0
13:914 MainTask - APP: Mouse: xRel: 1, yRel: -4, WheelRel: 0, ButtonState: 0
13:915 MainTask - APP: Mouse: xRel: 1, yRel: -1, WheelRel: 0, ButtonState: 0
13:916 MainTask - APP: Mouse: xRel: 44, yRel: -127, WheelRel: 0, ButtonState: 0
13:917 MainTask - APP: Mouse: xRel: 0, yRel: -70, WheelRel: 0, ButtonState: 0
13:919 MainTask - APP: Mouse: xRel: 0, yRel: -3, WheelRel: 0, ButtonState: 0
13:920 MainTask - APP: Mouse: xRel: 1, yRel: -1, WheelRel: 0, ButtonState: 0
13:922 MainTask - APP: Mouse: xRel: 0, yRel: -3, WheelRel: 0, ButtonState: 0
13:923 MainTask - APP: Mouse: xRel: 0, yRel: -1, WheelRel: 0, ButtonState: 0
13:925 MainTask - APP: Mouse: xRel: 0, yRel: -3, WheelRel: 0, ButtonState: 0
13:926 MainTask - APP: Mouse: xRel: -11, yRel: -32, WheelRel: 0, ButtonState: 0
13:935 MainTask - APP: Mouse: xRel: -2, yRel: 0, WheelRel: 0, ButtonState: 0
13:944 MainTask - APP: Mouse: xRel: -1, yRel: 0, WheelRel: 0, ButtonState: 0
13:945 MainTask - APP: Mouse: xRel: -1, yRel: 1, WheelRel: 0, ButtonState: 0
13:953 MainTask - APP: Mouse: xRel: -3, yRel: 2, WheelRel: 0, ButtonState: 0
13:954 MainTask - APP: Mouse: xRel: 0, yRel: 1, WheelRel: 0, ButtonState: 0
13:955 MainTask - APP: Mouse: xRel: -1, yRel: 3, WheelRel: 0, ButtonState: 0
13:957 MainTask - APP: Mouse: xRel: -6, yRel: 12, WheelRel: 0, ButtonState: 0
14:037 MainTask - APP: Mouse: xRel: -1, yRel: 1, WheelRel: 0, ButtonState: 0
14:070 MainTask - APP: Mouse: xRel: -1, yRel: -1, WheelRel: 0, ButtonState: 0
14:079 MainTask - APP: Mouse: xRel: -4, yRel: -1, WheelRel: 0, ButtonState: 0
14:088 MainTask - APP: Mouse: xRel: -3, yRel: -1, WheelRel: 0, ButtonState: 0
14:097 MainTask - APP: Mouse: xRel: -2, yRel: 0, WheelRel: 0, ButtonState: 0
14:106 MainTask - APP: Mouse: xRel: -3, yRel: -2, WheelRel: 0, ButtonState: 0
14:115 MainTask - APP: Mouse: xRel: -1, yRel: -1, WheelRel: 0, ButtonState: 0
14:124 MainTask - APP: Mouse: xRel: -1, yRel: 0, WheelRel: 0, ButtonState: 0
14:125 MainTask - APP: Mouse: xRel: -2, yRel: -1, WheelRel: 0, ButtonState: 0
14:126 MainTask - APP: Mouse: xRel: -6, yRel: -7, WheelRel: 0, ButtonState: 0
14:135 MainTask - APP: Mouse: xRel: -1, yRel: -1, WheelRel: 0, ButtonState: 0
14:256 MainTask - APP: Mouse: xRel: 2, yRel: 2, WheelRel: 0, ButtonState: 0
14:257 MainTask - APP: Mouse: xRel: 3, yRel: 3, WheelRel: 0, ButtonState: 0
14:273 MainTask - APP: Mouse: xRel: 3, yRel: -1, WheelRel: 0, ButtonState: 0
14:282 MainTask - APP: Mouse: xRel: 4, yRel: -1, WheelRel: 0, ButtonState: 0
14:283 MainTask - APP: Mouse: xRel: 1, yRel: -1, WheelRel: 0, ButtonState: 0
14:284 MainTask - APP: Mouse: xRel: 1, yRel: 0, WheelRel: 0, ButtonState: 0
14:285 MainTask - APP: Mouse: xRel: 2, yRel: -2, WheelRel: 0, ButtonState: 0
14:286 MainTask - APP: Mouse: xRel: 1, yRel: 0, WheelRel: 0, ButtonState: 0
14:288 MainTask - APP: Mouse: xRel: 33, yRel: -44, WheelRel: 0, ButtonState: 0
14:289 MainTask - APP: Mouse: xRel: 0, yRel: -1, WheelRel: 0, ButtonState: 0
14:291 MainTask - APP: Mouse: xRel: 0, yRel: -1, WheelRel: 0, ButtonState: 0
14:292 MainTask - APP: Mouse: xRel: 1, yRel: -3, WheelRel: 0, ButtonState: 0
14:294 MainTask - APP: Mouse: xRel: 0, yRel: -1, WheelRel: 0, ButtonState: 0
14:295 MainTask - APP: Mouse: xRel: 0, yRel: -2, WheelRel: 0, ButtonState: 0
14:297 MainTask - APP: Mouse: xRel: 0, yRel: -8, WheelRel: 0, ButtonState: 0
14:298 MainTask - APP: Mouse: xRel: -64, yRel: -43, WheelRel: 0, ButtonState: 0

(FTD UARTクラス)Sample: USBH_FT232_Start

操作手順:プログラム起動してUSBポートにFTD UARTチップセットのUSB-UART変換アダプタデバイスを挿入します。UARTポートをパソコンに接続してTeraTermなど起動してCOMポートコンソールを開きます。COMポートコンソールから文字を入力してログコンソールからECHOレスポンスを確認します。

Debug IO Console:

6:223 USBH_Task - APP: **** Device added [0]
6:233 MainTask - APP: Vendor  Id = 0x0403
6:234 MainTask - APP: Product Id = 0x6001
6:235 MainTask - APP: bcdDevice  = 0x0400
58:543 MainTask - APP: Received: "F"
58:730 MainTask - APP: Received: "T"
61:443 MainTask - APP: Received: "2"
61:982 MainTask - APP: Received: "3"
62:393 MainTask - APP: Received: "2"
64:387 MainTask - APP: Received: "C"
64:829 MainTask - APP: Received: "l"
64:968 MainTask - APP: Received: "a"
65:315 MainTask - APP: Received: "s"
65:486 MainTask - APP: Received: "s"
66:393 MainTask - APP: Received: "T"
66:559 MainTask - APP: Received: "e"
66:806 MainTask - APP: Received: "s"
66:898 MainTask - APP: Received: "t"

(AUDIOクラス)Sample: USBH_AUDIO_ScanDevices

操作手順:USB AUDIOデバイス(スピーカー・ヘッドセットなど)を挿入してプログラムを実行します。ログコンソールからAUDIOデバイスの情報を確認します。

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
RTOS: SEGGER embOS
------------------------------------------------
0:113 MainTask - INIT: emUSB-Host Init started. Version 2.36.5
0:114 MainTask - INIT: *********************************************************************
0:115 MainTask - INIT: *                       emUSB-Host Configuration                    *
0:116 MainTask - INIT: *********************************************************************
0:117 MainTask - INIT: * External hubs are ALLOWED
0:118 MainTask - INIT: * Time before communicating with a newly connected device: 300 ms
0:119 MainTask - INIT: *********************************************************************
0:120 MainTask - INIT: Init completed
0:120 MainTask - INIT: Enumeration of devices enabled
0:121 USBH_Task - INIT: USBH_Task started
0:222 USBH_isr - INIT: USBH_ISRTask started
6:714 USBH_Task - APP: **** AUDIO Interface added [0]
6:715 USBH_Task - APP: **** AUDIO Interface added [1]
6:716 USBH_Task - APP: **** AUDIO Interface added [2]
6:723 MainTask - APP: AUDIO control interface found (DevId 1):
6:724 MainTask - APP:   Vendor 2D0B, Product 0002, Version 1.0
6:725 MainTask - APP:   Serial: 00000000
6:739 MainTask - APP:   Manuf.: IPD Korea
6:759 MainTask - APP:   Prod. : IPD USB Headset
6:760 MainTask - APP:   Input terminal 1
6:761 MainTask - APP:     Terminal type 402
6:762 MainTask - APP:   Output terminal 3, Source 2
6:763 MainTask - APP:     Terminal type 101
6:764 MainTask - APP:   Input terminal 4
6:765 MainTask - APP:     Terminal type 101
6:766 MainTask - APP:   Output terminal 6, Source 5
6:767 MainTask - APP:     Terminal type 402
6:767 MainTask - APP:   Input terminal 10
6:768 MainTask - APP:     Terminal type 201
6:769 MainTask - APP:   Feature Unit 2, Source 1
6:770 MainTask - APP:     Control channel 0, mask = 43
6:775 MainTask - APP:       Volume: Cur = 0, Min = FFFFE200, Max = 500, Res = 100
6:776 MainTask - APP:     Control channel 1, mask = 0
6:777 MainTask - APP:     Control channel 2, mask = 0
6:778 MainTask - APP:   Feature Unit 5, Source 12
6:779 MainTask - APP:     Control channel 0, mask = 1
6:780 MainTask - APP:     Control channel 1, mask = 2
6:785 MainTask - APP:       Volume: Cur = 500, Min = FFFFCE00, Max = 500, Res = 100
6:786 MainTask - APP:     Control channel 2, mask = 2
6:791 MainTask - APP:       Volume: Cur = 500, Min = FFFFCE00, Max = 500, Res = 100
6:793 MainTask - APP:   Feature Unit 11, Source 10
6:793 MainTask - APP:     Control channel 0, mask = 3
6:798 MainTask - APP:       Volume: Cur = 3B3, Min = 0, Max = 1000, Res = 1
6:799 MainTask - APP:     Control channel 1, mask = 0
6:800 MainTask - APP:     Control channel 2, mask = 0
6:801 MainTask - APP:   Mixer Unit 12
6:802 MainTask - APP:     Input 1 = source unit 4
6:803 MainTask - APP:     Input 2 = source unit 11
6:804 MainTask - APP:     Output channels 2, wChannelConfig = 3
6:805 MainTask - APP:     Control mask[0] = 00
6:806 MainTask - APP: AUDIO streaming interface found (DevId 1):
6:807 MainTask - APP:   Found streaming IN EP on AltSetting 1
6:808 MainTask - APP:     Terminal Link 3
6:809 MainTask - APP:     Channels=2, Frame=2, Resolution=16
6:810 MainTask - APP:   Sampling Frequencies:
6:811 MainTask - APP:       8000 Hz
6:812 MainTask - APP:      16000 Hz
6:812 MainTask - APP:      24000 Hz
6:813 MainTask - APP:      32000 Hz
6:814 MainTask - APP:      44100 Hz
6:814 MainTask - APP:      48000 Hz
6:815 MainTask - APP: AUDIO streaming interface found (DevId 1):
6:816 MainTask - APP:   Found streaming OUT EP on AltSetting 1
6:817 MainTask - APP:     Terminal Link 4
6:818 MainTask - APP:     Channels=2, Frame=2, Resolution=16
6:819 MainTask - APP:   Sampling Frequencies:
6:820 MainTask - APP:       8000 Hz
6:820 MainTask - APP:      16000 Hz
6:821 MainTask - APP:      24000 Hz
6:822 MainTask - APP:      32000 Hz
6:822 MainTask - APP:      44100 Hz
6:823 MainTask - APP:      48000 Hz

(AUDIOクラス)Sample: USBH_AUDIO_Speaker

操作手順:AUDIO SPEAKERデバイスを挿入してプログラムを実行します。スピーカーから音声「It simply works」を確認します。

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
RTOS: SEGGER embOS
------------------------------------------------
0:002 MainTask - INIT: emUSB-Host Init started. Version 2.36.5
0:004 MainTask - INIT: *********************************************************************
0:005 MainTask - INIT: *                       emUSB-Host Configuration                    *
0:006 MainTask - INIT: *********************************************************************
0:007 MainTask - INIT: * External hubs are ALLOWED
0:008 MainTask - INIT: * Time before communicating with a newly connected device: 300 ms
0:009 MainTask - INIT: *********************************************************************
0:010 MainTask - INIT: Init completed
0:011 MainTask - INIT: Enumeration of devices enabled
0:012 USBH_Task - INIT: USBH_Task started
0:113 USBH_isr - INIT: USBH_ISRTask started
6:475 USBH_Task - APP: **** AUDIO Interface added [0]
6:476 USBH_Task - APP: **** AUDIO Interface added [1]
6:477 USBH_Task - APP: **** AUDIO Interface added [2]
6:514 MainTask - APP: AUDIO device:
6:514 MainTask - APP:   Vendor 2D0B, Product 0002, Version 1.0
6:528 MainTask - APP:   Manuf.: IPD Korea
6:548 MainTask - APP:   Prod. : IPD USB Headset
6:549 MainTask - APP:   Found streaming OUT, Channels=2, Frame=2, Resolution=16
6:550 MainTask - APP:   Sampling Frequencies:
6:551 MainTask - APP:       8000 Hz
6:551 MainTask - APP:      16000 Hz
6:552 MainTask - APP:      24000 Hz
6:553 MainTask - APP:      32000 Hz
6:553 MainTask - APP:      44100 Hz
6:554 MainTask - APP:      48000 Hz
6:555 MainTask - APP: Configure Audio device...
6:555 MainTask - APP: SetAltInterface to 1
6:557 MainTask - APP: SetSampleFreq to 48000 Hz
6:560 MainTask - APP: Feature unit 2, Source 1
6:561 MainTask - APP:   Unmute Unit 2, control 0
6:562 MainTask - APP:   Get volume unit 2, control 0
6:567 MainTask - APP:     Volume[0] = 0, FFFFE200, 500, 100
6:568 MainTask - APP:   Set volume to 30 % (EC80)
6:574 MainTask - APP: Feature unit 5, Source 12
6:575 MainTask - APP:   Unmute Unit 5, control 0
6:577 MainTask - APP:   Get volume unit 5, control 1
6:582 MainTask - APP:     Volume[1] = 500, FFFFCE00, 500, 100
6:583 MainTask - APP:   Set volume to 30 % (DE80)
6:589 MainTask - APP:   Get volume unit 5, control 2
6:594 MainTask - APP:     Volume[2] = 500, FFFFCE00, 500, 100
6:595 MainTask - APP:   Set volume to 30 % (DE80)
6:601 MainTask - APP: Feature unit 11, Source 10
6:602 MainTask - APP:   Unmute Unit 11, control 0
6:604 MainTask - APP:   Get volume unit 11, control 0
6:609 MainTask - APP:     Volume[0] = 3B3, 0, 1000, 1
6:610 MainTask - APP:   Set volume to 30 % (4CC)
6:616 MainTask - APP: Open streaming channel
6:617 MainTask - APP: Playing ....
9:100 MainTask - APP: End
前の章

FAT32 ファイルシステム

次の章

USB-Deviceインターフェース