Flash Magic Forum

In-System Programming Support => General => Topic started by: superkamiguru on August 21, 2014, 10:19:09 AM

Title: Anyone know how to change the Windows default COM settings for USB-Serial?
Post by: superkamiguru on August 21, 2014, 10:19:09 AM
We have a board with an NXP processor and an FTDI USB/UART chip. We designed it so that we could use FlashMagic to program the board using the handshake signals, and it works. The problem is, we do not want our board to reset every time the virtual com port is opened in software (other than FlashMagic) the first time after it has been plugged into the computer (DTR and RTS settings are retained thereafter, so it only affects the first open, but they are initially asserted on that first opening). Anyone know how to change this? I can't find anything on the web and so far FTDI has not been helpful. Their application note tells you how to disable the handshaking assertion when the device is first plugged in, but that setting does not change the behavior when the COM port is first opened up.
Title: Re: Anyone know how to change the Windows default COM settings for USB-Serial?
Post by: Andy Ayre on August 22, 2014, 01:16:04 AM
I'm not sure I am fully understanding but try the new setting in advanced options to completely disable DTR/RTS. That should stop the signals from changing at all, at any time. But then you can't use the signals to put the device into ISP mode.

Perhaps an alternative is to use the FM option to assert RTS all the time in your hardware in order to tell the difference between when FM is being used and when something else is being used?

Andy
Title: Re: Anyone know how to change the Windows default COM settings for USB-Serial?
Post by: superkamiguru on August 22, 2014, 08:32:12 AM
Hi Andy,

I don't have an option in the advanced options to disable DTR/RTS completely. There is an option to disable them on startup, which I use, but it doesn't affect their assertion when the port is first opened in software.

BTW the FTDI part is the FT231X.

I'll consider using the FlashMagic option that you mentioned, I just wanted to avoid a hardware change if possible.
Title: Re: Anyone know how to change the Windows default COM settings for USB-Serial?
Post by: Andy Ayre on August 22, 2014, 08:35:27 AM
What version are you using? The option was added in the latest version 8.18.

Andy
Title: Re: Anyone know how to change the Windows default COM settings for USB-Serial?
Post by: superkamiguru on August 22, 2014, 09:59:48 AM
I misunderstood your previous post, I thought you were referring to the VCP advanced options, not FM.

I WAS using version 7 something, but upgraded to 8.18 after reading your last post. I tried the advanced option to disable them completely, and here is what I'm getting:

On the very first open after plugging in the board, the lines are asserted and my board resets. I can do this by trying to read the device signature (which will fail, but is expected since I have it disabled). Every operation after that will NOT assert the control lines, so obviously FM is simply leaving those signals disabled when it closes the COM port. But that very first operation after a plug-in is still asserting the lines.

I don't know if this problem is solvable (with software). It may just be built in to Windows to assert those signals whenever the COM port is opened with default values. But I guess you guys should at least know that the option to disable those lines completely won't work on the first operation after a plug-in (at least for an FTDI device).
Title: Re: Anyone know how to change the Windows default COM settings for USB-Serial?
Post by: Andy Ayre on August 22, 2014, 10:02:44 AM
Hmmm... unfortunately FM is setting DTR/RTS to be disabled before the first open, so this must be something in Windows/FTDI driver. :(

Andy
Title: Re: Anyone know how to change the Windows default COM settings for USB-Serial?
Post by: superkamiguru on August 22, 2014, 11:42:58 AM
Out of curiosity, how does FM disable those signals before opening the COM port? The only way I know to do it is to use SetCommState, but that requires a handle which means the port has to already be opened from CreateFile.
Title: Re: Anyone know how to change the Windows default COM settings for USB-Serial?
Post by: Andy Ayre on August 22, 2014, 02:03:22 PM
Yes, that is how it is done. So I presume there is no opportunity to change the settings before CreateFile.

Andy