f2806x Usbbl Ug
f2806x Usbbl Ug
USER’S GUIDE
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of Texas Instruments semicon-
ductor products and disclaimers thereto appears at the end of this document.
Texas Instruments
13905 University Boulevard
Sugar Land, TX 77479
http://www.ti.com/c2000
Revision Information
This is version 2.07.00.00 of this document, last updated on Sun Aug 25 15:30:38 IST 2024.
Table of Contents
Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Revision Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Startup Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 USB Device (DFU) Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1 DFU Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 DFU States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3 Typical Firmware Download Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4 Querying Command Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 Download Command Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6 Failsafe Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.1 Program and Data Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.2 Memory Copies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7 Source Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.1 Decryption Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.2 Update Check Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.3 USB Device Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
IMPORTANT NOTICE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
1 Introduction
The Texas Instruments® boot loader is a small piece of code that can be programmed in flash
to act as an application loader as well as an update mechanism for applications running on a
C2000 microcontroller. The boot loader is designed to upgrade the application using the USB
Device Firmware Upgrade (DFU) mechanism. The boot loader is customizable via source code
modifications, or simply deciding at compile time which routines to include. Since full source code
is provided, the boot loader can be completely customized.
bl_config.h A template for the boot loader configuration file. This con-
tains all of the possible configuration values.
F2806x_BL_MemCopy.c Memory copy functions for use in both normal and failsafe
boot modes.
F2806x_CodeStartBranch.asmSpecial Code start branch that supports two flash entry lo-
cations.
Practical Use
This bootloader is an example piece of software and should be treated as a guide on implementing
your own or used as a starting point for an end application bootloader. As with any embedded code
you should do your best to understand how each piece of the solution works. The bootloader may
be used unmodified with end application code that follows the same memory map and structure as
the bl_app example project.
To evaluate the DFU USB Bootloader example you should follow these steps:
Import the boot_loader and bl_app projects into CCS. The projects can be found in exam-
ples\/bl_app and MWare\/boot_loader.
Load the bootloader project into the flash of the target device and execute it.
When Windows asks about drivers, point it to the boot_usb.inf driver file found in
MWare\/windows_drivers. Two options will be presented: Select the first if you have a 32 bit system
and the second if you are using a 64 bit system.
Run dfuprog -e to enumerate the DFU enabled devices attached to the system. If your device
shows up everything is working correctly.
Run dfuprog -f bl_app_i.hex to load the bl_app example application to the board. You may optionally
append the -r option to reset the target device and boot the bl_app application after programming
is complete.
The bootloader solution requires that the application to be loaded follow a predefined memory map,
have entry addresses and application signatures (CRC) at predefined locations that are known
by both the bootloader and the end application. The end application must also be passed to the
dfuprog utility in a special hex image file format. The bl_app example automatically does this
when the project is built using the bl_app_hex.cmd. Please refer to this file for the options one
must pass to the hex2000 utility to correctly generate a hex file for the dfuprog software. These
specially formatted hex files are the only supported file format for programming the device using
the bootloader.
2 Startup Code
The start-up code contains the minimal set of code required to configure a vector table, initialize
memory, copy the boot loader from flash to SRAM, and execute from SRAM. The start-up code is
contained in rts2800_bl.lib, with F28069_bl.cmd containing the linker script used to place
the vector table, code segment, and data segments into the appropriate locations in memory.
At boot time one of two things can happen depending on how the bootloader is configured. During
a normal boot, the typical boot28 assembly code initializes the processor copies cinit and pinit and
jumps to the bootloader’s main function. There the bootloader checks for a valid application or a
forced update, and then jumps to the application or starts the bootloader. The bootloader can also
be built with a failsafe mode that minimizes chances that the bootloader could be corrupted. If this
mode is enabled and the failsafe condition occurs (discussed in greater detail later in this guide),
the bootloader will begin execution in the boot28_f file and perform the same initializations it would
during a normal boot. Instead of jumping to main though the bootloader will enter the FailsafeEntry
function (found in bl_usb.c). By definition there is no application present in the failsafe mode, so the
bootloader is immediately started in this case.
The boot loader’s code and its corresponding linker script use a memory layout that exists entirely
in SRAM. This means that the load address of the code and read-only data are not the same as
the execution address. Once the boot loader calls the application, all SRAM becomes usable by
the application.
After a reset, the start-up code checks to see if an application update should be performed by
calling CheckForceUpdate(). If an update is not required, the bootloader then check for a valid
application. At a minimum the bootloader must find a valid address at the application entry pointer
pAppEntry. A secondary CRC check can also optionally be perfomed using linker generated CRC
tables. For more information on linker generated CRC tables please see SPRU513d Assembly
Language Tools User Guide. Assuming an update is required, it is at this point that the bootloader
kernel is copied from flash to SRAM. After the copy has completed the microcontroller is initialized
by calling ConfigureUSB() after which the function UpdaterUSB() configures the USB interface
for device mode.
The check for an application update (in CheckForceUpdate()) consists of checking the beginning
of the application area and optionally checking the state of a GPIO pin. The GPIO pin check
can be enabled with ENABLE_UPDATE_CHECK in the bl_config.h header file, in which case an
update can be forced by changing the state of a GPIO pin (for example, with a push button). If
the application is valid and the GPIO pin is not requesting an update, the application is called.
Otherwise, an update is started by entering the main loop of the boot loader.
Additionally, the application can call the boot loader in order to perform an application-directed up-
date. In this case, the boot loader assumes that the application has already configured the USB
peripheral. This allows the boot loader to use the peripheral as is to perform the update. The
boot loader also assumes that the interrupt to the core has been left enabled as well, which means
that that application should not call DINT before calling the boot loader. Once the application calls
the boot loader, the boot loader copies itself to SRAM, branches to the SRAM copy of the boot
loader, and starts the update by calling UpdaterUSB(). The application should enter the boot-
loader via the AppUpdaterUSB function whose address can be found via the pBootEntry pointer (in
bl_entrytable.asm).
DFU_DNLOAD This OUT request is used to send a block of binary data to the
device. The DFU class specification does not define the con-
tent and format of the binary data but typically this will be either
binary data to be written to some position in the device’s flash
memory or a device-specific command. The request payload
size is constrained by the maximum packet size specified in the
DFU functional descriptor. In this implementation, that maximum
is set to 1024 bytes.
After sending a DFU_DNLOAD request, the host must poll the
device status and wait until the state reverts to DNLOAD_IDLE
before sending another request. If the host wishes to indi-
cate that it has finished sending download data, it sends a
DFU_DNLOAD request with a payload length of 0.
DFU_GETSTATUS This IN request allows the host to query the current status of the
DFU device. It is typically used during download operations to
determine when it is safe to send the next block of data. De-
pending upon the state of the DFU device, this request may
also trigger a state change. During download, for example, the
device enters DNLOAD_SYNC state after receiving a block of
data and remains there until the data has been processed and
a DFU_GETSTATUS request is received at which point the state
changes to DNLOAD_IDLE.
DFU_GETSTATE This IN request is used to query the current state of the device
without triggering any state change. The single byte of data re-
turned indicates the current state of the DFU device.
IDLE The IDLE state indicates to the host that the DFU device is ready
to start an upload or download operation.
MANIFEST This state indicates to the host that the device is programming a
previously- received firmware image and is entered on receipt of
a DFU_GETSTATUS request while a device that is not manifest
tolerant is in MANIFEST_SYNC state.
This state is not used by the USB boot loader since it is manifest
tolerant and reverts to IDLE state after completion of a download.
MANIFEST_WAIT_RESET This state indicates that a device which is not manifest tolerant
has finished writing a downloaded image and is waiting for a
USB reset to signal it to boot the new firmware.
This state is not used by the USB boot loader since it is manifest
tolerant and reverts to IDLE state after completion of a download.
Send DFU_GETSTATUS
State is
State is State is
DNLOAD_SYNC
DNLOAD_IDLE? No No ERROR?
or DNBUSY?
No Yes
State is Yes
Report the error condition
ERROR?
No
Exit
The DFU class specification provides the framework necessary to download and upload firmware
files to the USB device but does not specify the actual format of the binary data that is transferred.
As a result, different device implementations have used different methods to perform operations
which are not defined in the standard such as:
Setting the address and size of the area of flash whose contents are to be uploaded.
Querying the size of flash and writeable area addresses. The USB boot loader implementation
employs a small set of commands which can be sent to the DFU device via a DFU_DNLOAD
request when the device is in IDLE state. Each command takes the form of an 8 byte structure
which defines the operation to carry out and provides any required additional parameters.
To ensure that a host application which does not have explicit support for TI-specific commands can
still be used to download binary firmware images to the device, the protocol is defined such that only
a single 8 byte header structure need be placed at the start of the binary image being downloaded.
This header and the DFU-defined suffix structure can both be added using the supplied “dfuwrap”
command-line application, hence providing a single binary that can be sent to a device running the
TI USB boot loader using a standard sequence of DFU_DNLOAD requests with no other embedded
commands or device-specific operations required. An application which does understand the TI-
specific commands may make use of them to offer additional functionality that would not otherwise
be available.
The commands defined here and their parameter block structures can be found in header file
usbdfu.h. In all cases where multi-byte numbers are specified, the numbers are stored in little-
endian format with the least significant byte in the lowest addressed location. The following defini-
tions specify the command byte ordering unambiguously but care must be taken to ensure correct
byte swapping if using the command structure types defined in usbdfu.h on big-endian systems.
DFU_CMD_PROG This command is used to provide the USB boot loader with the address at
which the next download should be written and the total length of the firmware
image which is to follow. This structure forms the header that is written to the
DFU-wrapped file generated by the dfuwrap tool.
The start address is provided in terms of 1024 word flash blocks. To convert a
word address to a block address, merely divide by 1024. The start address must
always be on a 1024 word boundary. For example if you wanted to program data
at address 0x3D8000 (start of flash) the block number sent would be 0xF60.
This command may be followed by up to 1016 bytes of firmware image data,
this number being the maximum transfer size minus the 8 bytes of the command
structure. Keep in mind that while data is transferred over USB in bytes it is
programmed into the device flash as words (2 bytes). The image size field
should contain the number of bytes to be programmed (not words).
Data following this command in the following format 0xXX, 0xYY will be pro-
grammed into flash as 0xXXYY (i.e. the most significant byte of a word should
be transmitted first).
DFU_CMD_READ This command is used to set the address range whose content will be returned
on subsequent DFU_UPLOAD requests from the host.
The start address is provided in terms of 1024 words flash blocks. To convert
a word address to a block address, merely divide by 1024. The start address
must always be on a 1024 byte boundary.
To read back a the contents of a region of flash, the host should send a
DFU_DNLOAD request with command DFU_CMD_READ, start address set to
the 1KW block start address and length set to the number of bytes to read. The
host should then send one or more DFU_UPLOAD requests to receive the cur-
rent flash contents from the configured addresses. Data returned will include an
8 byte DFU_CMD_PROG prefix structure unless the prefix has been disabled
by sending a DFU_CMD_BIN command with the bBinary parameter set to 1.
The host should, therefore, be prepared to read 8 bytes more than the length
specified in the READ command if the prefix is enabled.
By default, the 8 byte prefix is enabled for all upload operations. This is required
by the DFU class specification which states that uploaded images must be for-
matted to allow them to be directly downloaded back to the device at a later
time.
DFU_CMD_CHECK This command is used to check a region of flash to ensure that it is completely
erased.
The start address is provided in terms of 1024 word flash blocks. To convert
a word address to a block address, merely divide by 1024. The start address
must always be on a 1024 word boundary. The region size is transmitted in
words.
To check that a region of flash is erased, the DFU_CMD_CHECK command
should be sent with the required start address and region length set then the
host should issue a DFU_GETSTATUS request. If the erase check was suc-
cessful, the returned bStatus value will be OK (0x00), otherwise it will be er-
rCheckErased (0x05).
DFU_CMD_INFO This command is used to query information relating to the target device and
programmable region of flash. The device information structure, tDFUDevice-
Info, is returned on the next DFU_UPLOAD request following this command.
//*******************************************************************
//
// Payload returned in response to the DFU_CMD_INFO command.
//
// This is structure is returned in response to the first DFU_UPLOAD
// request following a DFU_CMD_INFO command. Note that byte ordering
// of multi-byte fields is little-endian.
//
//*******************************************************************
typedef struct
{
//
// The size of a flash block in bytes.
//
unsigned short usFlashBlockSize;
//
// The number of blocks of flash in the device. Total
// flash size is usNumFlashBlocks * usFlashBlockSize.
//
unsigned short usNumFlashBlocks;
//
// Information on the part number, family, version and
// package as read from the PARTID register
//
unsigned long ulPartInfo;
//
// Information on the part class and revision as read
// from the CLASSID
//
unsigned long ulClassInfo;
//
// Address 1 byte above the highest location the boot
// loader can access.
//
unsigned long ulFlashTop;
//
// Lowest address the boot loader can write or erase.
//
unsigned long ulAppStartAddr;
//
// Features supported by the bootloader
//
tLong ulFeatures;
//
// If true the device is locked and flash reads/writes are disallowed
//
unsigned char ucLocked;
}
PACKED tDFUDeviceInfo;
DFU_CMD_RESET This command may be sent to the USB boot loader to cause it to perform a
soft reset of the board. This will reboot the system and, assuming that the main
application image is present, run the main application. Note that a reboot will
also take place if a firmware download operation completes and the host issues
a USB reset to the DFU device.
DFU_CMD_CSM This command may be sent to the USB boot loader to cause it to lock or unlock
the device’s code security module. Unlocking the device is accomplished
by first sending the CSM command with all fields set to 0. When the device
receives this command it will generate a seed which can be retreived by
performing a DFU Upload. The host should then perfom encryption on this
seed using a pre-negotiated key. To finish authentication and unlock the
device the host should again send a CSM command but with the key size field
populated and the encrypted seed following the command. Success can be
checked by using the info command. The device will automatically lock when
reset if the CSM locations aren’t all 0xFF, but the device can also be manually
locked by sending the CSM command with the lock field a non-zero value.
The public release of the bootloader does not contain this feature.
4 Customization
This bootloader contains many advanced features that are on par with many professionally sup-
ported 3rd party bootloaders. All of the features can be turned on or off by configuring #defines in
bl_config.h.
ENABLE_WATCHDOG
If defined the watchdog will be enabled and kicked in the main update loop.
ENABLE_CSM_CONTROL
If defined the bootloader will include mechanisms to lock and unlock the code security module. AES
encryption libraries are used to do a seed key exchange to authenticate the host. The passwords
to be programmed into flash can be found immediately below this #define. Please note that the
public release of the bootloader doesn’t contain the encryption library neccessary to implement this
feature due to export restrictions. Please contact TI if you are interested in this feature.
ENABLE_READ
Enables the upload of flash memory contents. Applications that want their code to be secure should
not define this, but keep in mind the programmed code cannot then be verified.
ENABLE_CRC_CHECK
If defined, before booting the application the bootloader will examine the ulAppSig location for a
pointer to a linker generated CRC table in the application. The bootloader will then iterate though
this table checking each CRC record. If all records pass then the application is booted.
ENABLE_FAILSAFE
If defined the bootloader will generate two flash entry points and relocate itself in flash during erase
operations. This minimizes the critical time where if power is pulled the device becomes bricked.
This is an EXTREMELY advanced feature and should only be used by those with a great deal of
embedded programming experience.
ENABLE_DECRYPTION
ENABLE_UPDATE_CHECK
If defined before checking for a valid application, the bootloader will check a GPIO pin for a given
state. If the state matches the defined state in bl_config.h the bootloader will start and wait for an
update to be performed.
5 Configuration
There are a number of defines that are used to configure the operation of the boot loader. These
defines are located in the bl_config.h header file.
The configuration options are:
FLASH_PAGE_SIZE The size of a single, erasable page in the flash. This must
be a power of 2. The default value of 32KB (16K Words)
represents the page size for the internal flash on all C2000
MCUs.
This value must be defined.
USB_VENDOR_ID The USB vendor ID published by the DFU device. This value
is the TI vendor ID. Change this to the vendor ID you have
been assigned by the USB-IF.
USB_PRODUCT_ID The USB device ID published by the DFU device. If you are
using your own vendor ID, chose a device ID that is different
from the ID you use in non-update operation. If you have
sublicensed TI’s vendor ID, you must use an assigned prod-
uct ID here.
USB_MAX_POWER Sets the maximum power consumption that the DFU device
will report to the USB host in the configuration descriptor.
Units are milliamps.
USB_BUS_POWERED Specifies whether the DFU device reports to the host that it
is self-powered (defined as 0) or bus-powered (defined as
1).
USB_MUX_PIN Specifies the GPIO pin number used to select between USB
host and device modes. Valid values are 0 through 64.
This value must be defined if USB_HAS_MUX is defined.
USB_MUX_DEVICE Specifies the state of the GPIO pin required to select USB
device-mode operation. Valid values are 0 (low) or 1 (high).
This value must be defined if USB_HAS_MUX is defined.
6 Failsafe Mode
The purpose of the failsafe bootloader mode is twofold. Because the flash sector size is 0x4000kw
and the bootloader is only ∼0x1500kw large a tradition bootloader which protects the sector it re-
sides in would waste a sizable piece of otherwise usable flash memory. To overcome this limitation
the bootloader must copy itself into another flash sector such that its original flash sector can be
erased and reused for the user application. This is the first reason for the failsafe mode.
During any bootloading scenario there exists a time during erase where the device can potentially
be corrupted and caused to not boot correctly. This can happen if power if removed during an
erase or program operation of Sector A (the location of the BootROM boot vector). To minimize the
chances of this occuring the erase and program of sector are ordered such that an erase of Sector
A is immediately followed by a reprogramming of the reset vector. This is the second reason for the
failsafe mode.
To better understand the failsafe mode, lets walk through a typical erase operation. Keep in mind
that while in failsafe mode the erase command’s address and size arguments are ignored and the
entire flash is always erased.
Erase Sectors B-G. This erases most of the application leaving only the bootloader and reset vector
in flash. Device will boot normally if power is removed at this point.
Erase Sector A and program reset vector to point to the failsafe entry point in flash Sector G. During
this operation if power is removed the device may not boot on the next powerup. If power is removed
after this operation completes successfully but before the bootloader is copied back into Sector H,
then the device will boot into the failsafe mode which requires an application update.
Erase Sector A and program reset vector to point to the normal entry point in flash Sector H. During
this operation if power is removed the device may not boot on the next powerup. If power is removed
after this operation completes successfully, then the device will boot into the normal mode and will
require and application update because the pAppEntry vector will be null.
After these operations complete the flash will be completely erased (except for the area ocupied by
the bootloader) and ready for the application to be programmed.
Program code that runs from flash in Sector H (normal boot, application check, normal memory
copy).
Program code that runs from flash in Sector G (failsafe boot, failsafe memory copy).
Program code that runs from SRAM and is copied from Sector G or H depending on whether the
device is in failsafe mode at the time or not.
Please refer to figure 5.1 for a graphic representation of the memory with failsafe mode enabled.
7 Source Details
Decryption Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Update Check Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
USB Device Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Functions
void DecryptData (unsigned char ∗pucBuffer, unsigned long ulSize)
ulSize is the size, in bytes, of the buffer that was passed in via the pucBuffer parameter.
This function is a stub that could provide in-place decryption of the data that is being downloaded
to the device.
Prototype:
DecryptData void DecryptData(
Returns None.
Functions
unsigned char CheckCRCTable (volatile CRC_TABLE ∗pCRCTable)
volatile CRC_TABLE ∗ pCRCTable ) Checks a Linker Generated CRC table against memory
Parameters pCRCTable CRC Table to be checked
This function iterates through a CRC table performing the checks specified against the memory
map.
Prototype:
CheckCRCTable unsigned char CheckCRCTable(
Referenced by CheckForceUpdate().
Data Structures
void
void tConfigDescriptor
tLong
tShort
tString0Descriptor
tStringDescriptor
tUSBRequest
Macros
readLong(ptr)
readShort(ptr)
writeLong(ptr, value)
writeShort(ptr, value)
Functions
void AppCheck (void)
ptr ) This define is used to read data from a tLong variable. This is a is a workaround specific to
C2000 devices.
Referenced by FlashRangeCheck(), HandleRequestDnloadIdle(), HandleRequestUploadIdle(),
HandleSetAddress(), and ProcessDFUDnloadCommand().
7.3.2.2
ptr ) This define is used to read data from a tShort variable. This is a is a workaround specific to
C2000 devices.
Referenced by HandleRequestDnloadIdle(), HandleRequestIdle(), HandleRequests(), Han-
dleRequestUploadIdle(), and ProcessDFUDnloadCommand().
7.3.2.3
ptr,
value ) This define is used to write data to a tLong variable. This is a is a workaround specific to
C2000 devices.
Referenced by ConfigureUSBInterface().
7.3.2.4
ptr,
value ) This define is used to write data to a tShort variable. This is a is a workaround specific to
C2000 devices.
Referenced by ConfigureUSBInterface(), and SendUploadData().
Definition:
typedef struct
{
Members:
bLength The length of this descriptor in bytes. All configuration descriptors are 9 bytes long.
bDescriptorType The type of the descriptor. For a configuration descriptor, this will be
USB_DTYPE_CONFIGURATION (2).
wTotalLength The total length of data returned for this configuration. This includes the com-
bined length of all descriptors (configuration, interface, endpoint and class- or vendor-
specific) returned for this configuration.
bNumInterfaces The number of interface supported by this configuration.
bConfigurationValue The value used as an argument to the SetConfiguration standard re-
quest to select this configuration.
iConfiguration The index of a string descriptor describing this configuration.
bmAttributes Attributes of this configuration.
bMaxPower The maximum power consumption of the USB device from the bus in this con-
figuration when the device is fully operational. This is expressed in units of 2mA so, for
example, 100 represents 200mA.
Description:
This structure describes the USB configuration descriptor as defined in USB 2.0 specification
section 9.6.3. This structure also applies to the USB other speed configuration descriptor
defined in section 9.6.4.
7.3.3.2 tLong
Definition:
typedef struct
{
tShort LSW;
tShort MSW;
}
tLong
Members:
LSW
MSW
Description:
This struct is used to ensure that data passed up from the driver layer is interpretted correctly
by the protocol stack. This is a workaround specifically for C2000 devices.
7.3.3.3 tShort
Definition:
typedef struct
{
unsigned short LSB;
unsigned short MSB;
}
tShort
Members:
LSB
MSB
Description:
This struct is used to ensure that data passed up from the driver layer is interpretted correctly
by the protocol stack. This is a workaround specifically for C2000 devices.
7.3.3.4 tString0Descriptor
Definition:
typedef struct
{
unsigned char bLength;
unsigned char bDescriptorType;
tShort wLANGID[1];
}
tString0Descriptor
Members:
bLength The length of this descriptor in bytes. This value will vary depending upon the number
of language codes provided in the descriptor.
bDescriptorType The type of the descriptor. For a string descriptor, this will be
USB_DTYPE_STRING (3).
wLANGID The language code (LANGID) for the first supported language. Note that this de-
scriptor may support multiple languages, in which case, the number of elements in the
wLANGID array will increase and bLength will be updated accordingly.
Description:
This structure describes the USB string descriptor for index 0 as defined in USB 2.0 specifi-
cation section 9.6.7. Note that the number of language IDs is variable and can be determined
by examining bLength. The number of language IDs present in the descriptor is given by
((bLength - 2) / 2).
7.3.3.5 tStringDescriptor
Definition:
typedef struct
{
unsigned char bLength;
unsigned char bDescriptorType;
Members:
bLength The length of this descriptor in bytes. This value will be 2 greater than the number of
bytes comprising the UNICODE string that the descriptor contains.
bDescriptorType The type of the descriptor. For a string descriptor, this will be
USB_DTYPE_STRING (3).
bString The first byte of the UNICODE string. This string is not NULL terminated. Its length
(in bytes) can be computed by subtracting 2 from the value in the bLength field.
Description:
This structure describes the USB string descriptor for all string indexes other than 0 as defined
in USB 2.0 specification section 9.6.7.
7.3.3.6 tUSBRequest
Definition:
typedef struct
{
unsigned char bmRequestType;
unsigned char bRequest;
tShort wValue;
tShort wIndex;
tShort wLength;
}
tUSBRequest
Members:
bmRequestType Determines the type and direction of the request.
bRequest Identifies the specific request being made.
wValue Word-sized field that varies according to the request.
wIndex Word-sized field that varies according to the request; typically used to pass an index
or offset.
wLength The number of bytes to transfer if there is a data stage to the request.
Description:
The standard USB request header as defined in section 9.3 of the USB 2.0 specification.
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2024, Texas Instruments Incorporated