Arduino Forum

Products => MKR Boards => MKRZero => Topic started by: Protonerd on Oct 31, 2018, 02:42 pm

Title: Arduino MKZero COM port surfing - what could the reason?
Post by: Protonerd on Oct 31, 2018, 02:42 pm
I have an Arduino MKZero, I did some experimenting with it about a year ago (using IDE 1.6.10), with more or less success, but at least code upload worked fine (had to double tap the reset a few times to go back into bootload mode, but that was acceptable).

Now I returned to it, with a kind of new setup, using IDE 1.8.7. Since then the following happens: I find the MKZero on COMx. I upload code, at the end I hear the beep telling me somehow the connection to the board was lost. Then I try opening the Serial Monitor, without success, but in the Port list the MKZero is now assigned to COMy (i.e. another one). This game I can play forever, every time I want to upload I need to change back to COMx, then for Serial Monitor to COMy (at least that is what I observed, but it is kind of seemingly random COM port surfing).
I'm using the latest Board Manager version of the SAMD21 boards.

Any suggestions what I'm doing wrong?
Title: Re: Arduino MKZero COM port surfing - what could the reason?
Post by: ballscrewbob on Oct 31, 2018, 02:54 pm
The MKR boards have what amounts to TWO com ports.

The normal one you would see to start programming and a secondary one often referred to as BOOTLOADER.

You can force the bootloader by quickly double tapping the reset button which can be very useful with an errant sketch. That allows you in almost all cases to take back control of the board.

Normally during an upload it will often change the port to the bootloader one and once the upload is complete then revert back to the original port.

Does that describe what you are seeing ?

EDIT.
BTW with so many posts under your belt finding the MKRZERO section should have been quite easy ;)
Title: Re: Arduino MKZero COM port surfing - what could the reason?
Post by: Protonerd on Nov 05, 2018, 09:05 am
Hi ballscrewbob, your description fits to the one I provided, thanks. However it still does not explain:
- why I did not experience this nuisance working with an older IDE
- if it is the desired behaviour at all. It is a major pain to work like that. Is there anything what can be improved here? I definitely do not want this PORT hopping and I also do not see the reason for it.

Ps.: thanks for the hint about the MKZERO topics, is there a dedicated forum section for it?
Title: Re: Arduino MKZero COM port surfing - what could the reason?
Post by: ballscrewbob on Nov 05, 2018, 09:34 am
Not sure why you didnt see this with an older IDE as thats how it has always been.
In fact for the MKR1000 it used to be worse  until a firmware upgrade. There is not one for the MKRZERO as it operate differently and does not have the WiFi etc.

Sometimes the computer hardware seems to come into play too as XP took longer between the swapping (noticeable) and CREATE editor seems quickest, but doesnt work well on XP ?!?!?!?

LOL I moved you here to the MKRzero section..
Title: Re: Arduino MKZero COM port surfing - what could the reason?
Post by: Bushedo on Mar 16, 2019, 03:26 am
I believe the last post describes the reason behind the shift in serial ports that I have been seeing while programming the third of three MKR Zeros I have.  The first two presented on real problems, but the newest one has.  The board seems to accept the code, but as soon as upload is complete, the comm port changes and the ability to use the serial port for debugging is lost.  Re-selecting the original comm port doesn't establish communication from the board.  Curiously, a few example programs do work with serial.print despite a warning from the IDE that no board can be found on that port.  Also, the buttons are grayed out on the serial monitor window as if it isn't recognized, but the information from the RTC example still prints.  Hope someone can tell me how to get around the problem.  BTW: I am using the latest core (1.6.19) for the board and the latest IDE version 1.8.8.
Title: Re: Arduino MKZero COM port surfing - what could the reason?
Post by: Juraj on Mar 16, 2019, 06:35 am
I believe the last post describes the reason behind the shift in serial ports that I have been seeing while programming the third of three MKR Zeros I have.  The first two presented on real problems, but the newest one has.  The board seems to accept the code, but as soon as upload is complete, the comm port changes and the ability to use the serial port for debugging is lost.  Re-selecting the original comm port doesn't establish communication from the board.  Curiously, a few example programs do work with serial.print despite a warning from the IDE that no board can be found on that port.  Also, the buttons are grayed out on the serial monitor window as if it isn't recognized, but the information from the RTC example still prints.  Hope someone can tell me how to get around the problem.  BTW: I am using the latest core (1.6.19) for the board and the latest IDE version 1.8.8.
while (!Serial); waits for the com port connection (until you open the Serial Monitor on the new port). without it the sketch runs, but should print from loop()
Title: Re: Arduino MKZero COM port surfing - what could the reason?
Post by: Bushedo on Mar 20, 2019, 12:33 am
juraj,

Thanks for the tip.  Seems to have cured my problem.