Main Site Documentation

System.NotSupportedException - GHI.OSHW.Hardware.dll - FEZ Cerb40


#1

This is the new topic I am starting from my previous topic from General Discussion --> Missing Templates " Console Application".

I am getting error " An unhandled exception of type ‘System.NotSupportedException’ occurred in GHI.OSHW.Hardware.dll"

I am using FEZ Cerb40 to program the PIN PA0 and able to program succesfully.

My question is is the the correct dll for Cerb40 and is the any updates required for solve this exception?

using System;
using Microsoft.SPOT;
using System.Threading;
using Microsoft.SPOT.Hardware;
using GHI.OSHW.Hardware;

namespace MFConsoleApplication8
{
public class Program
{
public static void Main()
{

       OutputPort LED;        
      LED = new OutputPort((Cpu.Pin)FEZCerberus.Pin.PA0, true);
      Thread.Sleep(Timeout.Infinite);

  }

}
}


#2

Using code tags will make your post more readable. This can be done in two ways:[ol]
Click the “101010” icon and paste your code between the

 tags or...
Select the code within your post and click the "101010" icon.[/ol]
(Generated by QuickReply)

Click the pencil to edit your post; highlight the code; hit the 101010 button; Submit again.

#3

Please see “important note” here http://wiki.tinyclr.com/index.php?title=FEZ_Cerberus_Developer


#4

Now onto your problem. There is a known issue in the current beta firmware / SDK that throws this exception, that you can ignore. What is your code not doing?

Edit: Gus beat me, and it’s not related to the beta, it’s a NETMF thing… see up above :slight_smile:


#5

To my next question is this " GHI.OSHW.Hardware.dll" the correct dll for cerb40. I don’t see anywhere specific information on dll to use for the cerb40.


#6

any board that bares the OSHW logo should only use the OSHW dlls


#7

Thanks for the info.


#8

Using code tags will make your post more readable. This can be done in two ways:[ol]
Click the “101010” icon and paste your code between the

 tags or...
Select the code within your post and click the "101010" icon.[/ol]
(Generated by QuickReply)

#9

Your question is missing one or more of these details:[ul]
The name of the product.
The code you’re trying to run.
Details on your setup.[/ul]
(Generated by QuickReply)


#10

Concluding this topic and to answer Brett’s question, I am trying to test all the port on the cerb40 and have succesfully tested all the ports ( PB5, PB6, PB7, PB8, PC12, PD2, PB3, PB9, PB4, PC11, PA14, PC10, PA6, PA7, PA13, PA8, PC0, PC1, PC2, PC3, PA0, PA1, PA2, PA3, PA4, PA5, PB10, PB11, PB14, PB15, PC6, PC7, PC8 and PC9).

Example code is

pinOut = new OutputPort((Cpu.Pin)FEZCerberus.Pin.PB5, true);

The exception occured is

Uncaught exception
An unhandled exception of type ‘System.NotSupportedException’ occurred in GHI.OSHW.Hardware.dll


#11

It is normal to see that on current firmware. Please see my last reply


#12

Nila,

What is the firmware version that you are running? Try to completely erase the Cerb40 and flash with the most current version of the firmware (4.2.2.0) that is available here: http://www.tinyclr.com/forum/topic?id=7982

The code snippet that you provided was tested and that exception was not raised. Here is the exact code that was tested:


using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHI.OSHW.Hardware;

namespace Cerb40NotSupportedExceptionTester
{
    public class Program
    {
        public static void Main()
        {
            OutputPort LED;
            LED = new OutputPort((Cpu.Pin)FEZCerberus.Pin.PA0, true);
            Debug.Print(
                Resources.GetString(Resources.StringResources.String1));
            Thread.Sleep(Timeout.Infinite);
        }

    }
}

This is the output:

The Cerb40 that was used has the power regulator onboard and headers to plug into a breadboard.


#13

I am not sure what version of the current but I have successfully updated the firmware and tried to program, finally no exceptions !!!

Thanks for your help, Aron.

Create TS.

