This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USBH CDC ACM Virtual Com Port Question

In Keil's Run Time Environment

I will only use USB Port
I use it as virtual com.

When I coding USB Host Virtual com
as usbh cdc acm, usart port included, why??

//////////////////////////
extern ARM_DRIVER_USART Driver_USART9;
#define ptrUART_USB (&Driver_USART9)
////////////////////////

In keil's "manage run time environment" configure
mcu : stm32f207vc
CMSIS : core
RTOS : Keil RTX
CMSIS Driver : USART(API) : CDC, USART
USB Host(API) : Full Speed
Device : CStartup, classic
Device : common,Cortex,DMA,GPIO,RCC
USB : Host :CDC

  • Hi Hojin,

    This is just a implementation that provides CMSIS USART driver to communicate with CDC device.
    Index 9 is selected not to clash with any hardware USARTs that a chip has. You can configure the index differently by providing define USART_CDC_DRV0_NUM to the USART_CDC_ACM.c driver.

    You can use USBH CDC without CMSIS USART driver for CDC communicated directly by using USBH functions for example USBH_CDC_ACM_Send/USBH_CDC_ACM_Receive.

  • Hi Milorad Cvjetkovic

    Thanks for your reply

    //////////////////////////////////////////////////////////

    I use sample program "">www.keil.com/.../host_cdc_tutorial.html"

    My problem is "USBH_CDC_ACM_GetDeviceStatus" function is not working,
    May be can't detect usb device connection

    How can I fix
    When I use keil debugger, i can't debug into.

    //////////////////////////////////////////////////////////

    In these sample i don't use MCBSTM32F400 board and STM32F407IGHx mcu
    I use stm32f207vct mcu and my own board equipped with USB

    When I make cdc host and cdc device program using CubeMX,
    connect board each other via USB port using my board

    usb detection,
    send data and receive : USBH_CDC_Transmit,USBH_CDC_Receive, CDC_Transmit_FS function
    working very good

    //////////////////////////////////////////////////////////

  • Hi Hojin,

    What is your CDC device that you want to communicate to with USB Host?
    Is it perhaps some USB Mobile Network adapter?

  • Hi Milorad Cvjetkovic

    My ultimate goal is that my device can communicate with USB device that has vendor specific class but protocol of USB device is a serial, text-based protocol

    that USB device only require but vendor specific class.
    8 data bits;
    no parity bits;
    1 stop bit;
    19200 baud rate.

    Does this "USBH CDC ACM Virtual Com Example" not support it ???
    Do I must know if USB has vendor specific class protocol ?

    Thanks.

  • Hi Hojin,

    you should take a look at following documentation page: www.keil.com/.../host_cust_tutorial.html

    it explains how USB Host is used with Prolific PL2303 USB-to-UART dongle, that device also uses Vendor Specific class.

    And yes, you can not use CDC for communicating with such a device as Vendor Specific means it is not standardized so you need to know the protocol, CDC device is standardized.