How to deploy over COM
#1
Posted 19 April 2012 - 08:34 PM
#2
Posted 20 April 2012 - 06:04 AM
There is a thread here if you want to switch to serial deploy to try out the USB HID method of USB communication.I want to try the USB communications examples, however it seems I have to deploy over COM for this.
I haven't got a clue where to start here and there seems to be little information on how it's done. Could anyone point me in the right direction?
If you want to use serial comms via USB then you do not need to change this. To do this you need a USB->Serial FTDI board or cable. These are relatively cheap and Proto-Pic stock both boards and cables. I use one of these to talk to the Netduino Mini - in this case I bought the 3.3V cable. These just appear as a COM port on the PC.
Regards,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#3
Posted 20 April 2012 - 10:01 AM
#4
Posted 20 April 2012 - 10:12 AM
I buy a serial to USB cable, download the MFDeploy (Extra) and use it to change the deployment mechanism. Plug the COM port to the USB on the Netduino, change VS2010 deployment options and go?
When it's deployed I can plug the USB back in and debug etc with it?
If you go down the serial deployment route then your debugging is also performed by serial. You will be using the USB as a HID device to talk to the application.
Unless I was specifically targeting a HID application, I'd probably keep the deployment transport as is and use the USB to serial lead to enable serial comms with the application. So, I'd be deploying and debugging by USB and then communicating by serial.
regards,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#5
Posted 20 April 2012 - 11:49 AM
#6
Posted 20 April 2012 - 11:57 AM
Main implication I have seen is speed. USB seems faster. I have a N+ and a Mini and deployment over USB is faster with the N+ than over serial with the Mini.Problem is, I only just saw the TLA, HID and whilst I know what a serial port is (in that I can point to it on my machine) I have no idea what the practicalities or implications are of deploying using it.
Regards,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#7
Posted 20 April 2012 - 01:23 PM
Main implication I have seen is speed. USB seems faster. I have a N+ and a Mini and deployment over USB is faster with the N+ than over serial with the Mini.
Regards,
Mark
Dev-wise, do I still get all my debugging functionality? i suppose I'd either have to connect to the process in VS2010, or do I need to reserve some pins for debugging... or do I have to hack something else together?
Cheers
Dave
#8
Posted 20 April 2012 - 04:42 PM
Not done this on the N+ but on the Mini you just tell VS to deploy by serial and you also get to debug by serial as well. No hacking etc. required. I cannot imagine that there would be anything different on the N+.Dev-wise, do I still get all my debugging functionality? i suppose I'd either have to connect to the process in VS2010, or do I need to reserve some pins for debugging... or do I have to hack something else together?
Regards,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#9
Posted 23 April 2012 - 10:10 AM
#10
Posted 23 April 2012 - 04:29 PM
There are two scenarios for using the USB connector on the Netduino:Hi Nevyn,
Thanks for all the advise. Just one more question, I think.
Assuming I buy a USB to COM converter, and then deploy over COM, as far as the N+ is concerned I'm still using the USB port for deployment, and I want to communicate over it (and debug, if possible). So I assume I'd unplug the COM and plug the USB -> USB back in after deployment?
Once I've done that (if I'm supposed to do that) how do I attach the debugger to the N+?
- Deployment and debugging
- HID device
USB for deployment and debugging
In this scenario you will be unable to deploy and debug using the USB connector AND have a HID device over USB. This is how the deployment works at the moment.
Use USB connector for HID application
You now dedicate the USB connector for HID communication between the Netduino and your application. You change the settings on the Netduino to tell it to accept deployment and debug commands over serial. You also change your settings in Visual Studio to deploy and debug over serial. The FTDI board effectively converts one of your USB ports on your PC into a COM port.
Personally, I'd look at how much data is being transferred and if it is reasonable then I'd look at using serial to communicate with the PC application. I've done this in the past (using Bluetooth) and it works fine. This has the advantage that you do not need to worry about changing deployment methods etc.
Regards,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#11
Posted 23 April 2012 - 11:54 PM
Notice you put Brizzletown down as you location, Maplins by the arches had some quote cheap usb to rs232 conververters last time i was in approx ~£10 for a dual port one, so might be worth a look
I can also recommend these leadsif you want a general purpose rs232 ports (i use the quad port one daily at work for everything from from flashing and driving POS printers, to doing direct TTL flashing of various MCU's, seems to have avoided the usual trap with these usb to rs232 leads of not providing enough voltage to flash properly.
If you go for the RS232 DB9 sockets make sure you get some Female DB9 sockets then you can solder on some wires (i find a bit of CAT5 network cable make a perfect lead) and either poke into the socket or if you plan on making a lot of use of the com interface (and your previous posts make me think you will if you want to do USB HID stuff) then making up a plug to go on the other end with some of these and some of these works very well (if you buy a crimper as well saves you a fortune in jump leads for bread boarding as well as you can use cheapo non solid core wire and just crimp a male plug on the end and get perfect connections everytime...)
#12
Posted 24 April 2012 - 10:43 PM
Would this fit the bill? USB to Serial Cable and USB Adapter.
#13
Posted 25 April 2012 - 06:35 AM
Bear in mind that if you buy this adapter you then need to get a serial to TTL convertor. I think in one thread you have looked at a USB to TTL convertor (i.e. FTDI). So this gives two options:Would this fit the bill? USB to Serial Cable
- USB to serial plus a serial to TTL convertor.
- USB to TTL convertor plus a USB lead (if you are lik me you have plenty of leads around the place)
Regards,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#14
Posted 19 November 2012 - 05:42 PM
#15
Posted 19 November 2012 - 06:43 PM
The MFDeploy in the .NET MF 4.2 QFE2 SDK works with WinUSB drivers under Windows 8.Is there an updated MFDeploy+ that uses the new WinUsb drivers? I would just use the NetMF ones but they don't seem to work on Windows 8!
The WinUSB driver links are configured by the Netduino 4.2.1 SDK installer.
Chris
#16
Posted 19 November 2012 - 06:47 PM
#17
Posted 19 November 2012 - 07:03 PM
Oh, sorry, I misunderstood the question. I haven't used COM deployment in NETMF 4.2, but I'm not aware of any reason why it wouldn't work. If it doesn't work for you, we definitely want to add support.But the MFDeploy that comes with the SDK doesn't have the Deployment Transport in the configuration menu as far as I can see. Am I missing something obvious? I'm wanting do deploy via COM by the way (using netmf 4.2).
Can you try adding SecretLabs.NETMF.Diagnostics.dll as a reference to your project? And then running the following line of code (deployed via WinUSB)?
SecretLabs.NETMF.Diagnostics.Transport.SetInterface(TransportInterface.Com1);Chris
#18
Posted 19 November 2012 - 08:07 PM
Can you try adding SecretLabs.NETMF.Diagnostics.dll as a reference to your project? And then running the following line of code (deployed via WinUSB)?
SecretLabs.NETMF.Diagnostics.Transport.SetInterface(TransportInterface.Com1);Chris
Done this, the N+ now has the ethernet lights and the blue LED flashing every 5 seconds and the USB device isn't recognised. I'm using a 3.3V TTL <-> Usb cable plugged into D3/4 (and ground), tried swapping the two around in case I had RX/TX the wrong way around but am unable to ping with MfDeploy either way.
#19
Posted 19 November 2012 - 09:18 PM
If USB is not recognized, that's a good thing. That means the transport has been moved.Done this, the N+ now has the ethernet lights and the blue LED flashing every 5 seconds and the USB device isn't recognised. I'm using a 3.3V TTL <-> Usb cable plugged into D3/4 (and ground), tried swapping the two around in case I had RX/TX the wrong way around but am unable to ping with MfDeploy either way.
Pins D3/D4 are SPI and PWM pins. Please try plugging your TTL->USB cable into pins D0/D1, for COM1.
COM1 = D0/D1
COM2 = D2/D3
COM3 = D7/D8 (Netduino Plus 2 + Shield Base only)
COM4 = SDA/SCL (Netduino Plus 2 only)
Does that get you connected alright?
Chris
#20
Posted 19 November 2012 - 10:18 PM
Does that get you connected alright?
Well it helps if the test program doesn't use the COM :-) I've managed to get a response in MFDeploy via serial but it just seems to be resetting constantly. This is the serial output:
DM9161_AutoNegotiate Valid PHY Found: 31 PHY: Vendor Number Model = 0xA PHY: Model Revision Number = 0x0 DM9161_DSCSR = 0xF3F0 DM9161_BMCR = 0x3100 DM9161_DSCR = 0x414 Error: AutoNegotiate TimeOut PHY AutoNegotiate ERROR! ip address from interface info: 192.168.5.100 .NetMF v4.2.0.0 NetduinoPlus, Build Date: Sep 19 2012 17:01:50 ARM Compiler version 410894 TinyCLR (Build 4.2.0.0) Starting... Created EE. Started HasÀ0¼qðCreate TS. Loading start at 1542e0, end 16c5dc Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Net (4.2.0.0) Assembly: System (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0) Assembly: Microsoft.SPOT.IO (4.2.0.0) Assembly: System.IO (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: SecretLabs.NETMF.Diagnostics (4.2.0.0) Loading Deployment Assemblies. Attaching deployed file. Assembly: NetduinoApplication1 (1.0.0.0) Attaching deployed file. Assembly: SecretLabs.NETMF.Hardware.NetduinoPlus (4.2.0.1) Resolving. Ready.
Then reset. The code is just:
Transport.SetInterface(TransportInterface.Com1); Thread.Sleep(Timeout.Infinite);
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users