Options for updating Netduino Plus software from a windows app?
#1
Posted 29 January 2012 - 01:24 AM
#2
Posted 29 January 2012 - 12:22 PM
I'm just thinking out loud here, but perhaps you could have the app:
- use the comm port as its debug port
- wait a few seconds after boot before it opens up that comm port
- at runtime, listen for a command which causes the app to reboot the board
Then you could use MFDeployEngine in your Windows app. You'd send the "reset" command via the COM port and then switch to using MFDeployEngine. With MFDeployEngine, you'd then erase your current app and deploy a new one. Finally, you'd issue a reboot CLR command to restart your app again.
If you need an example of MFDeployEngine using serial, download the custom MFDeploy app from our Mono (Linux/Mac) forums. You can just pull the appropriate code into your app...
Does that help?
Chris
#3
Posted 29 January 2012 - 01:22 PM
#4
Posted 29 January 2012 - 08:56 PM
You'll need to use the comm port as its debug port. If you grab the special version of MFDeploy we wrote, it'll have an option to "change deployment transport" to one of the serial ports.Chris,
That sounds like a good working solution. So I guess I should then be able to comment out my port code (so there is no port open on the netduino) and use MFDeploy to update the software via Comm port. This doesn't seem to work. It first says "Connecting to Device..." then "Connecting to TinyBooter..."
Any thoughts?
Once you can successfully deploy-and-debug via serial, the rest should be fairly straightforward...
Did I answer your question correctly? Or just make things more confusing?
Chris
#5
Posted 29 January 2012 - 09:25 PM
#6
Posted 31 January 2012 - 06:41 AM
#7
Posted 31 January 2012 - 06:52 AM
Are you sure that your app has taken over the COM port at that point (and consequently disabled the debug stream)?Here's the problem I found... I have used MFDeploy to Change the deployment transport to "Com1". I can then deploy and debug without an issue. The problem arises when I try to establish serial communications between my windows app and the netduino. When I send it data, I seem to get a large bucket is mis-sized data back.
What data are you getting back in your mis-sized data? Is it Debug.Print statements by any chance?
Chris
#8
Posted 31 January 2012 - 07:25 AM
Are you sure that your app has taken over the COM port at that point (and consequently disabled the debug stream)?
What data are you getting back in your mis-sized data? Is it Debug.Print statements by any chance?
Chris
With no debugging stream open, my Netduino has a menu system, that I scroll down and choose "Update Software". This opens COM1 port and give's instructions to the user to click update on the Windows App. The first thing the windows app does is send a command down to turn the LCD backlight color from White to Red (this indicates we're connected) however I am getting data back to the windows app from the Netduino (which I shouldn't).
The data looks like this -> text = "SdbgV1\0|�ɹquC\0\0\0-\0\0 \0\0\0\0\0Data Received\r\nMSdbgV1\0��1��g��\0\0\0.\0\0 \0\0J\0\0"
Per your question, "Data Received" is a Debug.Print Statement.
#9
Posted 31 January 2012 - 08:49 AM
#10
Posted 31 January 2012 - 01:07 PM
Try commenting out your debug.print statements. Does that help?
The other data is debug wireline data...
Chris
After a little more digging here is what I see...
I commented it all out and no difference, but here is what I see from the Netduino end.
When Debug and Communication are using the same Com 1 Port, my received data event still gets fired when I send a single byte of numeric "2". I put an LCD Write at the very beginning of the method right after this code. bytes is showing as 0 (zero) whereas when debug is set for USB port, it shows the proper size. This is where it bombs out and apparently the data coming back is really exception data.
// Get the number of incoming bytes int bytes = port.BytesToRead;
Any thoughts why it would be a packet size of zero?
#11
Posted 31 January 2012 - 03:28 PM
#12
Posted 31 January 2012 - 03:39 PM
#13
Posted 01 February 2012 - 04:49 AM
Link to ADG772 Data Sheet
I am thinking about having the ADG772 be controlled by the Netduino and have menu selections on the Netduino corresponding to these modes (IE: "Software Update" and "Configuration"). Depending which you choose, it switches the external USB to either the onboard Netduino Plus USB or to the USB on the FTDI card.
In the end I am likely going to design a new circuit board so this can be built into it.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users