Medusb_user_guide Medusb User Guide

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 20

© Silicon & Software Systems Ltd. 2008
S3 VASC USB Solution
User Guide
Project:
Medical USB Device
Document Number:
TP200834AUG
Version:
1.0
Owner:
Piotr Murawski
Date of Issue:
3 July 2008
Status:
Accepted
Confidential
The contents of this document are owned or controlled by Silicon and Software Systems Limited and
its subsidiaries (“S3”) and are protected under applicable copyright and/or trademark laws. The
contents of this document may only be used or copied in accordance with a written contract with S3
or with the express written permission of S3.
Silicon & Software Systems Ltd.
Email: Info@s3group.com
http://www.s3group.com
S3QS22_T1 – V 2.19
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 2 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
Table of Contents
1 Introduction ..........................................................................................3
1.1
Purpose of this document...............................................................................................3
1.2
Reference Material .........................................................................................................3
1.3
Definitions, Acronyms and Abbreviations.......................................................................4
1.4
Revision History..............................................................................................................5
2 Hardware Environment ........................................................................6
2.1
MCB2300 Board configuration .......................................................................................7
3 Tools......................................................................................................9
3.1
GNUARM Compiler ........................................................................................................9
3.2
Cygwin ............................................................................................................................ 9
3.3
FlashMagic .....................................................................................................................9
3.4
PuTTY.............................................................................................................................9
4 PC Configuration................................................................................10
4.1
Network Interface .........................................................................................................10
4.1.1
TCP Performance Improvement .................................................................................................11
4.2
PuTTY...........................................................................................................................13
4.3
USB Driver for MS WindowsXP ...................................................................................14
5 USB Module Software ........................................................................17
5.1
Compilation...................................................................................................................17
5.1.1
Prerequisite ................................................................................................................................17
5.1.2
Procedure...................................................................................................................................17
5.2
Flashing ........................................................................................................................17
6 PC Software ........................................................................................19
6.1
Shim DLL Libraries Compilation...................................................................................19
6.1.1
Prerequisite ................................................................................................................................19
6.1.2
Procedure...................................................................................................................................19
6.2
Using USB Shim DLLs in an Application......................................................................19
6.3
VASC USB Test Suite ..................................................................................................19
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 3 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
1 Introduction
1.1 Purpose of this document
The User Guide documents tools, installation procedures, source code compilation procedures
and HW installation.
1.2 Reference Material
Reference Author, Title, Document ID Version
1. LNI VASC Transport Interface Design 26 May 2008
2. Requirements Specification for the Medical USB Device 16 April 2008
Table 1 Reference Material
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 4 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
1.3 Definitions, Acronyms and Abbreviations
Acronym /
Abbreviation
Definition
API Application Programming Interface
PHDC Personal Health Medical Class
LAN Local Area Network
LNI Lamprey Networks, Inc.
PAN Personal Area Network
RAM Random Access Memory
ROM Read Only Memory
SoC System-on-Chip
DDK Driver Development Kit
HW Hardware
IEEE Institute of Electrical & Electronics Engineers
ISO International Organization for Standardization
MAC Media Access Control (Address)
OS Operating System
PAN-IF Continua Alliance Personal Area Network Interface
PHDC Personal Healthcare Devices Class
QoS Quality of Service
RTOS Real Time Operating System
S3 Silicon & Software Systems
SW Software
TBD To Be Discussed / Defined
TWG Technical Working Group
TCWG Tests and Certification Working Group
VASC Vendor Assisted Source Code
VID Vendor Identification Code
PID Product Identification Code
Table 2 Definitions, Acronyms and Abbreviations
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 5 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
1.4 Revision History
Date Version Author Remarks
10 June 2008 0.1 Piotr Murawski Initial draft
24 June 2008 0.2 Piotr Murawski Update before release
3 July 2008 1.0 Piotr Murawski Update before release, “Accepted”
Table 3 Revision History
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 6 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
2 Hardware Environment
The Figure 2-1 shows HW environment set-up. There are two PC which implements Agent and
Manager functionality. These two machines can be physically realized in one PC. Both PC
machines run WindowsXP SP2 operating system.
Agent PC
Manager PC
1 2
7
5
6
3
4
Figure 2-1 Hardware Environment
The HW elements:
1) Ethernet RJ45 cable, crossed-over if PC card is not 1Gb capable
2) Dedicated network interface card, it can be 10/100Mb or 10/100Mb/1Gb Ethernet card.
3) USB 2.0 PC interface
4) USB cable Type A-B
5) DE-9 Male-Female RS232 Serial cables
6) Console RS232 Serial (Windows COMx) interface (optional)
7) Flashing RS232 Serial (Windows COMy) interface (used only for initial module flashing
There are two versions of the MCB2300 board which can be used: Version 3.1 and Version 4.0.
Both boards are compatible. On the board, COM0 is used for flashing, COM1 is a console
interface.
Note: The USB Module SW runs only on processor revisions “A” and “B” (B is the latest
revision today). The processor revision is printed on a chip package. See, the chip mark
example below, revision letter is highlighted.
LPC2378FBD144
SH6153.1 02
ZSD0812BY
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 7 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
2.1 MCB2300 Board configuration
2.1.1 Board Version 3.1
The MCB2300 board needs to be configured before being used in the system. The picture
shows jumper settings:
J2,J3, J10, J11, J8, J9 – closed
J3, J13 – open
J5 – three pins jumper, short two pins on LCD display side
J6 – any
Figure 2-2 MCB2300 Board (Version 3.1) jumpers
2.1.2 Board Version 4.0
The MCB2300 board needs to be configured before being used in the system. The picture
shows jumper settings:
LED, ISP, RST, INT0, VBUS, J9 – closed
D-, D+ – three pins jumper, short two pins on a Buzzer side
UMODE – three pins jumper, short two pins on an LCD side
ETM, AD0.0, AOUT – any
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 8 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
Figure 2-3 MCB2300 Board (Version 4.0) jumpers
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 9 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
3 Tools
3.1 GNUARM Compiler
The GNUARM compiler is used to compile the USB Module software. It is a license free ARM
tool-chain. It is recommended to use a version provided with the source code, that is:
“bu-2.17_gcc-4.1.1-c-c++_nl-1.14.0_gi-6.5.exe
Location: “tools/gnuarm
Setup file: “bu-2.17_gcc-4.1.1-c-c++_nl-1.14.0_gi-6.5.exe”
Installation remarks: Use installer defaults, especially keep default location “c:\GNUARM”
Webpage: http://www.gnuarm.org
3.2 Cygwin
The CYGWIN environment is a POSIX type environment. This environment is required for USB
Module software compilation. The installation can be done on-line or off -line.
Installation procedure: Follow instructions from http://www.cygewin.com. During the
installation, select from “Devel” category the package “make, The GNU version of the ‘make
utility” as an addition to the set of packages proposed in a default configuration.
3.3 FlashMagic
FlashMagic is a tool used for USB Module flashing. It is a license free.
Location: “tools/flashmagic”
Setup file: “FlashMagic.exe”
Installation remarks: Use installer defaults
Webpage: http://www.flashmagictool.com/
3.4 PuTTY
PuTTY utility is a terminal emulator. In this project, it is used as serial terminal for USB Module
console input/output
Location: “tools/putty”
Setup file: “putty.exe”
Installation remarks: Use installer defaults
Webpage: http://www.chiark.greenend.org.uk/~sgtatham/putty
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 10 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
4 PC Configuration
4.1 Network Interface
By default, the USB Module has IP address 192.168.0.100. Therefore, the network card
dedicated for used with the module must have IP address of the same network that is
192.168.0.X where X can be any number between 1-254 excluding IP address of the module. It
is also recommended to disable protocols which are not used leaving only “Internet Protocol
(TCP/IP)” checked. The pictures below shows the network interface configuration example.
Figure 4-1 Network Interface protocols confutation
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 11 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
Figure 4-2 TCP/IP configuration
4.1.1 TCP Performance Improvement
TCP connection is used to transfer number of small packets, which is contradict to a default
TCP performance configuration, which is tuned for best permanence in transferring big packets.
Therefore, some changes must to be done in a Windows registry.
Step #1 – find registry entry for the dedicated network interface.
Under DOS command shell (Start/Run, then type cmd) execute a command:
reg query HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\ /s
The result will look like this:
! REG.EXE VERSION 3.0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\\{4DF1B
774-7B55-48CE-AA61-4EC9AB414575}
UseZeroBroadcast REG_DWORD 0x0
EnableDHCP REG_DWORD 0x0
IPAddress REG_MULTI_SZ 0.0.0.0\0\0
SubnetMask REG_MULTI_SZ 0.0.0.0\0\0
DefaultGateway REG_MULTI_SZ \0
EnableDeadGWDetect REG_DWORD 0x1
DontAddDefaultGateway REG_DWORD 0x0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\\{54187
E3D-8C76-49D0-AFF9-9E2A8E6AAD30}
UseZeroBroadcast REG_DWORD 0x0
EnableDHCP REG_DWORD 0x0
IPAddress REG_MULTI_SZ 0.0.0.0\0\0
SubnetMask REG_MULTI_SZ 0.0.0.0\0\0
DefaultGateway REG_MULTI_SZ \0
EnableDeadGWDetect REG_DWORD 0x1
DontAddDefaultGateway REG_DWORD 0x0
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 12 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\\{BE9CE
2CF-3F7F-4B80-8E9F-F3E99F23E07A}
UseZeroBroadcast REG_DWORD 0x0
EnableDeadGWDetect REG_DWORD 0x1
EnableDHCP REG_DWORD 0x1
IPAddress REG_MULTI_SZ 0.0.0.0\0\0
SubnetMask REG_MULTI_SZ 0.0.0.0\0\0
DefaultGateway REG_MULTI_SZ \0
DefaultGatewayMetric REG_MULTI_SZ \0
NameServer REG_SZ
Domain REG_SZ
RegistrationEnabled REG_DWORD 0x1
RegisterAdapterName REG_DWORD 0x0
TCPAllowedPorts REG_MULTI_SZ 0\0\0
UDPAllowedPorts REG_MULTI_SZ 0\0\0
RawIPAllowedProtocols REG_MULTI_SZ 0\0\0
NTEContextList REG_MULTI_SZ 0x00000004\0\0
DhcpClassIdBin REG_BINARY
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\\{C8050
C37-337A-46AA-A6D5-0DD92EF539DB}
UseZeroBroadcast REG_DWORD 0x0
EnableDeadGWDetect REG_DWORD 0x1
EnableDHCP REG_DWORD 0x0
IPAddress REG_MULTI_SZ 192.168.0.26\0\0
SubnetMask REG_MULTI_SZ 255.255.255.0\0\0
DefaultGateway REG_MULTI_SZ \0
DefaultGatewayMetric REG_MULTI_SZ \0
NameServer REG_SZ
Domain REG_SZ
RegistrationEnabled REG_DWORD 0x0
RegisterAdapterName REG_DWORD 0x0
TCPAllowedPorts REG_MULTI_SZ 0\0\0
UDPAllowedPorts REG_MULTI_SZ 0\0\0
RawIPAllowedProtocols REG_MULTI_SZ 0\0\0
NTEContextList REG_MULTI_SZ 0x00000003\0\0
DhcpClassIdBin REG_BINARY
DhcpServer REG_SZ 255.255.255.255
Lease REG_DWORD 0xe10
LeaseObtainedTime REG_DWORD 0x4643326c
T1 REG_DWORD 0x46433974
T2 REG_DWORD 0x46433eba
LeaseTerminatesTime REG_DWORD 0x4643407c
IPAutoconfigurationAddress REG_SZ 0.0.0.0
IPAutoconfigurationMask REG_SZ 255.255.0.0
IPAutoconfigurationSeed REG_DWORD 0x0
AddressType REG_DWORD 0x0
The important parameter is the GUID (marked in red) of the interface which IP address match
the address of the network interface used to communicate with the USB Module. This interface
can be recognized by IPAddress value, marked in green in the above example.
Step #2 – update registry
Create a file with “.reg” extension. The file should contain:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{C8050
C37-337A-46AA-A6D5-0DD92EF539DB}]
"TcpAckFrequency"=dword:00000001
"TcpDelAckTicks"=dword:00000000
Note, for the key address, use GUID discovered during the step #1.
Execute the file by double clicking on it. The registry will be updated.
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 13 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
4.2 PuTTY
The PuTTY utility is used as a serial terminal. Generally, the USB Module requires an RS232
interface with the following characteristics:
speed 115200 kbps
8 data bits
1 stop bit
no parity
no flow control
The picture below shows PuTTY configuration for as a serial terminal. Important note, the COM
number depends on a particular system configuration. It must be identifier of RS232 interface
connected to the console serial interface of the USB Module (“6”-COMx on the Figure 2-1).
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 14 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
Figure 4-3 PuTTY configuration
4.3 USB Driver for MS WindowsXP
The USB interface does not require any special configuration prior USB Module connection.
After the first time the module is connected to a PC, Windows will recognize a new device.
Then, the driver must be installed. Since the USB configurations, so called descriptors, are not
fixed, the system will ask for a driver any time the descriptors are changed.
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 15 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
The driver installation starts from “Found New Hardware Wizard” window:
Select “No, not this time
Click “Next”
Select “Install from a list of specific location…”
Click “Next”
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 16 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
Use “Browse to select the location of the driver, which is provided by S3 together with the
source code. Its location is “…\usb_manager\driver\libusb-win32\bin”
Click “Next” the system should copy necessary files and install the new USB Module device
The option “Install the software automatically… can be selected if the driver was already
installed on this PC and driver files from the “bin” directory have not been removed.
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 17 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
5 USB Module Software
5.1 Compilation
5.1.1 Prerequisite
CYGWIN with the “make” utility, see section 3.2
GNUARM compiler, see section 3.1. Note, the c:\GNUARM\bin” must be added to the “path”
Windows environment variable. If it is not, use the Windows “System Properties” dialog
(accessible after right click on the “My Computer” desktop icon), tab “Advanced” and button
“Environment variables”. Modify the “Path” variable from System Variables.
5.1.2 Procedure
Start CYGWIN (an icon should be created on the desktop)
Move to the location of the USB Module source. E.g. if the sources are in a directory
“c:\s3src\usb_module\”, the command
cd /cygdrive/c/s3src/usb_module
should be typed in the CYGWIN console.
Check if the compiler is accessible by typing:
arm-elf-gcc --help
The result should be help text from the compiler. If the compiler is not accessible, check
your “path” variable.
Clean the sources, just in case there are any previous compilation remaining:
make clean
Compile issuing the command:
make bin
The compilation ends successfully if there are no errors and linking has been executed. The
last output line should be Generating raw binary files …”
Output image files are located in the “usb_module\_out_” directory.
5.2 Flashing
In order to flash compiled image into the USB Module microcontroller, use the FlashMagic
utility. The figure below shows the utility panel.
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 18 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
To do flashing, all parameters should be set as on the picture. Using “Browse” button, select the
“output.hex file. The picture shows the location of the file which assumes source code location
defined in section 5.1.2. The “COM Port” can be different depending on RS232 PC interface
connected to the flashing socket, see “7” on Figure 2-1.
Note, checking the “Erase all Flash+Code Rd Prot” will restore the default IP address. The
default address is 192.168.0.100.
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 19 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
6 PC Software
6.1 Shim DLL Libraries Compilation
USB Agent and Manager Shims are compiled into dynamically linked libraries (DLLs). There are
separate DLLs for USB Agent and USB Manager.
6.1.1 Prerequisite
MS Visual Studio 2005
6.1.2 Procedure
Open VASC USB test solution in MS Visual Studio.
The solution is located at:
s3src/test/vasc_usb_test/vasc_usb_test.sln
The solution consists of a test project and depends on USB Shim DLL projects located at:
s3src/usb_agent/proj/usb_agent/usb_agent.vcproj
s3src/usb_manager/proj/usb_manager/usb_manager.vcproj
Compile the solution
The compilation should complete with no errors.
The compilation produces test application and the USB Shim DLLs:
s3src/usb_agent/proj/usb_agent/Debug/usb_agent.dll
s3src/usb_manager/proj/usb_manager/Debug/usb_manager.dll
6.2 Using USB Shim DLLs in an Application
Please, use the VASC USB Test Application as an example of using the USB Shim DLLs.
DLL loading is done in function vut_Test1_2_common() in file:
s3src/test/vasc_usb_test/vasc_usb_test.cpp
6.3 VASC USB Test Suite
The VASC USB Test Suite is an executable Windows console application that loads both USB
Shim DLLs and performs a set of functional and performance tests.
Tests are specified in medusb_test_specification.xls.
S3 VASC USB Solution
TP200834AUG Version: 1.0 Accepted
Issue Date: 3 July 2008 Page 20 of 20
© Silicon & Software Systems Ltd. 2008
Confidential
Test application is compiled as described in sec. 6.1.2.
The application executable is located at:
s3src/test/vasc_usb_test/Debug/vasc_usb_test.exe
The application has a text based menu.
Type “1” to select “1 – Run All Tests” to run the entire set of VASC USB tests.
The USB Module has to be connected to the USB port and Ethernet port of the PC running the
test application. The USB Module must have the default IP address (192.168.0.100).
When the tests are completed, the Test Report can by generated by typing 7 (“7 – Test
Report”).

Navigation menu