ST AN2405 Application note

AN2405
Obsolete Product(s) - Obsolete Product(s) Obsolete Product(s) - Obsolete Product(s)
Application note
Migrating from RS232-only applications to
RS232/USB applications using Turbo Plus uPSD
Introduction
Most laptops and recent desktops do not have serial ports however many legacy applications still use RS232. The scope of this application note is to migrate such RS232 applications to RS232/USB applications using Turbo Plus uPSD. Since Turbo Plus uPSD has two UART ports, one of them is used for the USB-to-Serial Bridge connection. The scope is to implement an easy migration with minimal impact on legacy applications.
July 2007 Rev 1 1/13
www.st.com
Obsolete Product(s) - Obsolete Product(s) Obsolete Product(s) - Obsolete Product(s)
Contents AN2405
Contents
1 Migration description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Loading CDC class drivers for USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 .INF file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.1 Usbser.inf (Windows 2000,XP only) file: . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 CDC Firmware Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 CDC Class Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.6 USB_UART1 Bridge (HW Connection-User setup or Automatic USB Detect) 8
1.7 USB-to-Serial Bridge plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.8 Example of easy migration to RS232_USB application: . . . . . . . . . . . . . . 9
2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2/13
Obsolete Product(s) - Obsolete Product(s) Obsolete Product(s) - Obsolete Product(s)
AN2405 Migration description

1 Migration description

1.1 Architecture

USB Migrated PC Application
(Legacy Serial Port or Virtual
Serial Port over USB)
Legacy PC Application
UART drivers
UART H/W & DB9
Connector
RS232
UART0 H/W & DB9
Connector
UART0 firmware driver
UART0 only
microcontroller
Firmware Application
Transmitting and
Receiving over UART0
Easy
Migration
UARTdrivers + CDC class
device drivers for USB
(usbser.sys, usbser.inf)
UARTT H/W & DB9 Connector
+
USB H/W & USB Type A
Connector
RS232 or USB
UART0 H/W & DB9
Connector
+
USB H/W & USB Type B
Connector
UQRT0 firmware driver + USB
CDC class driver
MCU -> Turbo Plus uPSD
UART0 Tx and Rx connected
to UART1 Rx and Tx
(HW connection-User Setup or
Automatic USB Detect)
USB-to-UART1 Bridge Plug-in
Unchanged Firmware
Application Transmitting and
Receiving over UART0

1.2 Loading CDC class drivers for USB

Install the setup application provided with this example and the necessary CDC class drivers will be loaded on your PC. The driver installed will work with Windows 2000 & XP
3/13
Obsolete Product(s) - Obsolete Product(s) Obsolete Product(s) - Obsolete Product(s)
Migration description AN2405
only. The .inf file has to be modified to work with Windows 98/Me. When connected to a device that has CDC class implemented, Windows will see USB as a virtual COM port.
PC Application

1.3 .INF file

When a USB device is connected, windows checks the .inf file to load the appropriate driver for the device.
Microsoft does not provide an .inf file with the usbser.sys driver file. The .inf file usbser.inf provided via the setup application allows the user to load the usbser.sys driver file under Windows 2000 and Windows XP. The .inf file has to be modified to work with Windows 98/Me.
Application manufacturers can modify this file and the device descriptors in usb_desc.h for their own VID & PID.
To install the drivers from a directory instead of running the provided setup application, copy the usbser.inf file and usbser.sys file to a folder. When the dialog box displaying “Found New Hardware Wizard” opens up, choose Install from a specific location and point to the folder where the usbser.inf file is copied.
Usbser.sys
CDC Descriptors
Target Device
Usbser.inf
Note: Do not copy the .inf file into the windows\inf folder manually.

1.3.1 Usbser.inf (Windows 2000,XP only) file:

[Version] DriverVer=08/03/2004,5.1.2600.2180 Signature=$CHICAGO$ Class=Ports ClassGUID={4d36e978-e325-11ce-bfc1-08002be10318} Provider=%String0%
; Port Class Install [ClassInstall]
4/13
AddReg=USBClassInstall
[USBClassInstall] HKR,,,,%Enumerator% HKR,,Icon,,"-23"
Loading...
+ 9 hidden pages