Hi,
Continuing work on my school project, but hit a slight wall.
Question 1:
The spider died, no clue why.
I used a SP as well as a powered DP usb module, I plug it in to multiple PC’s, nothing comes up, nothing in the device manager, not even usb sound, tried reseting, flipping the switches back and fourth, nothing. The LED comes up, but apart from that, nothing.
It did happen previously, after getting exceptions it would start running out of memory and then would go in to a lock down mode for a day. You would have to disconnect it from everything and give it some time.
Any suggestions? Is there any low level debugger for USB ports or something?
If I just disconnect the same cable and connect it to Hydra, it pops up instantly.
Question 2:
When using Hydra, I usually have to first build the code, then deploy the code manually, then run the debugger, if I just press F5, it gets stuck at sending assemblies to device, or says that device not in initialized state, rebooting, and gets stuck at that point. What could be the cause?
Another question, is it possible to run CDC with Hydra?
So far my code:
public partial class Program
{
Socket[] sockets;
USBC_CDC virtualSerialPort;
void ProgramStarted()
{
sockets = new Socket[] { Socket.GetSocket(14, false, null, null) };
GT.Timer timer = new GT.Timer(1);
timer.Tick += new GT.Timer.TickEventHandler(timer_Tick);
timer.Start();
virtualSerialPort = USBClientController.StandardDevices.StartCDC();
}
private string buildString()
{
int cInput = 0;
string result = "";
for (int i = 0; i < sockets.Length; i++)
{
Socket socket = sockets[i];
result += cInput++ + ":" + (int)System.Math.Round(socket.AnalogInput3.ReadVoltage() * 1024 / 3.3) + "\n";
result += cInput++ + ":" + (int)System.Math.Round(socket.AnalogInput4.ReadVoltage() * 1024 / 3.3) + "\n";
result += cInput++ + ":" + (int)System.Math.Round(socket.AnalogInput5.ReadVoltage() * 1024 / 3.3) + "\n";
}
return result;
}
private void timer_Tick(Gadgeteer.Timer timer)
{
if (virtualSerialPort != null)
{
virtualSerialPort.Write(System.Text.Encoding.UTF8.GetBytes(buildString()), 0, buildString().Length);
}
}
}
the exception
#### Exception System.Exception - CLR_E_DRIVER_NOT_REGISTERED (2) ####
#### Message:
#### Microsoft.SPOT.Hardware.NativeEventDispatcher::.ctor [IP: 0000] ####
#### GHIElectronics.NETMF.System.InternalEvent::.cctor [IP: 0014] ####
An unhandled exception of type 'System.Exception' occurred in Microsoft.SPOT.Hardware.dll
Thanks.