Skip to main content
Graduate II
October 13, 2021
Question

Trying to use USB HOST (CDC type) on STM32F746ZG failed receiving data

  • October 13, 2021
  • 1 reply
  • 978 views

Hi

I'm trying to read the output from BARCODE reader (ES4650) using USB-HOST using CDC type.

On connecting the USB cable I'm getting SOF interrupts (although I disable the Signal SOF on CUBE). On pointing the barcode reader to a barcode I'm getting some USB interrupt causes (USB_OTG_GINTSTS_RXFLVL and USB_OTG_GINTSTS_HCINT - both for IN and OUT).

On getting those interrupts I'm looking in the USB data buffer and see no data.

The CDC Class is as follow:

USBH_ClassTypeDef CDC_Class =

{

 "CDC",

 USB_CDC_CLASS,

 USBH_CDC_InterfaceInit,

 USBH_CDC_InterfaceDeInit,

 USBH_CDC_ClassRequest,

 USBH_CDC_Process,

 USBH_CDC_SOFProcess,

 NULL,

};

The code never reach those functions.

I was accepting using other drivers functions as USBH_CDC_Receive or USBH_CDC_ReceiveCallback but as you can see, the CUBE defines others.

What do I do wrong ?

Thanks

    This topic has been closed for replies.

    1 reply

    Super User
    October 13, 2021

    Maybe the device is not CDC ACM compliant. Check the descriptors it sends (maybe when connected to PC, e.g. using lsusb if you are using Linux).

    JW

    OferAuthor
    Graduate II
    October 14, 2021

    Hi JW

    The device support both USB-HOST virtual com-port and USB-HOST HID (keyboard).

    I tested the HID mode and it works like a charm, so I don't have to test the CDC anymore - thanks anyway.

    Ofer