How to convert VS2010 C# app.exe -> *.hex; *.nmf ?

Oct 19, 2012 at 9:25 AM
Edited Oct 20, 2012 at 12:13 AM

I built a MFConsoleApplication1, e.g.

public static class Program
{
    static OutputPort _led1 = new OutputPort(Cpu.Pin.GPIO_Pin12, false);
    public static void Main()
    {
        _led1.Write(!_led1.Read()); while (true) ;
    }
}

but I can`t deploy it into flash (stm32f4 discovery) because MFDeploy requires hex or nmf format. Pls, advise a converter or something else. All other already work properly.

Oct 19, 2012 at 5:16 PM
Edited Oct 19, 2012 at 5:20 PM

So, I deployed my app using VS. Now, how to run the app, perhaps to click Clear bootloader flag ? But I not see any reaction, all leds still off.

Oct 19, 2012 at 8:30 PM

it starts automatically when you deploy it.

but i am sure your using the wrong pins.

the leds are:

OutputPort green = new OutputPort((Cpu.Pin)60, false);
OutputPort orange = new OutputPort((Cpu.Pin)61, false);
OutputPort red = new OutputPort((Cpu.Pin)62, false);
OutputPort blue = new OutputPort((Cpu.Pin)63, false);

also turning led on/off is not in the loop. use:

while(true)

{

blue.Write(!blue.Read())
System.Threading.Thread.Sleep(500); // 500 msec

}

Oct 22, 2012 at 4:59 AM
Edited Oct 22, 2012 at 5:00 AM

Thank you very much, you are right. I tried to blindly use all pins from 0 to 40+.

Oct 24, 2012 at 8:33 AM
VShaclein wrote:

Thank you very much, you are right. I tried to blindly use all pins from 0 to 40+.


You should also use the CPU.cs and HardwareProvider.cs that is provide with the STM32 package in NETMF 4.2 porting KIT. Using this class will make you stay far from errors because it directly override and inherit the standard NETMF HardwareProvider implementation !

For example, instead of using CPU.Pin.xxx, you will use STM32.Pins.P_A_0 and so on....

Those files are normally here : C:\MicroFrameworkPK_v4_2\DeviceCode\Targets\Native\STM32\ManagedCode\Hardware