Mountaineer USB - This device cannot start. (Code 10)

Something that used to work is no longer working and I keep getting a:

This device cannot start. (Code 10)

Error when I plug in my Moutaineer USB board. I’ve reflashed the board, uninstall and attempted to reinstall the WinUSB drivers a number of times, but I seem to have run into a wall here, any suggestions?

Windows 7 64 bit Enterprise system, fully patched. Spider, Cerberus etc all working. The Mountaineer USB board is using the latest 4.2 QEF2 firmware and drivers.

Thanks

This error message occurs if there are problems with the USB setup on the PC. It could be related to the USB 3.0 problem that is mentioned e.g. here:

http://www.tinyclr.com/forum/topic?id=8833&page=2

For a while, we could reproduce the USB 3.0 on the one laptop that we have that has USB 3.0. But for unknown reasons, the problem now doesn’t occur anymore :-((( We’ll try to find other PCs where we can reproduce the problem again.

Still not working, however if I press the reset button and then hold down the other button, the LED starts to flash blue and it connects (ie I can ping it using .MFD Deploy tool), but if I asked it to Show Device Info I get a DeviceInfo is not valid! error. So something works, just not enough of it.

This means the USB driver in the TinyBooter is working but the driver in the TinyClr is not (they are identical).
“Show Device Info” is not supported by the TinyBooter, so the error message is normal.
In TinyBooter, try to erase the deployment sectors and then run the TinyClr again. Maybe a program is loaded which immediately crashes and blocks the USB driver.

Thank you very much for that suggestion as I can now connect to my Mountaineer USB:

DeviceInfo:
HAL build info: 4.2.0.0, Copyright Oberon microsystems, Inc.
OEM Product codes (vendor, model, SKU): 255, 0, 65535
Serial Numbers (module, system):
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Solution Build Info: 4.2.0.0, Mountaineer Group
AppDomains:
default, id=1
Assemblies:
mscorlib,4.2.0.0
Microsoft.SPOT.Native,4.2.0.0
Microsoft.SPOT.Hardware,4.2.0.0
Microsoft.SPOT.Hardware.SerialPort,4.2.0.0
Microsoft.SPOT.Hardware.Usb,4.2.0.0
Microsoft.SPOT.Hardware.PWM,4.2.0.1
System.Xml,4.2.0.0

it still seems a tad bit finicky but we are back in game, more testing to follow.

It seems the only way I can deploy apps to the board is if I put it in tinybooter mode, then using MFDeploy I erase the Deployment area, then I can deploy an app (exactly as it should), but otherwise when trying to debug something I get an unable to communicate with teh device (MFDeploy is also unable to ping it).

Also shouldn’t a Mountaineer USB board have plenty of memory to use an OLEDDisplay as it doesn’t seem to be working at all with my mainboard.

I tried running a very simple app that does seem to startup correctly when debugging etc but I get the following error everytime (also saw this in other apps I was trying to write for the Mountaineer USB board that didn’t start up correctly).

A first chance exception of type ‘System.NotSupportedException’ occurred in Microsoft.SPOT.IO.dll

Thinking there must be something simply wrong, but I don’t know what.

It doesn’t get much simpler then this:

namespace MountaineerTest1
{
    public partial class Program
    {
        private bool _flash;
        private GT.Timer _timer;

        void ProgramStarted()
        {
            Debug.Print("Program Started");
            Debug.Print(Mainboard.MainboardName);
            Debug.Print(Mainboard.MainboardVersion);

            _timer = new GT.Timer(500);
            _timer.Tick += new GT.Timer.TickEventHandler(_timer_Tick);

            buttonForMountaineer.ButtonPressed += new ButtonForMountaineer.ButtonEventHandler(buttonForMountaineer_ButtonPressed);

        }

        void buttonForMountaineer_ButtonPressed(ButtonForMountaineer sender, ButtonForMountaineer.ButtonState state)
        {
            if (_timer.IsRunning)
            {
                _timer.Stop();
            }
            else
            {
                _timer.Start();
            }
        }

        void _timer_Tick(GT.Timer timer)
        {
            _flash = !_flash;
            Mainboard.SetDebugLED(_flash);
        }
    }
}

So I’m thinking its something in the QFE2 firmware or something I’ve done to the firmware.

Tho can safely ignore it. I think this is related to EWR.

I’ve also tried to update my Mountaineer to use NETMF 4.2 QFE2 according to the Mountaineer document “Mountaineer Firmware and USB Driver Installation Guide for NETMF 4.2 QFE2” I had to refer to some of the other posts on this forum to get it to work but now I’m at the same place Duke is. I get

This device cannot start. (Code 10)

when I plug my Mountaineer USB in and can’t make any progress downloading programs. However, like Duke,

" if I if I press the reset button and then hold down the other button, the LED starts to flash blue and it connects"

I’m afraid I’m not knowledgeable enough to understand the instructions above in order to fix the problem as Duke did. How do I use “TinyBooter, to erase the deployment sectors and then run the TinyClr again”?

Thanks for the help - Gene

@ Gene -

Please hold down the SW button while doing a RESET, then the board will remain in TinyBooter and do the blue blinking.
Then use MFDeploy (“Device” set to “USB”) and click on the “Ping” button. Now you should see something like this:

Pinging… TinyBooter
Bootloader build info: Copyright Oberon microsystems, Inc.

Now click on the “Erase” button. In the dialog box that pops up, click on the “Erase” button. After a while, it disappears again, and the old application has been removed (it may be the cause of the problem).

If you now reset again, without holding down the SW button, then you should be able to again Ping the device in MFDeploy, or deploy a new program from Visual Studio (after closing MFUpdate; MFUpdate and Visual Studio cannot have open connections to the same device simultaneously).

Cuno

Well I’m much closer but not quite there yet. The problem might be very simple and is probably related to my not understanding how to set up a Visual Studio project for the Mountaineer. I got the Mountaineer into TinyBooter and used MFDeploy as you described. It all seemed to work OK with one small difference. When I pinged, the response was

Pinging…TinyBooter

and that was all, nothing about Bootloader build info like you suggested.

At this point, the Mountaineer board seems to register as a USB device on my PC correctly when I push the Mountaineer reset button, at least I don’t get any error messages and the PC Device Manager shows a “Mountaineer USB” under USB controllers without the little yellow warning triangle it used to have. I’m pretty sure I’m doing something dumb (or not doing something basic) in my code. My Visual Studio program compiles and downloads but I get the following message in the VS output window

[em]Found debugger!

Create TS.

Loading start at 8045758, end 80589dc

Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: System.Xml (4.2.0.0)
Loading Deployment Assemblies.

Attaching deployed file.

Assembly: AnalogOutput (4.2.0.0) Attaching deployed file.

Assembly: MountaineerDigitalIO (1.0.0.0) Attaching deployed file.

Assembly: Mountaineer.Gadgeteer.MountaineerUsb (4.2.0.0) Resolving.

Link failure: some assembly references cannot be resolved!!

Assembly: Mountaineer.Gadgeteer.MountaineerUsb (4.2.0.0) needs assembly ‘Gadgeteer’ (2.42.0.0)

Error: a3000000

Waiting for debug commands…

The program ‘[3] Micro Framework application: Managed’ has exited with code 0 (0x0). [/em]

In my VS project, I have references to Microsoft.SPOT.Hardware, Microsoft.SPOT.Native, Mountaineer.Gadgeteer.Mountaineer.Usb and mscorlib. I’ve included a “using Mountaineer.Gadgeteer” in my code.

I’ve included the little test program I’m using to blink and LED for my initial test. It is a basic .NETMF project not a Gadgeteer project. By the way, can you confirm (Cpu.Pin)75 is the LED on the Mountaineer USB?

using System;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

using Mountaineer.Gadgeteer;

namespace MFConsoleApplication1
{
    public class Program
    {
        public static void Main()
        {
            Debug.Print("\r\nStarting Program ... \r\n");

            OutputPort LED;

            while (true)
            {
                LED = new OutputPort((Cpu.Pin)75, true);
                Thread.Sleep(200);
                LED = new OutputPort((Cpu.Pin)75, false);
            }
        }
    }
}

Many thanks for all the help.

No, I thought that might be the issue but I don’t see “Gadgeteer” or anything with “Gadgeteer” in the name in the list of references I can add except for the "Mountaineer.Gadgeteer.MountaineerUSB (and the same one for the Eth) that I already added. Is there something I haven’t installed or installed incorrectly?

No, I don’t see any of the References you show in your screenshot. Clearly, I haven’t installed something but I’m not sure what. My Control Panel -> Programs shows

Microsoft .NET Gadgeteer Core
Microsoft. .NET Micro Framework SDK 4.2 QFE2
Mountaineer SDK for Microsoft .NET Gadgeteer
GHI .NET Gadgeteer SDK
GHI NETMF USB Drivers
GHI OSHW NETMF v4.2 SDK
GHI Premium NETMF v4.2 SDK

Maybe I should re-install the Mountaineer SDK?

This is very strange.

  1. I un-installed and re-installed the GHI Software package and went through all the steps except the last step where is wants to update the firmware on my Spider board. I did that when I first set up everything and now I’m using the Mountaineer so it shouldn’t matter. - No joy

  2. I downloaded and installed the core from the link you provided - No joy

  3. I un-installed, downloaded and re-installed the Mountaineer SDK - No joy.

I"ve re-booted several times along the way but I’m just not seeing the references you showed in your screen shot, and I obviously need for the Mountaineer, in the list of references I can add.

Not sure what to do next, but I’m not giving up yet.

I think I mentioned this is a .NETMF project, not a Gadgeteer project. However, if I start a new Gadgeteer project with the Mountaineer USB mainboard and a “button for Mountaineer” in the “Program.gadgeteer” window, I automatically get "Gadgeteer in my list of references. However, I sure don’t see it in my .NETMF project.

Have you tried to add the assembly file manually?

I’d love to give it a try, can you explain how?

I’m still totally confused as to why all the references Andre.M showed don’t show up in my .NETMF project, but if I can get it to work manually, that will still be a step forward.

Yes, “add a reference” and then the “browse”-tab and select Gadgeteer.dll.

You can find it here:
C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies.NET Micro Framework 4.2\Gadgeteer.dll

Gadgeteer isn’t showing up in my VS “Add Reference”-dialog aswell. After i select it manually, it works.

I have “.Net Micro Framework 4.2” selected.

Major progress but still not there yet.

I found the Gadgeteer.dll and added it manually as Miugemelo described. Yahoo, I can now download my project. However, I get the following error in my Output window. I get the error before the first line of my code executes. I’ve included my code at the bottom. If someone could point out my error, I’d greatly appreciate it.

Many, many thanks for all the help - Gene

[em]The debugging target runtime is loading the application assemblies and starting execution.
Ready.

‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\mscorlib.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Native.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.SerialPort.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.Usb.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.PWM.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.Xml.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Users\magene\Documents\Visual Studio 2010\Projects\MountaineerDigitalIO\MountaineerDigitalIO\bin\Debug\le\MountaineerDigitalIO.exe’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Graphics.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\The Mountaineer Group\Microsoft .NET Gadgeteer\Mainboards\MountaineerUsb\NETMF 4.2\le\AnalogOutput.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.TinyCore.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Net.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.IO.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.IO.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Gadgeteer\Core\Assemblies.NET Micro Framework 4.2\le\Gadgeteer.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\The Mountaineer Group\Microsoft .NET Gadgeteer\Mainboards\MountaineerUsb\NETMF 4.2\le\Mountaineer.Gadgeteer.MountaineerUsb.dll’, Symbols loaded.
A first chance exception of type ‘System.NotSupportedException’ occurred in Microsoft.SPOT.IO.dll
The thread ‘’ (0x2) has exited with code 0 (0x0).
[/em]

using System;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

using Mountaineer.Gadgeteer;

namespace MFConsoleApplication1
{
    public class Program
    {
        public static void Main()
        {
            Debug.Print("\r\nStarting Program ... \r\n");

            OutputPort LED;
            LED = new OutputPort((Cpu.Pin)75, false);
            
            while (true)
            {
                LED = new OutputPort((Cpu.Pin)75, true);
                Thread.Sleep(200);
                LED = new OutputPort((Cpu.Pin)75, false);
            }
        }
    }
}