AnsweredAssumed Answered

USB Host (HVAC demo) fail

Question asked by arnogir on Nov 20, 2014
Latest reply on Dec 15, 2014 by arnogir

Hello everybody.

 

I'm using a board with a K70FN1M0VMJ15 an USB port connected to the µC pin USB0DM/DP.

 

I'm using the exemple given in C:\Freescale\Freescale_MQX_4_1\demo\hvac

I only extract the USB file (USB_Files.cpp/hpp, USB_Classes.cpp/hpp, USB_Task.cpp/hpp) and create a main.cpp like following:

 

TASK_TEMPLATE_STRUCT MQX_template_list[] =
{
/*  Task number, Entry point, Stack, Pri, String, Auto? */
  { USB_TASK,     USB_task,        2200L,   8L,      "USB",      MQX_AUTO_START_TASK,    0,      0           },
   {MAIN_TASK  ,Main_task  ,   1000, 4,"main"   , MQX_AUTO_START_TASK, 0, 0},
};

/*TASK*-----------------------------------------------------------------
*
* Function Name  : Main_task
* Comments       :
*    This task initializes MFS and starts SHELL.
*
*END------------------------------------------------------------------*/
void Main_task(uint_32 initial_data)
{

 
 for (;;)
 {
    _time_delay(10000); 
  }
}
 

 

 

But this example do not wok find every time.

 

1- I declare only the USB_TASK (no main task) with Stack = 2200 and Prio = 8 (Like in example):

Unable to open USB device

Error while uninstalling filesystem.

Error while uninstalling partition manager.

USB device removed.

 

2- I declare only the USB_TASK (no main task) with Stack = 2200 and Prio = 9:

Unable to open USB device

Error while uninstalling filesystem.

Error while uninstalling partition manager.

USB device removed.

 

3- I declare only the USB_TASK (no main task) with Stack = 3000 and Prio = 9:  (WORK FINE !!!!!!)

************************************************************************

Vendor Information: Intenso Mass Storage Device

Product Identification: Rainbow Line 

Product Revision Level: 8.07

************************************************************************

Installing MFS over partition...

USB device installed to c:

 

 

4- I declare only the USB_TASK (no main task) with Stack = 4000 and Prio = 9:  (Not work with a larger stack size!!!

Unable to open USB device

Error while uninstalling filesystem.

Error while uninstalling partition manager.

USB device removed.

 

5- I declare the USB_TASK + The  Maintask with Stack = 3000 and Prio = 9:  (Not work with an other task which do nothing!

Unable to open USB device

Error while uninstalling filesystem.

Error while uninstalling partition manager.

USB device removed.

 

 

To resume, the USB work fine and install a partition on my USB key, ONLY when I have ONE task (USB) with STackSize = 3000 and task Prio = 9.

In all other case, USB not work.

When USB not work, it is the call back awaiting after calling usb_mass_ufi_inquiry which is never received (Screenshot in attached file)

 

Do you have an Idea?

Thank

Attachments

Outcomes