Hi. I´m having problems with my serial comunication in Netduino 2. I have the Netduino firmware 4.2.2 in the Netduino 2 and trying to develop in VS2012 with the 4.3 SDK. I can´t flash the 4.3 beta firmaware in Netduino 2 becouse it gets freezed.
The code is the next one:
public static void Main() { SerialPort com = new SerialPort(SecretLabs.NETMF.Hardware.Netduino.SerialPorts.COM1, 115200, Parity.None, 8, StopBits.One); string msg="Hi"; byte[] message; while (true) { Thread.Sleep(2000); message = Encoding.UTF8.GetBytes(msg); com.Write(message, 0, message.Length); }
And the error it gives:
An unhandled Exception of type "System.ArgumentException" ocurred in Microsoft.SPOT.Hardware.SerialPort
I know that is a versión or assembly compatibility problema, but how can I fix it????