Fez Cobra II MassStorage Device

I continuing my tests on G120… Now is time for the Mass Storege device class. I want to test if is possible to see the Fez Cobra II board and it’s SD card as a USB pendrive from the PC. Page 51 of the manual says YES, also the Mass Storage section of the page [url]https://www.ghielectronics.com/docs/20/usb-client#108[/url]. I’ve tried various solutions proposed in the forum (for example the code provided by Dat [url]https://www.ghielectronics.com/community/forum/topic?id=16106&page=2[/url], but also others).

But all throw an exception when i set the Controller.ActiveDevice

[b]#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
#### Message: 
#### GHI.Usb.Client.RawDevice::NativeInitialize [IP: 0000] ####
#### GHI.Usb.Client.RawDevice::Activate [IP: 00fe] ####
#### GHI.Usb.Client.Controller::set_ActiveDevice [IP: 001c] ####
#### G120_Lun.Program::Main [IP: 007a] ####

A first chance exception of type ‘System.InvalidOperationException’ occurred in GHI.Usb.dll
An unhandled exception of type ‘System.InvalidOperationException’ occurred in GHI.Usb.dll[/b]

If I execute the application only (no debug) it does not works.
My configuration: Win7 (also Win10) x64, VS2013, SDK 2015 R1
DeviceInfo:
HAL build info: 4.3.1.0, Microsoft Copyright (C) Microsoft Corporation. All rig
OEM Product codes (vendor, model, SKU): 255, 0, 65535
Serial Numbers (module, system):
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Solution Build Info: 4.3.7.10, Copyright (C) GHI Electronics, LLC

Any one have some suggestion?

Thanks. I’ve read of the mode pin before but I confused it with the boot mode pins.

@ Dave McLaughlin - He is trying G120 to be a MS device when connected to a PC.

Oh. I didn’t see that bit.