USB Host question/problem

Using:

(Problem the same)
Windows 8 64bit
Updated to Windows 8.1 64bit

VS 2012 Express
FEZ Raptor mainboard
USB Host module

All GHI software/firmware is the latest version.

Start debugging or Restart does not work after the application starts. I must ‘reset’ the Raptor.

Debug:
Restarting interpreter…
Attaching to device…
Waiting for device to initialize…
The GHI NETMF Debug Interface goes away (which is normal) but it does not return.

If I have a USB device connected and receive the event
usbHost.USBDriveConnected += new UsbHost.USBDriveConnectedEventHandler(usbHost_USBDriveConnected);

I can no longer debug without resetting the Raptor.

If I do not insert a USB device I can debug normally.

USB devices used are: USB Flash (SanDisk/PNY of various capacity) or a USB Card Reader (with SD Card). Same problem whatever device is inserted.

There appears to be a conflict between the USB Client DP and the USB Host when medial is inserted.

Anyone have any idea how to correct this?

Thanks in advance!

@ andre.m -

Powered USB Hub 2.5 Amp

@ andre.m -

I forgot to mention that the USB Host read/write works well. I also tried powering the USB Host module with a PowerExt v1.0

EDIT: Adding

If using Deploy (Raptor not reset) I receive

Looking for a device on transport 'USB’
Starting device deployment…
Iteration 0
Opening port \?\usb#vid_1b9f&pid_0102#0000000001#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Attaching debugger engine…
… cannot attach debugger engine!

How is this USB device detected in the device manager?

@ David@ Emrol -

How is this USB device detected in the device manager?

USB Host does not show in device manager. It is a USB port on my Raptor for a inserted USB Flash or USB Card reader.

All works well except I cannot Debug F5 or Restart Ctrl+Shift+F5 without a hard reset of the raptor.

//The usbHost.USBDriveConnected event is received when media is inserted
usbHost.USBDriveConnected +=
new UsbHost.USBDriveConnectedEventHandler(usbHost_USBDriveConnected);

Once the device is connected there seems to be a conflict with USB Client (at least for debugging)

@ willgeorge

We ran a small test program on a Windows 7 machine deploying with VS 2012 and are not experiencing the same problem that you are describing. Do you happen to have a Windows 7 PC available to try deploying to your device?

We will test on a Windows 8 machine as soon as possible to see if there is a connection to the OS version.

@ Aron -

Sorry for the late reply… My Windows 7 PC died last month… I want to get it going again but will take some time. I will try if/when I get it running again.

EDIT: I should clarify my statement:
“I can no longer debug without resetting the Raptor.”

I CAN debug the application. I should say: I cannot start a NEW debugging session without the mainboard reset.

That’s a great clarifying statement, may help a lot. Can you explain to us the scenario? Does what I describe below resonate with what you’re doing??

With your project open, hit F5 to deploy to the device.
Program gets deployed, you commence debugging, you find an issue and you hit stop debugging. You make your code change and then hit F5 again. At that point the debugging engine can’t connect to the device and you have to manually reset it and that then allows the debugger engine to connect to the board.

@ willgeorge -

We understood and tried with that. it works fine in our side. I think you use a loop without sleep somewhere, it may causes this issue.

Can you try simple code in your side:

namespace GadgeteerApp1
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
           
            usbHost.USBDriveConnected += new UsbHost.USBDriveConnectedEventHandler(usbHost_USBDriveConnected);
        }

        void usbHost_USBDriveConnected(UsbHost sender, GT.StorageDevice storageDevice)
        {
            Debug.Print("USB device has connected");
        }
    }
}

@ Dat -

Thanks…

My application is quite large and I have no ‘intentional’ loops.

I thank you all for looking into my question.

I will try to track down what in my code is causing my problem. The application runs as expected but I am not a professional programmer so I am most likely the cause…

Thanks again.