Keil Logo

Migrate USB Projects

This section describes the migration of USB Device applications built with RL-ARM to be used with MDK-Professional. Make the following changes to USB Device projects:

Include the library

Include the library into the project from the folder \ARM\RV31\Lib.

  • USB_ARM_L.lib for ARM7 and ARM9 devices.
  • USB_CM3.lib for Cortex-M devices.

Add the configuration file

  1. Copy the file usb_config.c from the folder \ARM\RL\USB\Config.
  2. Add the file to the project.
  3. Open usb_config.c with the µVision Configuration Wizard and set the options as defined in usbcfg.h. For new options refer to RL-USB Device Configuration.

Add the hardware layer driver

  1. Copy the file usb_device_family.c from the folder \ARM\RL\USB\Drivers.
  2. Add the file to the project.

Add the user class module

  1. Copy the file usbd_user_class.c from an example project that matches the device (\ARM\Boards\vendor\board\RL\USB\Device\Class Example).
  2. Add the file to the project.
  3. Port the class functionality from usbuser.c, or any other user files, to the file usbd_user_class.c.

Update the high-level code

  1. Include the files RTL.h and rl_usb.h into the code.
    #include <RTL.h>
    #include <rl_usb.h>
    
  2. Change the function call USB_Init() to usbd_init().
    usbd_init ();                     // Before: USB_Init();
    
  3. Change the function call USB_Connect() to usbd_connect().
    usbd_connect (__TRUE);            // Before: USB_Connect (__TRUE);
    

Remove files from the project folder

  1. class.h
  2. classuser.c and classuser.h
  3. type.h
  4. usb.h
  5. usbcfg.h
  6. usbcore.c and usbcore.h
  7. usbdesc.c and usbdesc.h
  8. usbhw.c and usbhw.h
  9. usbuser.c and usbuser.h

Note

  • Make a backup copy of the original project.
  • It is not imposed to migrate projects to MDK-Professional. Applications written with RL-ARM are still working.
  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.