This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am having trouble passing parameters to the TM4C123F with ROM_UpdateUSB.
I would like to be able to specify strings as I may have many DFU devices online at a given time.
I created an InfoStructure to get around an IAR limitation. (The documentation declares an array of bytes and ends with a pointer to the string table. IAR will not generate that code.)
The typedef is:
__packed typedef union
{
struct {
uint16_t VID;
uint16_t PID;
uint16_t bcdVersion;
uint8_t Current;
uint8_t Attributes;
uint8_t* Strings;
} Fields;
uint8_t pBytes[ sizeof(Fields) ];
} InfoStruct;
I then filled in the structure with the desired information:
pBootInfo.Fields.VID = 0x1cbe; // TI VID
pBootInfo.Fields.PID = 0x00ff; // Tiva DFU PID
pBootInfo.Fields.bcdVersion = 0x0200; // USB version 2.0
pBootInfo.Fields.Current = 0x00; // 0mA of Bus power
pBootInfo.Fields.Attributes = 0xC0; // Self powered using no bus power
pBootInfo.Fields.Strings = &BootStrings[0];// Address of the string table
The BootStrings:
//
// create the boot information structure
//
uint8_t BootStrings[] =
{
(1 * 2) + 2, // One Language (1 * 2) + 2
USB_DTYPE_STRING,
0x09, 0x04, // Language code for US English.
(16 * 2) + 2, // Size of Manufacturer String.
// "InclineSoftworks"
USB_DTYPE_STRING,
'I', 0, 'n', 0, 'c', 0, 'l', 0, 'i', 0, 'n', 0, 'e', 0, 'S', 0,
'o', 0, 'f', 0, 't', 0, 'w', 0, 'o', 0, 'r', 0, 'k', 0, 's', 0,
(24 * 2) + 2, // Size of Product String.
USB_DTYPE_STRING, // "IOSim Controller Upgrade"
'I', 0, 'o', 0, 'S', 0, 'i', 0, 'm', 0, ' ', 0, 'C', 0, 'o', 0,
'n', 0, 't', 0, 'r', 0, 'o', 0, 'l', 0, 'l', 0, 'e', 0, 'r', 0,
' ', 0, 'U', 0, 'p', 0, 'g', 0, 'r', 0, 'a', 0, 'd', 0, 'e', 0,
(8 * 2) + 2, // Size of Serial Number.
USB_DTYPE_STRING,
// " 100"
' ', 0, ' ', 0, ' ', 0, ' ', 0, ' ', 0, '1', 0, '0', 0, '0', 0
};
I am interested in getting the serial number to display.
However, when I shift into DFU mode, I don't get anything useful:
VID: 0x1cbe PID: 0x00ff
Device Name: <<Unknown>>
Manufacturer: <<Unknown>>
DFU Interface: <<Unknown>>
Serial Num: <<Unknown>>
Max Transfer: 1024 bytes
Mode: DFU
TI Extensions: Supported
Target: revision B1
Attributes:
Will Detach: No
Manifest Tolerant: Yes
Upload Capable: Yes
Download Capable: Yes
Right now, my user manual is a mess.. I have to dump all the DFU information, have them select index/device number in a couple of places because it changes from initial enumeration to re-enumeration after a unit is placed in DFU mode. Workable, but awkward.
I double checked that the structure is packed. I also tried passing a null parameter to ROM_UpdateUSB. No change.