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
ItsyBitsy M4 COM port keeps changing
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- blnkjns
- Posts: 963
- Joined: Fri Oct 02, 2020 3:33 am
Re: ItsyBitsy M4 COM port keeps changing
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.
- graynomad
- Posts: 7
- Joined: Thu Sep 22, 2011 5:32 am
Re: ItsyBitsy M4 COM port keeps changing
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
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
Anyone from Adafruit out there?
- adafruit_support_mike
- Posts: 67391
- Joined: Thu Feb 11, 2010 2:51 pm
Re: ItsyBitsy M4 COM port keeps changing
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.
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.
- graynomad
- Posts: 7
- Joined: Thu Sep 22, 2011 5:32 am
Re: ItsyBitsy M4 COM port keeps changing
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.
Do all your M4 customers have the same problem? Is there a work around?
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.If the user code wants to make a Serial connection (or a HID connection), it has to negotiate a new connection with the computer.
Do all your M4 customers have the same problem? Is there a work around?
- adafruit_support_mike
- Posts: 67391
- Joined: Thu Feb 11, 2010 2:51 pm
Re: ItsyBitsy M4 COM port keeps changing
We have a few hundred thousand boards worth of field data that show port hopping is normal.graynomad wrote:The first day I had the board it sat happily on COM8 all day.
Yes.graynomad wrote:Do all your M4 customers have the same problem?
Not that we've ever found. It happens on Windows, MacOS, and Linux.graynomad wrote:Is there a work around?
- graynomad
- Posts: 7
- Joined: Thu Sep 22, 2011 5:32 am
Re: ItsyBitsy M4 COM port keeps changing
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.
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.
Please be positive and constructive with your questions and comments.