Hi,
I’ve ported my CCS project from a Stellaris M3 controller to the new Tiva TM4C124GH6PZ.
I used as a reference, the application report “Migrating Software Projects from StellarisWare to TivaWare”
So far the port has been successful, accept for the Tivaware USB Library - HID Device Class Driver.
In the original Stellaris code, we followed the example in the “Stellaris USB Library User’s Guide” to define our tUSBDHIDDevice. This worked.
To port the code I followed the Tiva migration instructions, removing the pointer to the private instance data in the tUSBDHIDDevice setup.
The new Tiva project builds without errors, however the processor goes in to the FaultISR() when the USBDHIDInit() function is called. The fault codes are: “Bus Fault Address Register Valid” and “Precise Data Bus Error”.
Stepping though in the debugger, it looks like it faults when a USB library function is trying to read the tUSBDHIDDevice.ppsConfigDescripter.
I’m not sure what I am missing.
See code below:
static tUSBDHIDDevice g_sHIDTorqueDevice;
bool HID::Init(unsigned int ProductId, unsigned int serialNumber)
{
g_sHIDTorqueDevice.ui16VID = USB_VID_TI_1CBE;
g_sHIDTorqueDevice.ui16PID = ProductId;
g_sHIDTorqueDevice.ui16MaxPowermA = 500;
g_sHIDTorqueDevice.ui8PwrAttributes = USB_CONF_ATTR_SELF_PWR;
g_sHIDTorqueDevice.ui8Subclass = USB_HID_SCLASS_NONE;
g_sHIDTorqueDevice.ui8Protocol = USB_HID_PROTOCOL_NONE;
g_sHIDTorqueDevice.ui8NumInputReports = 1;
g_sHIDTorqueDevice.psReportIdle = g_psReportIdle;
g_sHIDTorqueDevice.pfnRxCallback = _RxHandler;
g_sHIDTorqueDevice.pvRxCBData = this;
g_sHIDTorqueDevice.pfnTxCallback = _TxHandler;
g_sHIDTorqueDevice.pvTxCBData = this;
g_sHIDTorqueDevice.bUseOutEndpoint = true;
g_sHIDTorqueDevice.psHIDDescriptor = &g_sMouseHIDDescriptor;
g_sHIDTorqueDevice.ppui8ClassDescriptors = g_pMouseClassDescriptors;
g_sHIDTorqueDevice.ppui8StringDescriptors = g_pStringDescriptors;
g_sHIDTorqueDevice.ui32NumStringDescriptors = NUM_STRING_DESCRIPTORS;
pvInstance = USBDHIDInit(0, &g_sHIDTorqueDevice);
return(pvInstance != 0);
}