Vdrive - Vinculum Firmware
Vdrive - Vinculum Firmware
Future Technology Devices International Ltd (FTDI) 373 Scotland Street, Glasgow G5 8QB United Kingdom Tel.: +44 (0) 141 429 2777 Fax: + 44 (0) 141 429 2758
Vinculum is part of Future Technology Devices International Ltd. Neither the whole nor any part of the information contained in, or the product described in this manual, may be adapted or reproduced in any material or electronic form without the prior written consent of the copyright holder. This product and its documentation are supplied on an as-is basis and no warranty as to their suitability for any particular purpose is either made or implied. Future Technology Devices International Ltd will not accept any claim for damages howsoever arising as a result of use or failure of this product. Your statutory rights are not affected. This product or any variant of it is not intended for use in any medical appliance, device or system in which the failure of the product might reasonably be expected to result in personal injury. This document provides preliminary information that may be subject to change without notice. No freedom to use patents or other intellectual property rights is implied by the publication of this document. Future Technology Devices International Ltd, 373 Scotland Street, Glasgow G5 8QB United Kingdom. Scotland Registered Number: SC136640
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Table of Contents
1 Preface ............................................................................................ 5
1.1 1.2 Conventions ...................................................................................... 5 Acronyms and Abbreviations ............................................................. 5
Introduction .................................................................................... 7
2.1 Command Monitor ............................................................................. 7
Command Monitor Modes ........................................................................... 7 2.1.1
VDAP Firmware ................................................................................. 9 VMSC Firmware ................................................................................. 9 VDIF Firmware ................................................................................ 10 VCDC Firmware ............................................................................... 11 VDPS Firmware ............................................................................... 11 VDFC Firmware................................................................................ 12
4.2.1 4.2.2
5.2.1 5.2.2
5.3
Filenames ........................................................................................ 17
Valid Characters ...................................................................................... 17 Valid Filenames ....................................................................................... 18 Displaying Filenames ............................................................................... 18
5.4 5.5
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
5.6
6.2
6.2.1 6.2.2 6.2.3 6.2.4 6.2.5 6.2.6 6.2.7 6.2.8 6.2.9 6.2.10 6.2.11 6.2.12 6.2.13 6.2.14 6.2.15 6.2.16 6.2.17 6.2.18
6.3
6.4
6.4.1 6.4.2
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
6.5
6.5.1 6.5.2
6.6
6.7
6.8
6.8.1 6.8.2 6.8.3 6.8.4 6.8.5 6.8.6 6.8.7 6.8.8 6.8.9 6.8.10
6.9
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Examples ....................................................................................... 65
8.1 8.2 8.3 Sending Data to USB Device (Data Mode) ........................................ 65 Sending Data to USB Device (Command Mode) ................................ 66 VDPS to PC Host .............................................................................. 67
Troubleshooting ............................................................................ 68
9.1 Monitor Port .................................................................................... 68
Cannot Connect to Monitor Port ................................................................. 68 No Prompt after USB Disk Detected ........................................................... 68 Device Unresponsive after FS or FSE Commands ......................................... 68 Device Unresponsive after Disk Operation .................................................. 68 9.1.1 9.1.2 9.1.3 9.1.4
9.2
10 Contact Information ...................................................................... 72 Appendix A - References ..................................................................... 73 Appendix B - Acronyms and Abbreviations ......................................... 74 Appendix C - List of Figures and Tables .............................................. 75
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Preface
The objective of this document is to detail the functions performed by the Vinculum VNC1L firmware, the differences between each firmware version and the connections required to be made to the device.
1.1 Conventions
The following conventions are used in this document:
Convention Monospaced type Boldface monospaced type Italic monospaced type Important Note Warning
Description Indicates input or output from the monitor. Indicates input supplied by the user. Indicates binary characters. Signals that the information supplied is important. Provide additional information about a topic. Indicate potential damage to equipment or loss of data. Is used to show a range. For instance, a range of bits 15:9 is bits 15 to 9 (inclusive) of a binary value. Indicated information specific to the VNC1L device. carriage return (0x0D).
VNC1L
d x c
space (0x20). Represents a single decimal character (0 to 9). Represents a single hexadecimal character (0 to 9 and A to F). Represents a binary character (0x00 to 0xFF).
BOMS
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Terms MBR Description Master Boot Record. Part of the FAT file system. Command line interface which allows instructions to be given to the VNC1L and responses to be returned. Least Significant Byte is shown first when representing a multi-byte number as a LSB sequence of bytes. E.g. a number 0x55AAFF00 is stored or specified as 4 bytes 0x00, 0xFF, 0xAA and 0x55. Most Significant Byte is shown first when representing a multi-byte number as a MSB sequence of bytes. E.g. a number 0x55aaff00 is stored or specified as 4 bytes 0x55, 0xaa, 0xff and 0x00. Sector Size The size of data which is read from or written to a disk in a single operation. The size of data block allocated on a disk to store files or directory structures. Integer multiples of clusters must be used to store large files or directories. The topmost directory in a FAT file system. American Standard Code for Information Interchange. A 7 bit Character Set representing the character codes from 0x00 to 0x7F. Non-ASCII characters representing character codes from 0x80 to 0xFF. Single Byte Character Set where one byte of data corresponds to one character. Double Byte Character Set where two bytes of data correspond to a single character.
Monitor
Cluster Size
Root Directory
ASCII
DBCS
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Introduction
The VNC1L device has two USB host ports as well as a combined UART, SPI or FIFO interface. The combined interface is selectable using a pair of pins connected to either pull-ups or pulldowns. The firmware for the VNC1L allows a command monitor port to be active on either the combined interface or one of the USB Ports. The main function of the monitor is to allow an embedded device to communicate via the VNC1Ls UART, FIFO or SPI interface port with USB slave peripheral devices. Typical slave peripheral devices include USB Flash disks; FTDIs FT232, FT245 and FT2232; as well as devices that are Printer class or HID (Human Input Device) class compatible. Other devices may also be supported if they have a suitable interface. For instance, CDC class equipment such as some mobile phones. The 2 USB Ports are referred to as USB Port 1 and USB Port 2 in this document.
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Firmware Functionality
There are several pre-compiled firmware versions available: VDAP (disk and peripherals) VDIF (disk and FTDI Interface) VMSC (music player) VDPS (disk, PC monitor and slave port) VCDC (communication class device) VDFC (disk and file copier)
Device Type
BOMS
FTDI Peripheral 1 Y 2 Y Y Y Y Y 1 Y
HID
Printer
Hub
PC Host
Monitor
CDC
2 Y Y Y Y Y
2 Y Y Y Y Y
1 Y
2 Y Y Y Y Y
1 Y
2 Y
1 Y
2 Y
Y Y Y Y Y Y Y Y
VDAP firmware is the most general purpose and supports most devices on Port 1 and Port 2. The VMSC and VCDC builds are based on the VDAP code and so provide similar functionality. VDPS firmware is required if the VNC1L is to be used as both a host and a slave device. VDIF should only be used in exceptional applications where the monitor must be accessible on USB Port 1. Note: The VMSC is provided with additional commands specifically for the VMUSIC range of devices to permit playback of MP3 files via a VLSI VS1003 MP3 decoder. The VS1011 MP3 decoder is also supported.
Copyright 2008 Future Technology Devices International Limited 8
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
The VLSI VS1003 is referenced in Appendix A - References. Current track filename is displayed when playback of a track is started. The elapsed time of the current track is displayed every second. VMSC firmware relies on hardware connections to devices found on a VMUSIC1 or VMUSIC2 module and will therefore not function with other modules. The VMUSIC1 and VMUSIC2 modules do not include USB Port 1.
Suitable FTDI devices to connect to VDIF firmware are the FT232B, FT232R or FT2232. If the monitor is not required to be available on USB Port 1 then VDAP firmware should be used instead. The VDIF firmware not recommended unless there are specific reasons for using the monitor on USB Port 1 and as such is only available on request from Technical Support.
10
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
When a CDC device is connected to either USB port on the VNC1L it is automatically connected in Data Mode to the monitor interface. There are separate output pins for modem control (RI#, DCD#) used by the VCDC firmware while the connection is active. Because of the strict compatibility requirements of this firmware it is only available on request from Technical Support.
Microcontroller
Monitor
FTDI
VNC1L-1A
Port 2
Port 1
USB Host
To operate a VNC1L in VDPS mode, the voltage from the USB connection to the host PC must be fed-back through a resistor voltage divider (consisting of 2 100k resisters between USBVCC and USBGND) into pin BD7. Refer to the diagram in Figure 3.6:
11
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
12
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
VNC1L Configuration
This section discusses the configuration and operating modes of the VNC1L command monitor.
Important: Pins ACBUS5 and ACBUS6 should not be tied directly to GND or VCC. Instead, they should be pulled high or low using a resistor of around 47k. These pins are read only at reset, but may then become outputs after the interface choice has been selected (e.g. ACBUS5 becomes DATAACK# if FIFO mode is selected). The VCDC Firmware will always select serial UART mode regardless of the state of the combined interface selection pins. All other firmware codes will allow the monitor mode to be selected. The VNC1L device pin definitions according to the selected mode of the combined interface are shown in Table 4.2. A full pin-out is available in the VNC1L Datasheet which is referenced in Appendix A - References. Pins which are marked N/A are not available for use in the selected mode.
Pin No. 31 32 33 34 35 36 37 38 41 42 43
Name ADBUS0 ADBUS1 ADBUS2 ADBUS3 ADBUS4 ADBUS5 ADBUS6 ADBUS7 ACBUS0 ACBUS1 ACBUS2
Type I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O
Serial UART TXD RXD RTS# CTS# DTR# / DATAACK# DSR# / DATAREQ# DCD# RI# TXDEN
13
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Pin No. 44 45 46 Name ACBUS3 ACBUS4 ACBUS5 Type I/O I/O I/O Serial UART Parallel FIFO WR DATAREQ# DATAACK# DATAREQ# DATAACK# SPI
When using the serial UART interface as the command monitor port the default baud rate used is 9600 baud, 8 data bits, 1 start bit, 1 stop bit, and no parity with RTS/CTS hardware handshaking enabled. However, this can be changed while in command mode.
4.2
The VNC1L can switch between two modes that change the method of communicating with USB Slave devices. In command mode, the VNC1L interprets and acts on commands; in Data Mode information from the monitor port is passed straight to another device. Signals DATAREQ# and DATAACK# allow for switching between command mode and data mode. In serial UART interface mode they are on the DTR# and DSR# interface pins. In parallel FIFO and SPI modes they are on pins 45 and 46.
14
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Before initiating data mode the Set Current command (section 6.6.3) should be used to select the desired device. If only one USB device is connected and that device only presents one interface in the Query Device list (section 6.6.2) then data mode may be entered without a Set Current command. There is a special case for compatible CDC Class slave devices in Data Mode on VDAP firmware. Once Data Mode is entered using the DATAREQ# line, a CDC Class driver is invoked to handle the connection and communications between the monitors combined interface and the CDC device. This is equivalent to the connection obtained with VCDC firmware but allows control over when to initiate the connection to the CDC device, however, the DTR# and DSR# lines from the modem are not available. Data Mode is not available on the VDFC Firmware. Data mode can not format data sent to the USB Slave device into packets. Therefore it is only suitable for devices which accept streaming data such as modems and serial port devices.
15
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Monitor Introduction
This section discusses the various methods of interacting with the command monitor.
5.2
Numerical Modes
The two numerical modes available for monitor commands are independent of the selected command set. ASCII Mode (invoked using the IPA command) uses printable characters; Binary Mode (selected by the IPH command) uses binary values. In binary mode values are always a fixed number of bytes depending on the command. In ASCII mode, an inputted decimal or hexadecimal number is entered and converted from hexadecimal if it starts with $ or 0x, otherwise it is assumed to be decimal. There is a limitation of 8 characters for a decimal value in ASCII mode, this limits decimal numbers to 99,999,999 (i.e. 0x5F5E0FF in hexadecimal). Output values are translated to printable characters by formatting each byte as a hexadecimal number prefixed with a $ symbol. Data returned from devices is not translated into printable characters. Note: After reset the monitor defaults to Binary Mode. Important: In binary mode values are always input MSB first. However, all output in binary or ASCII from the monitor is LSB first.
16
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
5.3 Filenames
The VNC1L can create files on a FAT file system on a disk. It will perform checks on filenames and will generate an error if a filename contains invalid characters. It is up to the user to ensure that extended characters (non-ASCII) used in filenames comply with the needs of the end user. Rules for filenames apply identically to the names of directories.
Important: Long file names in FAT32 file systems are not supported.
17
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Examples: LongName.123 LongerName.12345 short.1 verylongname VeryLong2 LONGNAME.123 LONGERNA.123 SHORT.1 VERYLONG.NAM VERYLONG.2
Verxx.xxVcccFOn-Line: This indicates the firmware version number (xx.xx) and the firmware type (Vccc). For instance, version V03.60 with VDAP firmware would report:
Ver03.60VDAPFOn-Line:
18
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
A:\>
B:\>
Table 5.1
Table 5.1
ND
No Disk
(4E 44 0D)
Short Command Set BC (42 43 0D) CF (43 46 0D) DF (44 46 0D) FI (46 49 0D)
Reason
BadCommand
CommandFailed
DiskFull
No free space on disk. Attempt to open a directory for reading or writing. Attempt to change currently selected directory to a file. Attempt to open a read only file for writing. A file is currently open for writing and must be closed before this command can be executed.
Invalid
ReadOnly
FileOpen
19
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Extended Command Set Short Command Set NE (4E 45 0D) FN (46 4E 0D) NU (4E 55 0D) Firmware Upgrade file not found on disk Firmware invalid or contains disallowed characters Attempt to delete a directory which is not empty. Reason
DirNotEmpty
FilenameInvalid
NoUpgrade
DeviceRemovedP1
20
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Event Device inserted in USB Port 2 Extended Command Set DeviceDetectedP2 Short Command Set DD2 (44 44 32 0D) DR2 (44 52 32 0D) SDA (53 44 41 0D) SDD (53 44 44 0D)
DeviceRemovedP2
SlaveEnabled
SlaveDisabled
21
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
In the following descriptions, values which are received from or sent to the monitor are represented in italics using the codes below: file
valid filename or directory name (See Section 5.3) any uppercase letter and number combination plus $ % - _ @ ~ ` ! ( ) { } ^ # & 16 bit value representative of a FAT format file date (See Table 6.4) 32 bit value representative of a FAT format file date and time (See Table 6.4) 3 byte value encoding a baud rate (See Table 6.2) 64 bit value (8 bytes) 32 bit value (4 bytes) 16 bit value (2 bytes) 8 bit value (1 byte) Information returned from an operation which is passed to or from the monitor unmodified. It is not formatted as hexadecimal numbers when the IPA mode is selected.
In addition, the following symbol is used when describing the Extended Command Set: + indicates that two or more values are not separated by a space e.g. byte+word is a three byte value
Short Command Extended Command Set Set (Hexadecimal Codes) SCS ECS IPA IPH SBDdivisor FWV E e 10 0D 11 0D 90 0D 91 0D 14 20 divisor 0D 13 0D 45 0D 65 0D Switches to the shortened command set Switches to the extended command set Monitor commands use ASCII values Monitor commands use binary values Change monitor baud rate Display firmware version Echo E for synchronisation Echo e for synchronisation Function
22
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
23
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Baud Rate 300 600 1200 2400 4800 9600 19200 38400 57600
1st Byte 0x10 0x88 0xC4 0xE2 0x71 0x38 0x9C 0x4E 0x34
2nd Byte 0x27 0x13 0x09 0x04 0x02 0x41 0x80 0xC0 0xC0
3rd Byte 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Baud Rate 115200 230400 460800 921600 1000000 1500000 2000000 3000000
1st Byte 0x1A 0x0D 0x06 0x03 0x03 0x02 0x01 0x00
2nd Byte 0x00 0x00 0x40 0x80 0x00 0x00 0x00 0x00
3rd Byte 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
24
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
The data is presented in the following order: FWV MAINdd.ddAAAAA RPRGd.ddR <prompt> Note the blank line preceding the returned values. Error Codes None
6.2
Disk Commands
The commands in this section are used to interact with the file system on a BOMS class device connected to a USB Host port. FAT12, FAT16 and FAT32 file systems are supported. Disk Commands are listed in Table 6.3. All Firmware codes support Disk Commands if a valid disk is inserted. BOMS class devices are supported in USB Port 2 and USB Port 1 on VDFC firmware; all other firmware supports BOMS class devices on USB Port 2 only. There are limitations to the type of disk which can be accessed with the VNC1L firmware. Compatible disks must have a sector size of 512 bytes (most Flash-based and many diskbased drives will have a 512 byte sector size). Various cluster sizes have been tested up to 32kB. For file I/O, the firmware requires files to be opened using the OPW or OPR commands, written to or read from with the WRF or RDF commands, and closed with the CLF command. Only one file may be open at any one time. If a file is open for writing (OPW), then it may be both written to and read from. If open for read (OPR) then it may only be read from. A file pointer that indicates from where reads and writes will commence is maintained for the currently open file. The SEK command can be used to move the file pointer within a file. The end of the file is moved to the position of the file pointer after a write operation and files open for write will be truncated at the file pointer when closed. There is no mechanism for determining the current directory on a disk. It is possible to ascertain if the current directory is the root directory by checking for the absence of the . and .. directories in a directory listing. The prompt in both Extended and Short Command Sets does not change when the current directory is changed with the CD command. If a disk is incorrectly formatted or the file system is not recognised then the No Disk prompt (see Table 5.2) will be returned.
Copyright 2008 Future Technology Devices International Limited 25
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
To determine the free space available on the disk the FS or FSE commands must be used. This is not performed at start-up in Firmware V03.61 onwards. As the disk fills, due to file system fragmentation, the firmware may take a longer time than normal to find an unused cluster. This can happen during a WRF write operation or when an OPW or MKD is called. When there are no remaining free clusters on the disk and the firmware searches for a free cluster it will scan the entire disk once then report "Disk Full". This search takes a variable length of time depending on the disk geometry and speed. If the disk is full and an OPW or MKD command is called the firmware reports "Disk Full" and no file or subdirectory is created. If the disk fills during a WRF operation then the command will continue to accept data until the amount of data specified in the command call has been received then report "Disk Full". The file size will be set to the size of the file when the disk filled and the file will be truncated at this point. Important: Long file names in FAT32 file systems are not supported. Warning: If a BOMS device is removed during a write operation, or even while a file is open for writing, then data corruption is likely.
Extended Command Set DIR DIRfile CDfile CD.. RDfile DLDfile MKDfile
Short Command Set (Hexadecimal Codes) 01 0D 01 20 file 0D 02 20 file 0D 02 20 2E 2E 0D 04 20 file 0D 05 20 file 0D 06 20 file 0D 06 20 file 20 List files in current directory List specified file and size Change current directory Move up one directory level Reads a whole file
Function
Delete subdirectory from current directory Make a new subdirectory in the current directory Make a new subdirectory in the current directory Also specify a file date and time Delete a file Write the number of bytes specified in the 1st parameter to the currently open file Open a file for writing or create a new file Open a file for writing or create a new file Also specify a file date and time Close the currently open file Read the number of bytes specified in the 1st parameter from the currently open file
MKDfiledatetime
OPWfiledatetime
datetime 0D 0A 20 file 0D
CLFfile
RDFdword
RENfilefile OPRfile
Rename a file or directory Open a file for reading Open a file for reading Also specify a file access date
OPRfiledate
0D
26
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Extended Command Set Short Command Set (Hexadecimal Codes) 28 20 dword 0D Function Seek to the byte position specified by the 1st parameter in the currently open file FS FSE IDD IDDE IDD DSN DVL 12 0D 93 0D 0F 0D 94 0D 0F 0D 2D 0D 2E 0D Returns the free space available on disk if less than 4GB is free Returns the free space available on disk Display information about the disk if disk is less than 4GB Display information about the disk Display information about the disk Display disk serial number Display disk volume label List specified file and date and time of create, modify and file access
SEKdword
DIRTfile
2F 20 file 0D
32 Bit Values
16 Bit Values
Description
Allowable Values
Meaning 0 = 1980 127 = 2107 1 = January 12 = December 1 = first day of month 24 hour clock
25:31
9:15
Year
0 127
21:24
5:8
Months
1 12
16:20
0:4
Days
1 31
11:15 5:10
N/A N/A
Hours Minutes
0 23 0 59
0:4
N/A
Seconds/2
0 29
0 = 0 seconds 29 = 58 seconds
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
DIR FILE1.XXX FILE2 SUBDIR1DIR NEWSUBDI.RDIR <prompt> If the current directory is not the root directory then the file listing will have . and .. directories for the current and next higher-level directories respectively. DIR .DIR ..DIR FILE1.XXX <prompt> Note the blank line preceding the list of files and directories. Directories are signified by the letters DIR after the name. Filenames and directory names are always shown in 8.3 formats and the dot for the extension is not shown if no file extension is given to the file. In ASCII input mode the output from the command with a valid filename as a parameter is: DIRfile1.XXX FILE1.XXX$xx$xx$xx$xx <prompt> Note the space after the last hexadecimal number before the carriage return. In binary input mode the output from the command will be: DIRfile1.XXX FILE1.XXXcccc <prompt> Note that the filename is a directory; a size of zero will be displayed rather than a listing of the files in that directory. Error Codes Command Failed The filename, if specified, does not exist. File Open A file is currently open for reading or writing. Close the open file first before retrying this command. A file is currently opened by a VMUSIC command. Stop playback on the VMUSIC before retrying this command. No Disk There is no disk detected by the firmware.
28
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
If the filename parameter is .. then the current directory is changed to the next higher-level directory. Error Codes Command Failed The filename does not exist. Invalid The filename is used in the current directory as a filename, FAT volume label or other FAT structure. File Open A file is currently open for reading or writing. Close the open file first before retrying this command. A file is currently opened by a VMUSIC command. Stop playback on the VMUSIC before retrying this command. Filename Invalid The name of a filename is invalid or contains disallowed characters. No Disk There is no disk detected by the firmware.
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Filename Invalid The name of the directory is invalid or contains disallowed characters. No Disk There is no disk detected by the firmware.
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
File Open A file is currently open for reading or writing. Close the open file first before retrying this command. A file is currently opened by a VMUSIC command. Stop playback on the VMUSIC before retrying this command. Filename Invalid The name of the file is invalid or contains disallowed characters. No Disk There is no disk detected by the firmware.
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
datetime (Optional) File date and time. Remarks The file named in the first parameter is opened for writing. Data is normally appended to the end of an existing file or a new empty file is created if it does not exist. The Seek (SEK) command can be used to move to an arbitrary point in the file and commence writing from there. Note : The file will be truncated to the position of the file pointer when closed. An optional parameter is used to specify a file date and time. See the 32 Bit Values column in Table 6.4 for format of the parameter value. The resolution for time in this command is 2 seconds. The rules for when and how the file date and time value is applied are as follows: Existing files: Upon opening the file the directory table structure specific for that file is modified. If bits 23:16 of the parameter are zero, indicating an invalid month and day of month, then there is no change made to the modified date/time or access date of the opened file. Otherwise, the modified date/time and the access date of the file are updated using the file date/time passed as a parameter. New files: When the file is created, the creation date/time, modified date/time and access date are set to the parameter value. If bits 23:16 of the file time value are zero, indicating an invalid month and day of month, the default file time is used for the create date/time, modified date/time and access time. Note : The Default file time is 0x31940000 (2004-12-04 00:00:00). Files which have been opened for write must be closed to update the file size record in the directory table. If a file is not closed before the device is reset or removed, then the file size will not be modified and data lost. For a file time of 7th June 2007 at 14:24:51 the following calculations are made: Year (2007 1980 = 27) 0x1B; Month (6) 0x6; Day (7) 0x7. Hour (14) 0xE; Minute (24) 0x18; Seconds (51 / 2) 0x19. File time = (0x1B << 25) | (0x6 << 21) | (7 << 16) | (0xE << 11) | (0x18 << 5) | (0x19) In binary (spaces between fields) = 0011011 0110 00111 01110 011000 11001b Finally, convert binary to hexadecimal = 0x36C77319. The command used will therefore be: OPWNEW.TXT 0x36C77319 <prompt> Error Codes Invalid The filename specified is used in the current directory is in use as either a subdirectory name, FAT volume label or other FAT structure. Read Only The read only attribute of the filename specified is set. Disk Full There are no free allocation units on the disk to create a file. The maximum number of files allowed in the root directory has been reached. This number is dependant on the file system. File Open Another file is currently open for writing. Close the other file first and retry this command. A file is currently opened by a VMUSIC command. Stop playback on the VMUSIC before retrying this command. Filename Invalid The name of the file is invalid or contains disallowed characters. No Disk There is no disk detected by the firmware.
32
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
6.2.10
Summary
The RDF command reads from an open file. Parameters dword Number of bytes. Remarks This command will read the specified number of bytes from the currently open file. When the command has been issued the number of bytes requested in the parameter will be transferred to the monitor port; there is no mechanism to break from the command early. If the number of bytes to read exceeds the number of bytes in the file then the entire remaining contents of the file will be transferred, followed by padding data to make up the total number of bytes requested in the command parameter. For this reason a DIR command should be done to find out the size of the file beforehand. Data read from the file is taken directly from the file to the monitor. There is no conversion from binary to ASCII in IPA mode nor is a carriage return sent after the data on the monitor port. RDF10 helloagain<prompt> Error Codes Command Failed The current offset (read position) in the file is at the end of the file. There is no more data available or the read operation has run past the end of the file. Invalid There is no file currently open for reading or writing. Use the OPR or OPW command to open a file before retrying the RDF command. No Disk There is no disk detected by the firmware.
33
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
6.2.11
Summary
The REN command renames a file. Parameters file Source Filename, see Section 5.3. file Target Filename, see Section 5.3. The file or subdirectory specified by the filename in the first parameter is renamed to the name specified in the second parameter. The filenames may refer to subdirectories as well as files. There must be a space character between the parameters. Error Codes Command Failed The source filename or target filename does not exist. File Open Another file is currently open for reading or writing. Close the other file first before retrying this command. A file is currently opened by a VMUSIC command. Stop playback on the VMUSIC before retrying this command. Filename Invalid The name of the file is invalid or contains disallowed characters. No Disk There is no disk detected by the firmware.
6.2.12
Summary
The OPR command opens a file for reading. Parameters file See Section 5.3. date (Optional) File date. Remarks The file specified in the parameter is opened for reading. Data is read from the start of an existing file. No new file is created if the file name specified does not exist. The Seek (SEK) command can be used to move to an arbitrary point in the file and commence reading from there. An optional parameter is used to specify the date when the file was accessed. Upon opening the file the directory table structure specific for that file is modified. Table 6.4 shows the bit fields used for 16 bit dates used in this parameter. If bits 7:0 of the file date value are zero, indicating an invalid month and day of month, then there is no change made to the directory table of the opened file. Otherwise, the last access time of the file is updated using the file date passed as a parameter. There is no need to close a file opened for read, however, for future compatibility it is highly recommended that these files be closed. Error Codes Command Failed The filename in the parameter does not exist. Invalid The filename is used in the current directory as a subdirectory name, FAT volume label or other FAT structure. File Open Another file is currently open for writing. Close the other file first before retrying this command. A file is currently opened by a VMUSIC command. Stop playback on the VMUSIC before retrying this command. Filename Invalid The name of the file is invalid or contains disallowed characters. No Disk There is no disk detected by the firmware.
Copyright 2008 Future Technology Devices International Limited 34
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
6.2.13
Summary
Seek (SEK)
The SEK command seeks to an absolute offset position in an open file. Parameters dword Offset in File, number of bytes. Remarks This command moves the file pointer to the position specified in the offset parameter. Only absolute positions in the file may be specified, there is no way of performing relative seeks. Error Codes Command Failed The offset is beyond the end of the file. Invalid There is no file currently open for reading or writing. Use the OPR or OPW command to open a file before retrying the SEK command. No Disk There is no disk detected by the firmware.
6.2.14
Summary
The FS and FSE commands display the free space remaining on the disk. Parameters None Remarks If there is likely to be more than 4GB of space on the disk then the FSE command must be used. In this case the FS command will report the free space as 0xFFFFFFFF. The first time either FS or FSE is executed it will scan the entire disk and calculate the free space available. This will take a period of time depending on the total size and the cluster size of the disk, along with the speed at which the disk operates. This variance means that a command can take as short a time as 1 second or as long as a minute to perform the check. The monitor will not respond to commands during this process. After the FS or FSE has been called the monitor will keep track of file operations and report the free space available without requiring a scan of the entire disk. FSE $00$02$45$31$01$00 <prompt> FS $FF$FF$FF$FF <prompt> Error Codes No Disk There is no disk detected by the firmware.
6.2.15
Summary
The IDD and IDDE commands display information about a disk device. Parameters None
Copyright 2008 Future Technology Devices International Limited 35
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Remarks The IDD command shows a summary of information about the connected BOMS device. idd USBVID=$05DC USBPID=$A560 VendorId=LEXAR ProductId=JDFIREFLY RevisionLevel=3000 I/F=SCSI FAT32 Bytes/Sector=$0200 Bytes/Cluster=$001000 Capacity=$1EB7C000Bytes FreeSpace=$1EB77000Bytes <prompt> Note : Blank lines are inserted before and after the data returned from the command. Product Id is read from the device and will be a fixed length of 16 characters. Similarly Vendor Id is fixed at 8 characters. The Free Space entry is not filled out until an FS or FSE command has been executed and the free space on the disk evaluated. Error Codes No Disk There is no disk detected by the firmware.
6.2.16
Summary
The DVL command displays the disk volume label. Parameters None Remarks This command obtains the Disk Volume Label from the disk. This is 11 characters and stored in the MBR section of the disk. FAT32 volume labels which are written to the root file directory are not supported. Error Codes No Disk There is no disk detected by the firmware.
6.2.17
Summary
The DSN command displays the disk serial number. Parameters None Remarks This command displays the 32-bit serial number of the disk. It is displayed in little-endian format, as it is stored on the disk.
Copyright 2008 Future Technology Devices International Limited 36
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
6.2.18
Summary
The DIRT command shows date and time attributes for a file. Parameters file See Section 5.3. Remarks This command will display the create date/time, modified date/time and access date of a file in the current directory. Ten bytes of data will be returned, the first 4 are the created date/time, the next 2 are the access date and the last 4 are the modified date/time. All values are sent LSB first. In ASCII input mode the output from the command with a valid filename specified is: DIRTfile1.XXX FILE1.XXX$xx$xx$xx$xx$xx$xx$xx$xx$xx$xx <prompt> Note the space after the last hexadecimal number before the carriage return. In binary input mode the output from the command is: DIRTfile1.XXX FILE1.XXXcccccccccc <prompt> The time and date can be decoded using the bit field definitions in Table 6.4. Error Codes Command Failed The specified filename does not exist. File Open A file is currently open for writing. Close the file first before retrying this command. A file is currently opened by a VMUSIC command. Stop playback on the VMUSIC before retrying this command. Filename Invalid The name of the file is invalid or contains disallowed characters. No Disk There is no disk detected by the firmware.
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Indicator (RI#) pin. A simple way to resume the monitor when any input is sent to the device would be to tie Ring Indicator (RI#) and the UART receive data (RXD) pins together. Error Codes None
Function Read I/O Port (1st parameter is port number) Write I/O Port (1st parameter is port number, 2nd is direction, 3rd is value)
IOWbyte+byte+byte
byte 0D
Unused I/O Pins are pins which are not in use for the monitor in Table 4.2.
39
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
6.5
Printer Commands
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
6.6
The VNC1L firmware implements a convention to allocate device numbers to interfaces on USB devices. There can be up to 16 devices accessible to the monitor to allow for multiple interfaces presented by devices (such as the FT2232 chip). The mapping of physical devices to device numbers used in the monitor is dependent on other devices connected and the order in which these devices have been connected. It is therefore not safe to assume that a given device will always be allocated the same device number. The QD (Query Device) command is provided to verify device numbers. Before sending or receiving data from a device the SC (Set Current) command must be used to specify the device interface to use. Commands which send data to USB devices will always accept the number of bytes specified in the command parameters before returning a prompt or reporting any errors. Likewise, commands which receive data from USB devices will always report the number of bytes received before any prompt or error reports. USB Device Commands are available in all Firmware codes except VDFC Firmware. The QSS command can be used only on VDPS VNC1L firmware.
Extended Command Set QP1 QP2 QDbyte SCbyte DSDbyte data DRD SSUqword (data) SFbyte QSS 84 0D 9A 20 qword 0D (data) 87 20 byte 0D 98 0D Short Command Set (Hexadecimal Codes) 2B 0D 2C 0D 85 20 byte 0D 86 20 byte 0D Function
Query port 1 Query port 2 Query device specified in the 1st parameter Set device specified in the 1st parameter as the current device Send data to USB device where the size of the data is specified in the 1st parameter Read back data from USB device Send setup data to device control endpoint with optional followon data Set device specified in the 1st parameter as an FTDI device Query Slave Status (only available on VDPS)
83 20 byte 0D data
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Parameters None
Remarks
The Query Port commands display two bytes of information about devices connected to USB Port 1 for QP1 or USB Port 2 for QP2. The first byte shows the class or classes of connected devices. The second byte is always zero. The connected devices bitmask is described inTable 6.11. Multiple device classes may be connected to the port, for example, 0x8C 0x00 will be returned if a Printer Class and a HID Class device are connected to a Hub Device. If the first byte is 0x40 then the device class has not been recognised by the VNC1L firmware. A value of 0x00 0x00 indicates that there are no devices connected to the port.
Bit 7 6 5 4 3 2 1 0
Device Type Hub Device on Port Unknown Device BOMS Class Device CDC Class Device HID Class Device Printer Class Device Reserved (always 0) FTDI FT232 / FT245 / FT2232 Device
42
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
This command is used to find information on a device interface. The device number can be a valid device in the range of 0 to 15. This will return a block of 32 bytes as shown in Table 6.12. Each physical USB device connected may identify one or more device interfaces which may be used by the VNC1L. This information is used to identify the device type to allow an application to find a specific device connected to the VNC1L.
Offset
Size (bytes) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2
Data
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 18
USB Address Control End Point 0 Size Pipe In End Point Number Pipe In End Point Size Pipe Out End Point Number Pipe Out End Point Size Data Toggles Device Type: See Table 6.11 Reserved Location: 1 USB Port 1, 2 USB Port 2 MI Index Device Class Device Sub Class Device Protocol VID PID BCD Device Speed: 1 Full Speed, 2 Low Speed, 4 Low Speed Device on Hub, 8 Device on Low Speed Hub Reserved
20
21 - 31
11
Definitions of USB class codes, USB VID, PID and BCD numbers can be found in the USB 2.0 Specification referenced in Appendix A - References. Error Codes Command Failed The specified USB device is out of range.
43
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
44
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
bmRequestType
Bitmap describing the characteristics of the Setup Packet Specific request Refer to USB 2.0 Specification Section 9.4
bRequest
45
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Offset Size (bytes) 2 2 2 Field Description
2 4 6
Dependant on request Dependant on request Number of bytes to transfer if there is a data stage to follow
Important: The byte order for multi-byte data (wValue, wIndex and wLength values) in Table 6.13 is LSB-first. This is the USB protocol byte order rather than the monitor command input byte order. If follow-on data is received from the device then the length of the data (2 bytes) followed by a carriage return is displayed by the monitor before any received data or error message. If data is sent the number of bytes specified in the command parameters will be accepted by the monitor before a prompt or error message is returned. Input or output for the data stage is taken directly from or sent directly to the monitor input. There is no conversion from ASCII to binary in IPA mode. No carriage return is required after writing the follow-on data to the monitor nor is one sent after receiving the follow-on data on the monitor. Again, USB byte ordering applies to the data stage. A maximum of 128 bytes may be sent or received during the data stage. This example sends a Setup Packet requesting a data stage of 8 more output bytes (wLength = 8). The command is given in ECS mode, the 8 setup command bytes are given in ASCII mode and the data stage output is represented in hexadecimal values. SSU$2109000201000800 01 02 03 04 05 06 07 08 <prompt> In SCS mode and IPH mode: 9A 20 21 09 00 02 01 00 08 00 0D 01 02 03 04 05 06 07 08 <prompt> This is a further example where the data stage is requesting a number of input bytes. The command is given in ECS mode, the 8 setup command bytes are given in ASCII mode and the data stage input is represented in binary values. SSU$A109000201000800 $08 $00 01 02 03 04 05 06 07 08 <prompt> In SCS mode and IPH mode: 9A 20 A1 09 00 02 01 00 08 00 0D 08 00 0D 01 02 03 04 05 06 07 08 <prompt> Error Codes Command Failed The currently selected USB device cannot be written to or does not exist. The number of bytes specified to write is greater than 128.
46
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Meaning Reserved Data available from slave (RX) Data available to slave (TX) Suspended Connected
6.7
If an FTDI FT232, FT245 or FT2232 is connected to USB Port 1 or Port 2 then the commands in Table 6.15 may be used to modify the settings of the device. The commands are analogous to the FTDI API Functions in the FTDI D2XX Programmers Guide (reference in Appendix A References).
47
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
The interface device must first be selected using the USB Device Command SC (Set Current) before utilising these commands. The FTDI Commands are available in all Firmware codes except VDFC Firmware.
Short Command Extended Command Set Set (Hexadecimal Codes) FBDdivisor FMCword FSDword FFCbyte FGM FSLbyte FSBword FGB 18 20 divisor 0D 19 20 word 0D 1A 20 word 0D 1B 20 byte 0D 1C 0D 22 20 byte 0D 23 20 word 0D 24 0D Set baud rate Set modem control St data characteristics Set flow control Get modem status Set latency timer Set bit mode Get bit mode Function
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
The encoded modem control bytes are shown in Table 6.16. DTR# and RTS# may be individually changed or left by utilising the mask in the second byte.
Operation 1 = change DTR, 0 = leave DTR alone 1 = change RTS, 0 = leave RTS alone Reserved 0
49
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
1st Byte 7:0 Operation Number of Data bits: 7 7 data bits 8 8 data bits
5:3
Reserved 0
Byte 0 1 2 7:3
Operation Hardware handshake RTS/CTS Hardware handshake DTR/DSR Software handshake XOFF/XOFF Reserved 0
50
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
51
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
FGB$02 $50 <prompt> One byte is returned with the state. Error Codes None
6.8
VMUSIC Commands
On VMSC1 Firmware only the following extension commands are available to interface with an MP3 decoder. To pause playback, send either the E or e character to the monitor without sending the carriage return character. To resume playback, send the carriage return character. The VNC1L firmware supports MP3 files and unlocked WMA files encoded at up-to 320kbit/sec. This limit is dependent on the speed and characteristics of the disk used to store the data files.
Short Command Extended Command Set Set (Hexadecimal Codes) VPFfile VRFfile VST V3A VRA VRR 1D 20 file 0D 89 20 file 0D 20 0D 21 0D 8A 0D 8F 0D Plays a single file Repeatedly plays a single file Stops playback Plays all MP3 files Repeatedly plays all MP3 files Repeatedly plays random MP3 files Function
52
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Short Command Extended Command Set Set (Hexadecimal Codes) VSF VSB VSD VP VF VB VRDbyte VWRbyte+word VSVbyte 25 0D 26 0D 8E 0D 8B 0D 8C 0D 8D 0D 1F 20 byte 0D 1E 20 byte word 0D 88 20 byte 0D Writes command register Sets playback volume Skip forward one track Skip back one track Skip forward one whole directory Pause playback Fast forward 5 seconds Rewind 5 seconds Reads command register Function
The status information in Table 6.20 is displayed on the monitor during playback. The Playing message is shown at the start of each track and Stopped when the last track has completed or the VST command issued. If ID3 information is available from the track then this is displayed in 5 lines immediately following the Playing message. If an ID3 tag cannot be decoded then a blank line is displayed. Each line of ID3 data may be up to 256 bytes long, including the terminating carriage return.
title title artist artist album album composer composer T (54 time 0D) Stopped S (53 0D) Playback stopped Elapsed time ID3 information
T time
While tracks are being played the elapsed time, in seconds, is displayed. The time is a 16-bit value and the display format depends on the Numerical Mode selected.
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
file See Section 5.3. Remarks This example shows playback of a file ST1.MP3 in Extended Command Set and IPA Mode: VPFST1.MP3 PlayingST1.MP3 1/10 Song One Blurb Best of Blurb Damian Allbran T $01$00 T $02$00 T $03$00 Stopped
If the VRF command is used then the file will play repeatedly until a VST command is issued. Error Codes Invalid The filename is used in the current directory as a subdirectory name, FAT volume label or other FAT structure. Filename Invalid The name of the file is invalid or contains disallowed characters. The specified filename does not exist. No Disk There is no disk detected by the firmware.
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
V3A PlayingST2.MP3 2/10 Song Two Blurb The Very Best of Blurb Graeme Boxon 54 20 01 00 0D 54 20 02 00 0D 54 20 03 00 0D 54 20 04 00 0D PlayingST1.MP3 1/10 Song One Blurb Best of Blurb Damian Allbran 54 20 01 00 0D 54 20 02 00 0D 54 20 03 00 0D Stopped
If VRA is called then all files are repeated when the files in current directory and subdirectories are completed. The VRR command selects a new file at random after the current file has completed playing. It does not shuffle the order in which files are played. Error Codes No Disk There is no disk detected by the firmware.
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Skip to the next directory track if playing files using the Play All Tracks (V3A or VRA) commands. Error Codes No Disk There is no disk detected by the firmware.
56
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
6.8.10
Summary
Set the volume for both left and right channels in the VLSI VS1003. Parameters byte Volume. Remarks A volume of 0x00 is maximum volume, 0xFE is minimum volume. The VLSI VS1003 is referenced in Appendix A - References. Error Codes None
6.9
VDFC Commands
The VDFC Commands are available only in VDFC Firmware In order to support two BOMS devices the VDFC Commands can select either the Source or Target disk. Copy commands are provided to facilitate data transfer between the two devices. Alternatively, file access and directory operations (from Section 6.2) can be issued and act independently on the selected disk.
Short Command Extended Command Set Set (Hexadecimal Codes) A: B: IMS IMFfile CPS CPFfile 41 3A 0D 42 3A 0D 26 0D 25 20 file 0D 21 0D 20 20 file 0D Select Source Disk Select Target Disk Create Snapshot Image of Source Disk Create Snapshot Image of File on Source Disk Copy Source Disk to Target Disk Copy File on Source Disk to Target Disk Function
57
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
The IMS and IMF commands create a unique subdirectory in the current directory of the Target disk. The subdirectory name is prefixed with the letters VF2F followed by 4 decimal digits. The 4 digits are the lowest numerical value which results in a unique name in the directory. Numbers start at 0001. For example, if the Target disk had the following subdirectories, the next subdirectory created would be VF2F0003: DIR VF2F0001DIR VF2F0002DIR VF2F0004DIR VF2F0005DIR <prompt> The VDFC Firmware is capable of copying files from a disk to a depth of up to 16 subdirectories using the IMS and CPS commands. Attempts to copy subdirectories nested deeper will have unpredictable results.
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Source disk should be selected to commence the copy. Upon completion the currently selected disk will be set to the Source disk. Files and directories have their file attributes; include creation, access and modification times preserved. When the command is called, the name of the unique subdirectory on the Target disk is displayed on a single line on the monitor. Then the name of each file being transferred is shown followed, upon completion, by the number of bytes copied. Directories entered are shown followed by the letters DIR. The following is an example of a recursive copy operation in ASCII mode. IMS VF2F0003 STDIR ST1.MP3 $00 $10 $01 $00 ST2.MP3 $04 $22 $00 $00 ST3.MP3 $B0 $10 $03 $00 GTDIR GMPT1.JPG $00 $1F $21 $00 GMPT2.JPG $00 $CC $31 $00 GMPT3.JPG $00 $A0 $31 $00 .. DIR .. DIR <prompt> Error Codes Command Failed A file access error occurred during the copy. Disk Full The Target Disk is full.
59
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Command output is the same as the CPS command. Error Codes Command Failed A file access error occurred during the copy. Disk Full The Target Disk is full.
Function
Sector dump Sector write Upgrade firmware from named file on disk
6.10.1
Summary
Dumps raw binary of sector number specified. Parameters dword Sector number. Remarks Data length is always 512 bytes and is not converted to ASCII when in IPA Mode. Error Codes None
6.10.2
Summary
Writes raw binary from the monitor to sector number specified. Parameters dword Sector number. Remarks Data length is always 512 bytes and is not converted from ASCII when in IPA Mode. Important: Use with care as disk and file system corruption can occur. Error Codes None
61
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
6.10.3
Summary
Forces a firmware upgrade from named file on disk. Parameters file See Section 5.3. Remarks Only FTD reflash files are supported do not use with the ROM files used by the VPROG application. A device reboot will occur once the upgrade has been performed. Important: Use with care as firmware corruption can occur if an invalid upgrade file is used. Only use FTD files supplied by FTDI. Error Codes No Upgrade The specified filename does not exist or is identical to the firmware currently in Flash.
62
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
LED Function
The following section explains LED functions for the for various VNC1L modules.
Operation
LED Behaviour LED1 and LED2 flash alternately for 2 seconds Repeated until monitor connects LED1 on, LED2 off LED1 off, LED2 on LED1 off, LED2 off
Power On
USB Disk Initialisation USB Disk Ready USB Disk Removed Commands from monitor Port to USB Disk Commands from monitor Port with USB Disk removed
7.2
The VDRIVE1 and VDRIVE2 modules have 1 bi-colour Green/Red LED. The behaviour of the LED is described in Table 7.2.
Operation
LED Behaviour LED flashes Green/Red alternately for 2 seconds Repeated until monitor connects LED Red LED Green LED off
Power On
USB Disk Initialisation USB Disk Ready USB Disk Removed Commands from monitor Port to USB Disk Commands from monitor Port with USB Disk removed
LED off
63
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
7.3
The VMUSIC1 and VMUSIC2 modules have 1 bi-colour Green/Red LED. The behaviour of the LED is described in Table 7.3.
Operation
LED Behaviour LED flashes Green/Red alternately for 2 seconds Repeated until monitor connects LED Red LED Green LED off
Power On
USB Disk Initialisation USB Disk Ready USB Disk Removed Commands from monitor Port to USB Disk Commands from monitor Port with USB Disk removed Music Playing Music Stopped/Paused
LED off
64
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Examples
This section gives example configuration and commands for commonly used VNC1L applications.
8.1
In this example an FT2232 dual chip device is connected to USB Port 1. VDAP firmware is used. The output from the QD (Query Device) command is as follows. qd0 $01$08$81$40$02$40$00$01$01$01$00$FF$FF$FF$03 $04$10$60$00$05$01$00$00$00$00$00$00$00$00$00 $00$00 D:\> qd1 $01$08$83$40$04$40$00$01$01$01$01$FF$FF$FF$03 $04$10$60$00$05$01$00$00$00$00$00$00$00$00$00 $00$00 D:\> The two interfaces share the same address but have a different interface number at byte 11 and different endpoint numbers. The first device is port A on a FT2232 chip and the second one is port B. It is important that before attempting to talk to a device that it is set to be the current device with the SC (Set Current) command. To select device 0 or port A of the FT2232 chip: sc0 D:\> At this point communication is open between the monitor and the endpoint of the selected device. FTDI setup commands (or data) can be sent to the device. fbd$384100 D:\> fmc$0303 D:\> ffc$01 D:\> The commands set baud rate to 9600, RTS and DTR active and RTS/CTS flow control enabled respectively. Data mode can be entered by setting DATAREQ# active (low) and waiting for DATAACK# (low).
65
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Once the acknowledge (DATAACK# low) has been received all data sent to the monitor will go directly to port A of the FT2232 chip and all data received by the port A of the FT2232 chip will be echoed to the monitor. This is illustrated in Figure 8.1.
8.2
In this example we connect a VNC1L running VDAP firmware to a USB device using command mode only, as illustrated in Figure 8.2.
To send data to the device, firstly, we need to setup communications with the printer, using the SC (Set Current) command, then utilise the DSD (Device Send Data) command to send a string of text. The DSD command can only send a maximum of 128 characters at a time. The example below is to send a short string to USB Printer which is able to receive standard printable characters sent from the USB Port. A suitable printer to use is an HP DeskJet 460. DeviceDetectedP1 ipa D:\> qp1 $24$00 D:\> qd0 $01$08$81$40$01$40$03$04$01$01$00$07$01$02$F0 $03$12$13$00$01$01$00$00$00$00$00$00$00$00$00 $00$00 D:\> sc0 D:\> dsd9 hello2u D:\> Reading data from a device is performed in much the same way. After the device has been sent as the current device the DRD (Device Read Data) command can read pending data from the device and display that on the monitor. In this example a USB mouse is read: D:\> drd $04 00 FF 00 00 D:\>
66
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Note: The monitor returned the size of the data read as the first byte. Since this example is in IPA mode, the size is given in ASCII text and the data which follows is in binary format (indicated by italics in the example).
8.3
VDPS to PC Host
In VDPS firmware, USB Port 1 is a USB Slave port. USB Port 2 is still configured as a USB Host port and can be used as normal from the monitor. When USB Port 1 is connected to a host PC it will enumerate as if it were an FT232B device and the operating system can load the FTDI drivers accordingly. You can select the slave port to be the current device and go into data mode using DATAREQ# and DATAACK#.
Microcontroller
Monitor
FTDI
VNC1L-1A
Port 2
Port 1
USB Host
When the device is connected to a host PC and the drivers have been loaded you will receive a message: SlaveEnabled When the device is disconnected you will receive a message: SlaveDisabled You can check the status of the slave connection at any time with the command QSS (Query Slave Status). This will return 3 bytes of data, for example: SlaveEnabled IPA D:\> QSS $01$00$00 D:\> To access the slave port you have to use the data mode via DATAREQ# and DATAACK# lines. First you should select the slave device with the SC command and the parameter S to indicate the slave. For example: SCS D:\> Then activate DATAREQ# and wait for DATAACK#. At this stage anything sent to the VNC1L monitor will be passed directly to the host PC. Similarly, any data sent by the host PC will be passed to the monitor without the VNC1L interpreting the data. An example of demonstrating this would be to open a terminal emulation program to send data to the VNC1L host PC port and read the data from the VNC1L monitor. To come out of data mode, drop the DATAREQ# line. The peripheral on USB Port 2 can now be used using commands from the monitor. The DSD and DRD commands cannot be used to send and receive data from the slave device.
Copyright 2008 Future Technology Devices International Limited 67
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Troubleshooting
The following section should be consulted if you are having problems with the VNC1L firmware. Please consult the FAQ section on the Vinculum Website (see Appendix A - References).
9.1
Monitor Port
68
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
9.2
USB Devices
Endpoints
1 IN (Interrupt)
The CDC Data Class descriptors should immediately follow the CDC Communication Class descriptors in the USB configuration data. Refer to the USB Serial Bus Class Definitions for Communication Devices 1.1 document for more information on the values used.
69
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
The USB functional descriptors for the device must include one of the options in the Value A or Value B columns in Table 9.2, Table 9.3, and Table 9.5, and the Value column in Table 9.4.
Offset 0 1 2 3..n
Table 9.2 specifies the version of the USB CDC Class which this device supports. The options allow V1.10 or V1.09 compliant devices to be used.
Offset 0 1 2 3..n
Table 9.3 specifies the features in Abstract Control Management which the VNC1L CDC driver supports. The device in Value A supports Device supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding and the notification Serial_State. Value B supports the combination of Newtork_Connection, Send_Break, Set_Comm_Feature, Clear_Comm_Feature and Get_Comm_Feature.
Offset 0 1 2 3..n
Values in Table 9.4 define the Union Interface configuration which the VNC1L CDC driver supports, associating the master interface (0x00) to the slave interface (0x01).
70
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Offset 0 1 2 3..n Field bFunctionLength bDescriptorType bDescriptorSubtype (function specific data) Value A 0x05 0x24 0x01 0x00 0x01 Value B 0x05 0x24 0x01 0x03 0x01
The two methods in Table 9.5, allow a device to support call management over the Communication Class or Data Class interface. If it uses the Data Class interface then the device must handle the call management itself. These settings apply to the slave interface (0x01) only.
71
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
10 Contact Information
Head Office Glasgow, UK Future Technology Devices International Limited 373 Scotland Street Glasgow G5 8QB United Kingdom Tel: +44 (0) 141 429 2777 Fax: +44 (0) 141 429 2758 E-mail (Sales) [email protected] E-mail (Support) [email protected] E-mail (General Enquiries) [email protected] Web Site URL http://www.ftdichip.com Web Shop URL http://www.ftdichip.com
Branch Office Taipei, Taiwan Future Technology Devices International Limited (Taiwan) 4F, No 18-3, Sec. 6 Mincyuan East Road Neihu District Taipei 114 Taiwan, R.O.C. Tel: +886 (0) 2 8791 3570 Fax: +886 (0) 2 8791 3576 E-mail (Sales) [email protected] E-mail (Support) [email protected] E-mail (General Enquiries) [email protected] Web Site URL http://www.ftdichip.com
Branch Office Hillsboro, Oregon, USA Future Technology Devices International Limited (USA) 7235 NW Evergreen Parkway, Suite 600 Hillsboro, OR 97123-5803 USA Tel: +1 (503) 547 0988 Fax: +1 (503) 547 0987 E-Mail (Sales) [email protected] E-Mail (Support) [email protected] Web Site URL http://www.ftdichip.com
Distributor and Sales Representatives Please visit the Sales Network page of the FTDI Web site for the contact details of our distributor(s) and sales representative(s) in your country.
72
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Appendix A - References
This document does not describe the hardware interfaces required to connect a microcontroller to a VNC1L device nor does it provide application notes. The following documents are available from FTDI and other sources for this purpose:
Document Reference
Description The main website for the Vinculum family of USB Host Controllers on the FTDI
Vinculum Website
website http://www.ftdichip.com/ Vinculum Embedded USB Host Controller IC Data Sheet http://www.ftdichip.com/ FTDI FT232 / FT245 / FT2232 Data Sheet http://www.ftdichip.com/ VMUSIC2 Datasheet http://www.ftdichip.com/ VDAP1 and VDAP2 Datasheets http://www.ftdichip.com/ D2XX Programmers Guide http://www.ftdichip.com/ VS1003 Data Sheet
DS_VNC1L-1A
DS_MUSIC2
DS_VDAP1 DS_VDAP2
D2XXPG
VS1003
USB 2.0
USB Implementers Forum http://www.usb.org/ Universal Serial Bus Class Definitions for Communication Devices 1.1
USBCDC 1.1
USB Implementers Forum http://www.usb.org/ Microsoft OEM 437 Codepage Reference http://www.microsoft.com/globaldev/reference/oem/437.mspx
OEM437
73
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Terms
8.3
(.) then an extension of up to 3 characters. For example, TEST.TXT, ANEWFILE.1 or AFILE. File Allocation Table. The name for the file system typically used for USB Flash
FAT
Disks. Variants are FAT12, FAT16 and FAT32, the numbers referring to the number of bits used to specify a cluster on the disk. Bulk Only Mass Storage. A general description given to a USB mass storage device e.g. USB Flash Disk. Master Boot Record. Part of the FAT file system. Command line interface which allows instructions to be given to the VNC1L and responses to be returned. Least Significant Byte is shown first when representing a multi-byte number as a
BOMS
MBR
Monitor
LSB
sequence of bytes. E.g. a number 0x55AAFF00 is stored or specified as 4 bytes 0x00, 0xFF, 0xAA and 0x55. Most Significant Byte is shown first when representing a multi-byte number as a
MSB
sequence of bytes. E.g. a number 0x55aaff00 is stored or specified as 4 bytes 0x55, 0xaa, 0xff and 0x00.
Sector Size
The size of data which is read from or written to a disk in a single operation. The size of data block allocated on a disk to store files or directory structures. Integer multiples of clusters must be used to store large files or directories. The topmost directory in a FAT file system. American Standard Code for Information Interchange. A 7 bit Character Set representing the character codes from 0x00 to 0x7F. Non-ASCII characters representing character codes from 0x80 to 0xFF. Single Byte Character Set where one byte of data corresponds to one character. Double Byte Character Set where two bytes of data correspond to a single character.
Cluster Size
Root Directory
ASCII
DBCS
74
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
List of Tables Table 1.1 Document Conventions ............................................................................... 5 Table 1.2 Acronyms and Abbreviations ....................................................................... 6 Table 3.1 Firmware Functionality ............................................................................... 8 Table 4.1 Combined Interface Selection ................................................................... 13 Table 4.2 Combined Interface Pins ........................................................................... 14 Table 5.1 Monitor Prompts for Successful Command Completion ............................. 19 Table 5.2 Monitor Prompts with No Command Issued .............................................. 19 Table 5.3 Monitor Error Responses ........................................................................... 20 Table 5.4 Monitor Events .......................................................................................... 21 Table 6.1 Monitor Configuration Commands ............................................................. 22 Table 6.2 Monitor Baud Rates ................................................................................... 24 Table 6.3 Disk Commands ........................................................................................ 27 Table 6.4 File Date and Time Bit Fields ..................................................................... 27 Table 6.5 Power Management Commands ................................................................ 37 Table 6.6 Unused I/O Pin Commands ....................................................................... 39 Table 6.7 Port Number Encoding .............................................................................. 39 Table 6.8 Printer Commands .................................................................................... 40 Table 6.9 Printer Status Encoding ............................................................................ 40 Table 6.10 USB Device Commands ............................................................................ 41 Table 6.11 Device Type Bit Definitions ..................................................................... 42 Table 6.12 USB Device Information Record .............................................................. 43 Table 6.13 SSU Command Setup Packet Format ....................................................... 46 Table 6.14 Query Slave Status Values ...................................................................... 47
Copyright 2008 Future Technology Devices International Limited 75
Document Reference No.: FT_000006 Vinculum Firmware User Manual Version 2.05 Clearance No.: FTDI# 46
Table 6.15 FT232/FT245/FT2232 Commands........................................................... 48 Table 6.16 FT232/FT245/FT2232 Modem Control Bytes........................................... 49 Table 6.17 FT232/FT245/FT2232 Data Characteristics Bytes ................................... 50 Table 6.18 FT232/FT245/FT2232 Flow Control Bytes .............................................. 50 Table 6.19 VMusic Commands .................................................................................. 53 Table 6.20 VMusic Track Information ....................................................................... 53 Table 6.21 VDFC Commands ..................................................................................... 57 Table 6.22 Debug Commands ................................................................................... 61 Table 7.1 VDIP1 and VDIP2 LED Functions ............................................................... 63 Table 7.2 VDRIVE1 and VDRIVE2 LED Functions ...................................................... 63 Table 7.3 VMUSIC1 and VMUSIC2 LED Functions ...................................................... 64 Table 9.1 CDC Device Requirements ......................................................................... 69 Table 9.2 CDC Device Header Functional Descriptor ................................................. 70 Table 9.3 CDC Device Abstract Control Management Functional Descriptor .............. 70 Table 9.4 CDC Device Union Interface Functional Descriptor .................................... 70 Table 9.5 CDC Device Call Management Functional Descriptor.................................. 71 Table A.1 Other Available Document ........................................................................ 73 Table B.1 Acronyms and Abbreviations..................................................................... 74
76