Loading start at 806e0e8, end 809661c

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.Graphics (4.2.0.0)Assembly: Microsoft.SPOT.TinyCore (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0)Assembly: Microsoft.SPOT.IO (4.2.0.0)
Assembly: System.IO (4.2.0.0)Assembly: Microsoft.SPOT.Hardware.OneWire (4.2.0.0)Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)Assembly: Microsoft.SPOT.Net (4.2.0.0)
Assembly: System (4.2.0.0)Loading Deployment Assemblies.

Attaching deployed file.

Assembly: GHI.OSHW.Hardware (4.2.2.0)Attaching deployed file.

Assembly: GHI.OSHW.Native (4.2.2.0)Attaching deployed file.

Assembly: Cerb40_Exception_Test (1.0.0.0)Resolving.

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

‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\mscorlib.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Native.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Graphics.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.TinyCore.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\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 (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.IO.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.IO.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.OneWire.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\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 (x86)\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 (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Net.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI OSHW NETMF v4.2 SDK\Assemblies\le\GHI.OSHW.Hardware.dll’
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI OSHW NETMF v4.2 SDK\Assemblies\le\GHI.OSHW.Native.dll’
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘c:\my documents\visual studio 2010\Projects\Cerb40_Exception_Test\Cerb40_Exception_Test\bin\Debug\le\Cerb40_Exception_Test.exe’, Symbols loaded.
The thread ‘’ (0x2) has exited with code 0 (0x0).
Hello World!
The thread ‘’ (0x1) has exited with code 0 (0x0).
Done.

Waiting for debug commands…

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


#14

Now the firmware is updated, how do I check the firmware version?

Next I programmed the cerb40 pwm output channel PWM_0 with code as below;

Microsoft.SPOT.Hardware.PWM servo = new Microsoft.SPOT.Hardware.PWM(Cpu.PWMChannel.PWM_0, 20000, 1500, PWM.ScaleFactor.Microseconds, false);

And result is having PB5, PB6, PB7, PB4, and PA13 having 3.3V except no oscillation on pin PA8 this time.

Prior to update the firmware I got different result which I posted in topic " Cerb40 digital out and pwm pins"

Are these pins suppose to be “LOW” when programmed for pwm output on other channels?


#15

mfdeploy, select USB, then Device Capabilities (Target menu)


#16

Just realized that I am having the older version of mfdeploy but I found the newer version in

Program Files > Microsoft.NET Micro Framework > v4.2 > Tools > MFDeploy


#17

My next question forwarding to GHI team, I programmed cer40 for pwm_0 ( PC6) but other pins PB5, PB6, PB7, PB4, and PA13 having 3.3V. Are these pins supposed to be LOW. Please refer to the picture attached. Firmware updated and MFDeploy says " SolutionReleaseInfo.solutionVersion : 4.2.2.0", I suppose the firware version is 4.2.2.0 .


#18

All pins on all our boards are defaulted to inputs with weak pull up resistor


#19

If all pins, but only certain number of pins seems to be having logic high. Probably good idea to initialize/program to low the affected pins in case they are connected.


#20

Hi. I got my Cerb40 two months ago and I believe I have the latest of everything (FW build in May, GHI.OSHW.Hardware.dll version 4.2.3.0), but I am getting the same exception if I add the reference to the GHI.OSHW.Hardware.dll library. It works fine if I only use the Microsoft .NETMF stuffs (analog input, e.g.)

Any clue?

Thanks!


Loading start at 802d938, end 8041f6c

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.Graphics (4.2.0.0)Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0)
Assembly: Microsoft.SPOT.Net (4.2.0.0)Assembly: System (4.2.0.0)Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)Loading Deployment Assemblies.

Attaching deployed file.

Assembly: MFConsoleLEDBlink (1.0.0.0)Attaching deployed file.

Assembly: GHI.OSHW.Hardware (4.2.3.0)Resolving.

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

‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\mscorlib.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Native.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Graphics.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\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 (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Net.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\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 (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.PWM.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\RT-PCR\Instruments\MCP\GHI\Software\MFConsoleLEDBlink\MFConsoleLEDBlink\bin\Debug\le\MFConsoleLEDBlink.exe’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI OSHW NETMF v4.2 SDK\Assemblies\le\GHI.OSHW.Hardware.dll’
A first chance exception of type ‘System.NotImplementedException’ occurred in Microsoft.SPOT.Native.dll
An unhandled exception of type ‘System.NotSupportedException’ occurred in GHI.OSHW.Hardware.dll