Keil Logo

Technical Support

On-Line Manuals

RL-ARM User's Guide (MDK v4)

RL-RTX RL-FlashFS RL-TCPnet RL-CAN RL-USB RL-USB for USB Device Applications RL-USB Device Library RL-USB Device Features RL-USB Device Software Stack RL-USB Device Functions RL-USB Device Source Files RL-USB Device Configuration Audio Device (ADC) Options Communication Device (CDC) - ACM Options Human Interface Device (HID) Options Mass Storage Device (MSC) Options Create USB Device Applications Create ADC Applications Create CDC ACM Applications Create HID Applications Create MSC Applications Create Composite Applications Test USB Device Applications Compliance Tests Test HID Client Application RL-USB for USB Host Applications RL-USB Host Library RL-USB Host Features RL-USB Host Software Stack RL-USB Host Functions RL-USB Host Source Files RL-USB Host Configuration Host Controller Driver Selection Host Controller Driver Configuration Host Class Driver Selection Create USB Host Applications Create USB Host HID Applications HID_Kbd Example Create USB Host MSC Applications Create USB Host Class Driver RL-USB Host Constants and Structures Error constants Speed constants Transaction Packet Type constants Transaction Error Type constants USB Request Block structure (USBH_URB) Endpoint structure (USBH_EP) Driver Capabilites structure (USBH_HCI_CAP) Device Class Instance structure (USBH_DCI) Host Controller Instance structure (USBH_HCI) Host Controller Driver structure (USBH_HCD) USB Concepts USB Transfer Rates USB Network Basic Communication Model USB Protocol Control Transfer Interrupt Transfer Isochronous Transfer Bulk Transfer Descriptors Device Configuration Device Descriptor Configuration Descriptor Interface Descriptor Endpoint Descriptor Device Qualifier Descriptor Example Programs Library Reference Appendix

Create CDC ACM Applications

Create CDC ACM Applications explains how to program a USB Communication Device of Abstract Control Model type using the RL-USB Library. Communication applications control networks, serial and wireless communication interfaces, telecom devices, modems, printers, scanners.

Include into the project and configure the following RL-USB Device Source Files:

  1. The library that matches the device core:
    USB_CM1.lib - for Cortex-M1 devices.
    USB_CM3.lib - for Cortex-M3 devices.
    USB_ARM_L.lib - for ARM7 or ARM9 devices.
  2. usb_config.c - to configure the USB system.
  3. board_name-vcom.inf - to configure the driver information file.
  4. usbd_device family.c(.h) - to configure the device hardware layer.
  5. usbd_user_cdc_acm.c - to adapt the code to the application needs.
  6. USBD_Demo.c - to initialize and connect the USB Device from main().
    ..
    usbd_init();                         // USB Initialization
    usbd_connect(__TRUE);                // USB Connect
    while (!usbd_configured ())          // Wait for device to configure
    
                                         // Send message over USB Vitual COM Port
                                         // to the USB Host
    USBD_CDC_ACM_DataSend ("Send data over USB Virtual COM Port.", 36);
    
    ..
    

Applications can be created using existing µVision CDC ACM projects. The RL-USB communication examples use two simple functions that send the signals from the USB Virtual COM port to the boards Serial COM port and vice versa.

  1. Copy all files from any folder \ARM\Boards\Vendor\BoardName\RL\USB\Device\CDC_ACM to a new folder and open the project *.uvproj with µVision. RTX projects are using the RTX-RTOS, whereas simple CDC projects work without an RTOS. However, the USB configuration does not differ.
  2. Open the file usb_config.c and configure the USB device with the Configuration Wizard.
  3. Enable USB Device and set the device characteristics.

    Config USB Device

  4. Adapt the file board_name-vcom.inf whenever the Vendor ID and Product ID has been changed. (See picture above).
  5. Enable Class Support and Communication Device (CDC) - Abstract Control Model (ACM) and set the characteristics.

    Config Communication Device

  6. Optionally, adapt the source file usbd_device family.c that contains hardware dependent code.
  7. Modify the file usbd_user_cdc_acm.c to adapt the code to the application needs.

Note

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.