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

Another weird experience, this time with the Plus 2


  • Please log in to reply
5 replies to this topic

#1 Dave M.

Dave M.

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 12 November 2012 - 02:23 AM

I decided to start working on a project and put my RS232 shield to good use. My first test was to just spit out "hello" on COM1. The code was pretty basic: I just created a SerialPort, opened it, and then used Write() to send the string in a tight loop. When I first ran the project, I had forgotten that it was set up to talk to the Netduino Plus, and not the Netduino Plus 2. Programming failed and the error message it had given me made sense (had something to do with not finding a Netduino Plus). I then changed to the Netduino Plus 2 and it downloaded the code fine, but then didn't seem to start running the project. Unfortunately, I didn't write down the error message and can't reproduce it. The upshot is that the code definitely got sent to the NP2 because upon reset, my terminal program showed my string getting blasted over the port continuously. However, now I can't reprogram the NP2 -- every time I plug it in, it just comes up as an Unknown Device. MFDEPLOY can't see it, either. I will probably resort to trying to reload the firmware after erasing via the erase pad, but I'd like to know how in the world what I did could have caused the NP2 to behave in this way.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 12 November 2012 - 02:30 AM

Hi Dave,

The upshot is that the code definitely got sent to the NP2 because upon reset, my terminal program showed my string getting blasted over the port continuously. However, now I can't reprogram the NP2 -- every time I plug it in, it just comes up as an Unknown Device. MFDEPLOY can't see it, either.

I will probably resort to trying to reload the firmware after erasing via the erase pad, but I'd like to know how in the world what I did could have caused the NP2 to behave in this way.

A few quick things:

1. There is no ERASE pad on the new Netduino Plus 2 and Netduino Go boards. To reflash you simply hold down the pushbutton while plugging in the board to put it into bootloader mode...and then run STDFU to erase the board and DFUSE to reflash the board. No risk of shocking your board with a stray wire. :)

2. You'll want to use the new "SecretLabs.NETMF.Hardware.Netduino.dll" hardware provider instead of the "SecretLabs.NETMF.Hardware.NetduinoPlus.dll" hardware provider from Netduino Plus 1. With the new firmware release there is only one provider used for both Netduino and Netduino Plus 2. If you try to deploy an old Netduino Plus application without switching out the hardware provider, it'll try using the old pins (some of which may overlap numberwise with the pins used by the USB port--which could cause your issue).

3. For now, please erase and reflash your board. Once you've verified that you have the correct HardwareProvider, let us know if you have any further troubles. If you're deploying an app which locks out Visual Studio, we'd like to take a look and see if there's anything we can do to prevent that.

Congrats on getting your new board!

Chris

#3 Dave M.

Dave M.

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 12 November 2012 - 05:04 AM

Hi Chris, thanks for the prompt response as usual!

I actually was using the new assembly -- I created a Netduino Plus 2 app, ran it on the NP2, then ran it on the NP, then ran it again on the NP2. The only thing I changed was the device in the Deployment properties between boards.

I'll give the reflashing a try and will let you know if weird stuff happens in VS2010!

Hi Dave,


A few quick things:

1. There is no ERASE pad on the new Netduino Plus 2 and Netduino Go boards. To reflash you simply hold down the pushbutton while plugging in the board to put it into bootloader mode...and then run STDFU to erase the board and DFUSE to reflash the board. No risk of shocking your board with a stray wire. :)

2. You'll want to use the new "SecretLabs.NETMF.Hardware.Netduino.dll" hardware provider instead of the "SecretLabs.NETMF.Hardware.NetduinoPlus.dll" hardware provider from Netduino Plus 1. With the new firmware release there is only one provider used for both Netduino and Netduino Plus 2. If you try to deploy an old Netduino Plus application without switching out the hardware provider, it'll try using the old pins (some of which may overlap numberwise with the pins used by the USB port--which could cause your issue).

3. For now, please erase and reflash your board. Once you've verified that you have the correct HardwareProvider, let us know if you have any further troubles. If you're deploying an app which locks out Visual Studio, we'd like to take a look and see if there's anything we can do to prevent that.

Congrats on getting your new board!

Chris



#4 Dave M.

Dave M.

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 12 November 2012 - 05:11 AM

Chris, I'm having a similar problem to what I had experienced with the Netduino Plus today. If the device comes up as unknown hardware in the windows device manager, then none of the applications can recognize it, thus it is impossible to flash. I had gotten lucky today with the N+, but with the N+2 I have plugged it in with the reset button down to enter bootloader mode, but then STDFU doesn't recognize it. I can't execute any of the steps outlined in your firmware upgrade instructions found here. Do you have any suggestions for me?

#5 Dave M.

Dave M.

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 12 November 2012 - 05:24 AM

By the way, here's the code that I ran on it that caused it to subsequently no longer respond...

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.IO.Ports;

namespace NetduinoPlus2Test
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
            Debug.Print( "It's working");

            OutputPort led = new OutputPort( Pins.ONBOARD_LED, false);
            SerialPort rs232 = new SerialPort( SerialPorts.COM1, 115200, Parity.None, 8, StopBits.One);

            rs232.Open();
            string msg = "Hello World\r\n";
            byte[] bytes = System.Text.Encoding.UTF8.GetBytes( msg);
                
            while( true) {
                led.Write( true);
                led.Write( false);
                // write serial data on COM1 with RS232 shield
                rs232.Write( bytes, 0, msg.Length);
            }
        }
    }
}


#6 Dave M.

Dave M.

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 12 November 2012 - 05:49 AM

Sorry for all of the posts -- crisis avoided. It's interesting how things start to work again after rebooting Windows. After bootup, it recognized the N+2 when in bootloader mode and I was able to reflash the firmware. I'm playing with it again in VS2010 now. Thanks!




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.