FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: Receive error code of "0x14" when trying to get report id from setup packet  (Read 14675 times)

Yvonne

  • Newbie
  • *
  • Posts: 12
    • View Profile

Hello,

I am using VNC2 as usb host controller transmitting data packets scan by barcode scanner.   
I give value 0x06 for bRequest in the SETUP TRANSFER code as shown in follows, however I get error code 0x14 on my IDE as shown in the attached figure. I could not find what 0x14 meant in the USBHost.h library (the values of USBHOST_STATUS are from -1~16). Therefore, what does the error code 0x14 mean? Any suggestion to fix this problem?

Also, I have two barcode scanners. When I use them to scan the barcode and I receive data in 8 bytes for one and 9 bytes for another. I looked up the data in wireshark on windows, the one more bytes one barcode scanner had is the report id. Therefore, I tried to get the "report id" infromation from the setup data. I tried to give 0x06 (GET_DESCRIPTOR) for bRequest and 0x07 (SET_DESCRIPTOR) for bRequest both, but all of the two command values got into error messgae when running code " vos_dev_ioctl(hUSBHOST_1, &hc_iocb)". One of the error message is 0x14.

Alternatively, I tried to attach the hid driver for usb host but cannnot get the correct report id information as shwon in the first data byte of the 9-bytes-based barcode scanner. My goal is that I want to get the correct report id information, or remover it, or set it into zero to let the two barcode scanners receive the same data byte length. Are there any configs I miss or made wrong? Or any suggestions are appreciated in advanced!

The following is part of my code:
////// test 1 /////////   
    desc_dev.bmRequestType = USB_BMREQUESTTYPE_HOST_TO_DEV | USB_BMREQUESTTYPE_CLASS | USB_BMREQUESTTYPE_DEVICE;
    desc_dev.bRequest = 0x06;
         
    hc_iocb.ioctl_code = VOS_IOCTL_USBHOST_DEVICE_SETUP_TRANSFER;
    hc_iocb.handle.ep = epCtrl;
    hc_iocb.set = &desc_dev;

    status = vos_dev_ioctl(hUSBHOST_1, &hc_iocb);
         
    if (status != USBHOST_OK) {
        break;
    }

    hid_reportid2 = desc_dev.wValue & 0xff;
///////////////////////
/////// test 2 /////////
    desc_dev.bmRequestType = USB_BMREQUESTTYPE_HOST_TO_DEV | USB_BMREQUESTTYPE_CLASS | USB_BMREQUESTTYPE_DEVICE;
    desc_dev.bRequest = 0x07;
    desc_dev.wValue = 0x0200;
            
    hc_iocb.ioctl_code = VOS_IOCTL_USBHOST_DEVICE_SETUP_TRANSFER;
    hc_iocb.handle.ep = epCtrl;
    hc_iocb.set = &desc_dev;

    status = vos_dev_ioctl(hUSBHOST_1, &hc_iocb);
    if (status != USBHOST_OK) {
        break;
    }

    hid_reportid3 = desc_dev.wValue & 0xff;
///////////////////////

Thank you so much for your kind help!

Yvonne
« Last Edit: January 13, 2023, 09:55:35 AM by Yvonne »
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile

Hi,

You can reference the example found in C:\Users\Username\Documents\FTDI\Firmware\Samples\V2.0.2-SP2\USBHost\USBHostHID2. This example has been tested with a barcode scanner.

You should also have a look at Vinculum II User Guide. This details the full VNC2 API. See page 270 for the return codes.

Best Regards

FTDI Community
Logged

Yvonne

  • Newbie
  • *
  • Posts: 12
    • View Profile

Hello,

Thank you for your kind reply. I have had read the return code again in the VNC2 User Guide document.

However, as I need the report id information from hid device in my project, could you give me the instruction that which exmaple code can get the report id info.?

Than you so much!

Yvonne
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile

Hi Yvonne,

The only examples can be found here:

C:\Users\Username\Documents\FTDI\Firmware\Samples\V2.0.2-SP2

I'm not sure if there is a HID report ID example, but if there is it will be in that directory. You can also create your own firmware for this purpose. See Vinculum II User Guide.

Best Regards
FTDI Community
Logged

Yvonne

  • Newbie
  • *
  • Posts: 12
    • View Profile

Hello,

Thank you so much for your kind reply and information.

I modified the example codes based on folders "USBHostHID" and "USBHostHID2" from the path you provided to do my project.

Thank you so much!
Yvonne
Logged