Community Translation - Distinguishing Different FX3 Devices with Same VID/PID on Host Application – KBA225775

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Hi,               

I would like to translate KBA225775 into Japanese.

Please confirm to my work.

Thanks,

Kenshow

0 Likes
2 Replies
JennaJo
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello, Kenshow-san

Confirm to work this KBA.

Thanks

Jenna

Jenna Jo
0 Likes
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Hi Jenna-san,

                             

Japanese translation was over.
Please check below.

Original KBA:

Distinguishing Different FX3 Devices with Same VID/PID on Host Application – KBA225775

Thanks.

Kenshow

==============================

タイトル: ホストアプリケーションで同じVID/PIDを持つ異なるFX3デバイスを区別する –  KBA22577

バージョン:**

質問:

ホストアプリケーションで同じVID / PIDを持つデバイスをどのように区別できますでしょうか?

回答:

同じVID / PIDを持つ複数のFX3デバイスを使用する場合、シリアル番号の文字列を使用して、ホストアプリケーション上のデバイスを識別できます。FX3デバイスのシリアル番号を含めるには、ファームウェアに次の変更を加えます。

1. デバイスディスクリプタを変更して、シリアル番号の文字列インデックスを含めます。

const uint8_t CyFxUSB30DeviceDscr [] __attribute__((aligned(32)))=

{

    0x12                        /* ディスクリプタのサイズ */

    CY_U3P_USB_DEVICE_DESCR,  /* デバイスディスクリプタのタイプ */

    0x10,0x03,                  /* USB 3.1 */

    0x00,                          /* デバイスクラス*/

    0x00,                          /* デバイスサブクラス*/

    0x00,                          /* デバイスプロトコル*/

    0x09,                          /* EP0最大パケットサイズ:2 ^ 9 */

    0xB4,0x04,                /* ベンダーID */

    0xF1,0x00,                /* 製品ID */

    0x00,0x00,                /* デバイスのリリース番号 */

    0x01,                          /* 製造文字列インデックス */

    0x02,                          /* 製品文字列インデックス */

    0x03,                          /* シリアル番号文字列インデックス */

0x01 /* 構成の数 */

};

2. 文字列ディスクリプタを追加して、シリアル番号を含めます。

const uint8_t CyFxUSBSerialNumberDscr [] __attribute__((aligned(32)))=

{

    0x08, / *ディスクリプタのサイズ */

    0x03, / *デバイスディスクリプタのタイプ */

    '0', 0x00, / *シリアル番号をここに追加 */

    '0', 0x00,                       

    '1', 0x00                       

};

3. ヘッダーファイルを変更して、以下のステートメントを含めます。

extern const uint8_t CyFxUSBSerialNumberDscr [];

4. ファームウェアを変更して、シリアル番号の文字列ディスクリプタへのポインターを設定します。

apiRetStatus = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 3, (uint8_t *) CyFxUSBSerialNumberDscr);

if(apiRetStatus != CY_U3P_SUCCESS)

{

  CyU3PDebugPrint(4, " USB set string descriptor failed, Error code = %d\n", apiRetStatus);

  CyFxAppErrorHandler(apiRetStatus);

}

これらの変更により、デバイスは、ホスト上でデバイスインスタンスパスUSB\VID_04B4&PID_00F1\001として識別されます。強調表示されたセクションはシリアル番号を示します。ホストアプリケーションは、デバイスインスタンスパスを読み取ることによってデバイスを識別します。SetupAPI.lib(Microsoft提供)には、デバイスのインスタンスパスを読み取るためのSetupDiGetDeviceInstanceId() APIが含まれています。

CyUSB3.SYSドライバーにバインドされたデバイスのインスタンスパスを読み取るサンプルホストアプリケーションが添付されています。

==============================

5-June-2020

Kenshow

0 Likes