Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Write to COM1 invokes bootloader


  • Please log in to reply
4 replies to this topic

#1 Dan Watts

Dan Watts

    New Member

  • Members
  • Pip
  • 4 posts

Posted 26 December 2010 - 06:24 PM

A strange problem has begun to occur on my Netduino. I can't find any other references to this problem on the forum, so it's likely some obscure form of hardware damage. However, perhaps someone can suggest a fix or workaround.

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.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 26 December 2010 - 08:21 PM

Hi Dan, That is a really obscure one! Have you tried erasing the Netduino completely (connecting the 3.3V header to the ERASE pad) and then reflashing both the TinyBooterDecompressor (using SAM-BA) and the firmware using v4.1.0.5? Also, does this problem occur with nothing plugged into the Netduino other than the USB cable? Chris

#3 Dan Watts

Dan Watts

    New Member

  • Members
  • Pip
  • 4 posts

Posted 26 December 2010 - 09:42 PM

Hi Chris, Thanks for the quick reply. (And on a Sunday. And on Boxing Day here in Canada, eh). Yes, the problem does occur with just the USB cable plugged in - no DC power and nothing inserted into any header pins. It also occurs when just on DC power, with no USB cable. I noticed that if I plug in the Netduino with MFDeploy running, then Ping the Netduino, MFDeploy logs the "COM1 Opened" Debug.Print message. Also, the blue LED flickers every 5 seconds or so. I suspect that the Netduino is repeatedly booting, hitting that Write statement for COM1, then rebooting. My original guess about the blue LED indicating the bootloader being run might be off the mark. I'll try your suggestion about reflashing TinyBooterDecompressor once I figure out how to use SAM-BA. But for now, off to do some Boxing with the family. :) Dan.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 26 December 2010 - 11:13 PM

It sounds like the call to write data is either asserting a fault in the core .NET MF firmware (which soft reboots the unit) or causing an electrical fault (which hard reboots the unit). If you open up the COM1 TX line as an OutputPort and Write "true" and "false" to it, does that casue the same issue? Chris

#5 Dan Watts

Dan Watts

    New Member

  • Members
  • Pip
  • 4 posts

Posted 28 December 2010 - 04:27 AM

Chris, I tried using D1 as an Output Port. The reboot occurs if I set its state to false, but not if I set its state to true. So, it looks like the proper description of my problem would be "Setting D1 low causes reboot". Not really a COM port or bootloader problem after all. Probably still an obscure result of hardware damage - maybe I managed to fry the internal resistor on that pin? Dan.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.