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

Debugging using RS232 Port


  • Please log in to reply
5 replies to this topic

#1 skpang

skpang

    Member

  • Members
  • PipPip
  • 19 posts
  • LocationUK

Posted 07 December 2010 - 07:29 PM

Two questions. 1) Does VC 2010 Express uses the DTR to reset the Mini? I'm using a USB to serial convertor and looking at the DTR when start the debug, it does not change. 2) Do I need to bring the RESET line low in order to start the debug? I press F5 to start the debugging but I get a message of "The debugging target is not in an intialized state; rebooting" then it hangs. I have to bring the RESET line low then release to start the debug. If stop the debug then press F5 again the debug starts ok. Only when I made a change to the code that I need to press the RESET. Should the RS232 debug be able to reset the Mini?

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 07 December 2010 - 09:35 PM

Hi skpang, The Netduino Mini auto-resets when code is deployed. The DTR line is used to force the Netduino Mini into "bootloader" mode during re-flashing (and if your app accidentally uses the debug serial port, you can use this feature to erase your current app). The RS232 connection should reset the Netduino Mini without any issues. Two questions: 1. What version of firmware are you running on your Netduino Mini? 2. Do you have a small sample app which you can share--and which reproduces this issue? Chris

#3 skpang

skpang

    Member

  • Members
  • PipPip
  • 19 posts
  • LocationUK

Posted 07 December 2010 - 11:59 PM

The Mini firmware is 4.1.0.0 is this the latest? I've got a scope on pin 3 of the Mini, the DTR line. It is normally about -6v, if I open the with Hyperterminal it changes to +6v so I know the connection is ok. I close Hyperterminal. In VC I press F5 but I don't see the DTR line changing, it is at -6v. The program is a simple blinky: // write your code here OutputPort led = new OutputPort(Pins.ONBOARD_LED, false); while (true) { led.Write(true); Thread.Sleep(250); led.Write(false); Thread.Sleep(250); } I'm using a FTDI USB to serial convertor.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 08 December 2010 - 02:07 AM

Hi skpang, The latest production firmware is v4.1.0.5. In MFDeploy, go to the Target menu and select the "Device Capabilities" option. This should list the firmware version. Also, try to disconnect the DTR line on your FTDI cable temporarily. Or set the DTR line to GND. We made some reboot-time timing changes to the Netduino firmware for v4.1.0.6 beta and v4.1.1.0 alpha which may help/hurt the situation. We've never seen a Mini which needed assistance rebooting...but we'd like to try to find a way to reproduce the situation and get it fixed for you ASAP. Chris

#5 skpang

skpang

    Member

  • Members
  • PipPip
  • 19 posts
  • LocationUK

Posted 08 December 2010 - 07:33 PM

Using MFDeploy it does show the firmware of v4.1.0.5. somehow I saw v4.1.0.0 from Hyperterminal. The very first time I start the debug I do see the DTR line toggle. It is asserted for about 8mS. I've got the LED blinking and if I change the code and run it again the DTR line doesn't change but the code does downloaded and run ok. All it is well. The problem really starts when I'm trying to use the TTL UART. I'm using the SerialPortHelp.cs from: http://forums.netdui...de-interpreter/ I've change the port to SerialPorts.COM1. I assumed COM1 is the TTL UART. My program is a simple: public static void Main() { SerialPortHelper serialPortHelper; OutputPort led = new OutputPort(Pins.GPIO_PIN_20, false); serialPortHelper = new SerialPortHelper(); serialPortHelper.PrintClear(); serialPortHelper.Print("Netduino Mini"); while (true) { led.Write(true); Thread.Sleep(50); led.Write(false); Thread.Sleep(150); } } The first time is running ok but if I make a change to the code and run it again, it won't go into debug unless I press the reset. It almost like the TTL UART is interfering with the RS232 port. Any ideas?

#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 09 December 2010 - 06:30 AM

Very interesting. There may be a pin protection issue or something locking the port on soft reboot. We'll pull the firmware into debug mode and see if we can track it down... Chris




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.