When I write to COM1, the Netduino's blue LED lights up and Visual Studio displays "Found Debugger!". I think this means that it has rebooted and started the bootloader. Restarting the Netduino at this point just results in the bootloader being automatically launched again (i.e. blue light, and Visual Studio can't deploy t it) whether or not something is connected to the COM1 pins. The only way to get the Netduino to stop loading the bootloader is to run MFDeploy and click the Erase button.
An example of the code that causes this problem is below, but I'm pretty sure this isn't a problem with the software or the hardware connected to the serial pins since:
- The same code and hardware works normally with COM2
- I have a 2nd Netduino, and the same code and serial port hardware connection works normally with COM1 there
The code is:
static SerialPort UART; public static void Main() { // write your code here UART = new SerialPort(SecretLabs.NETMF.Hardware.Netduino.SerialPorts.COM1, 9600, Parity.None, 8, StopBits.One); UART.Open(); UART.DataReceived += new SerialDataReceivedEventHandler(UART_DataReceived); Debug.Print("COM1 Opened"); WriteToUART("Hello World\r\n"); Thread.Sleep(Timeout.Infinite); } private static void WriteToUART(String strData) { byte[] buffer = Encoding.UTF8.GetBytes(strData); UART.Write(buffer, 0, buffer.Length); // <---------- problem occurs here ------- }
I've tried using a few types of serial pin connections and the problem occurs with each. In each case, the same hardware setup works fine with COM2, or with COM1 on my other Netduino:
- Matrix Orbital serial LCD
- XBee serial connection
- FTDI serial connection to PC
I've tried reloading the Netduino firmware. Since I know 4.1 Update 5 added a serial debugging capability, I've also tried reloading Update 4. No change.
I've checked the Netduino pins for damage - nothing apparent. The other pins seem to be working OK. At one point I soldered a jumper between the AREF and 3.3V pins (it was later cut off). I've checked for solder bridges - nothing there. The problem occurs whether the Netduino is powered by the DC jack or USB.
Any ideas or suggestions?
Thanks,
Dan.