0

ItsyBitsy M4 COM port keeps changing
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ItsyBitsy M4 COM port keeps changing

by graynomad on Wed Jun 09, 2021 7:08 am

I just got an M4 ItsyBitsy yesterday and was well impressed with how things pretty much just worked with Visual Studio Code and PlatformIO. All day the board sat on COM8 no problems and downloading worked almost every time with the occasional reset required.

Today is a totally different story.

Half the time the board shows as both COM5 and COM6 and an explorer window pops up on a volume called ITSYM4BOOT. Then the downloader tries to download to COM6 and fails.

So I add "upload_port = COM5" to the ini file, try again and the download works.

But now the board reboots and pops up as COM8.

Now I change to ini file back to upload_port = COM8 thinking "Oh well, maybe that happens only on the the first time", but no, if I do a second download the boards resets to COM5 and 6 and because I now have 8 in the ini file the download fails yet again. If I remove the upload_port directive in the ini file it always tries to download to COM6 which always fails because 5 and 8 seem to be the valid ports, I'm guessing that 6 is the ITSYM4BOOT volume.

So I got smart and thought I'd try upload_port[58], nope, it still wants to use COM6.

This now seems to be a permanent cycle that makes the board unusable, and after such a great start yesterday.

Any ideas?

Rob

graynomad
 
Posts: 7
Joined: Thu Sep 22, 2011 5:32 am

Re: ItsyBitsy M4 COM port keeps changing

by blnkjns on Wed Jun 09, 2021 7:14 am

I think there is a bug in the USB stack of the M4 boards. I see something similar on my Macs, yet it is different. My board does refresh and mount as a new drive all the time (up to 30 show up in the Finder), yet it does not give much problems on the Mac, as they all get the same name.

blnkjns
 
Posts: 663
Joined: Fri Oct 02, 2020 3:33 am

Re: ItsyBitsy M4 COM port keeps changing

by graynomad on Thu Jun 10, 2021 9:02 am

It's a shame, I had high hopes for this board and in fact had already designed a base board and was starting on a system of IO extension boards for it.

But as it stands it's unusable.

Rob

graynomad
 
Posts: 7
Joined: Thu Sep 22, 2011 5:32 am

Re: ItsyBitsy M4 COM port keeps changing

by graynomad on Thu Jun 10, 2021 8:14 pm

Anyone from Adafruit out there?

graynomad
 
Posts: 7
Joined: Thu Sep 22, 2011 5:32 am

Re: ItsyBitsy M4 COM port keeps changing

by adafruit_support_mike on Thu Jun 10, 2021 9:55 pm

That's normal behavior on Windows systems, and we have no control over it.

Every USB device has to identify itself when it connects to a computer. It uses the reply to configure the USB connection, find drivers, etc. That process takes time, so all OSes store the configurations for devices they've seen before. On Windows, those are COM ports.

The microcontroller's bootloader needs a USB Serial connection to upload new firmware, then it has to shut that connection down before passing control to the newly loaded code. If the user code wants to make a Serial connection (or a HID connection), it has to negotiate a new connection with the computer.

Windows sees that as one device being disconnected, and another device being connected. There's no reason to assume the connections will have all the same settings, so Windows assigns two different COM ports.

Sometimes the computer doesn't know if a new connection is a microcontroller it's seen before, so it gives that connection a new COM port.

All those decisions are made by the Windows USB code, which is completely outside our control.

adafruit_support_mike
 
Posts: 63052
Joined: Thu Feb 11, 2010 2:51 pm

Re: ItsyBitsy M4 COM port keeps changing

by graynomad on Fri Jun 11, 2021 7:57 am

The first day I had the board it sat happily on COM8 all day. It's only the next day and on that I've had this problem. Plus I've used other USB-type Arduino clones before and never seen this issue.

If the user code wants to make a Serial connection (or a HID connection), it has to negotiate a new connection with the computer.

At this point I do not use Serial so pretty sure I'm not opening a new connection, unless something in the libraries is doing so.

Do all your M4 customers have the same problem? Is there a work around?

graynomad
 
Posts: 7
Joined: Thu Sep 22, 2011 5:32 am

Re: ItsyBitsy M4 COM port keeps changing

by adafruit_support_mike on Fri Jun 11, 2021 8:48 pm

graynomad wrote:The first day I had the board it sat happily on COM8 all day.

We have a few hundred thousand boards worth of field data that show port hopping is normal.

graynomad wrote:Do all your M4 customers have the same problem?

Yes.

graynomad wrote:Is there a work around?

Not that we've ever found. It happens on Windows, MacOS, and Linux.

adafruit_support_mike
 
Posts: 63052
Joined: Thu Feb 11, 2010 2:51 pm

Re: ItsyBitsy M4 COM port keeps changing

by graynomad on Wed Jun 16, 2021 10:04 pm

I have a sort-of work around.

If I double-tap the reset button it always boots up on COM5 and COM6 with 6 being the drive and 5 being the bootloader.

This is slightly annoying but no big deal and has been reliable for a couple of days now, so I'll go with that, at least until I can get an emulator/debugger to work.

graynomad
 
Posts: 7
Joined: Thu Sep 22, 2011 5:32 am

Please be positive and constructive with your questions and comments.