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.

AM3359 USB0 and usb_device_host_msc starterware example

Hi!

I'm evaluating USB0 host msc, and I'm trying to use starterware example usb_device_host_msc.

In this example USB interrupts are enabled here:

 

//
// Enable the UART.
//
UARTStdioInit();
UARTprintf("\n\nUSB Mass Storage Host program\n");
UARTprintf("Type \'help\' for help.\n\n");

//
//USB Interrupt enable
//
USBInterruptEnable();

//
//Delay timer setup
//
DelayTimerSetup();

//
// Enable Clocking to the USB controller.
//
USB0ModuleClkConfig();

//
// Register the host class drivers.
//
USBHCDRegisterDrivers(USB_INSTANCE_Host, g_ppHostClassDrivers, NUM_CLASS_DRIVERS);

 

USBInterruptEnable() function register USB1HostIntHandler() as ISR, which uses g_USBInstance variable to access USB registers.

Problem is that g_USBInstance is not configured by anyone before USBInterruptEnable() call, so at the very first register read/write every variable in g_USBInstance is NULL (or random data, since nobody initialize it).

Any advice?