Serial port changes after every upload?

I received my pre-ordered Arduboy last weekend (yay!) and spent a little time with the built-in game, then tried building and uploading the examples. I ran into issues with SPI.h not being found, but updating from Arduino 1.6.5 to 1.6.11 (but not 1.6.12 in order to maintain Teensyduino compatibility!) fixed that problem right away.
Tonight I was ready to get stuck in to some proper Arduboy dev, but ran into a very strange problem, where saving my .ino file (with no significant changes to the default code) somehow caused Arduino to lock up and require a Force Quit (I’m on OS X 10.11.4) - and what was bizarre is that I couldn’t get Arduino to run again at all after that, even after extensive attempts at manually kill -9ing processes etc. - so I had to restart (in fact, force shutdown!).
None of that was an Arduboy problem though I don’t think… The Arduboy problem came after all of that unpleasantness, when I started actually working on a “Hello World”-type sketch and uploading regularly as I iterated. Each time, the Leonardo port would increment by 2, and thus require re-selection with each upload. When I first noticed this, I was on /dev/cu.usbmodem7 - I’m currently on /dev/cu.usbmodem47 - any ideas as to what could be causing this? It happens with the examples as well as my code, although I don’t think the code has anything to do with it obviously. I’m using my own mUSB cable because the included one didn’t want to work after the reboot, although I had been using it before (though only to charge, due to aforementioned issues getting Arduino to work at all!).
Thanks for any ideas or suggestions - having to re-select the port each time is rather cramping my iteration cycle! :slight_smile:

Update: it looks like removing and re-inserting the mUSB cable causes the port to increment by 1, vs, the double increment during flash and re-connect! :confused:

Unfortunately, I think this maybe an issue from the operating system since it has control over what TTY /CU paths are assigned when USB devices are connnected and not the Arduino IDE. Luckily, you are not seeing a unassignment when you are midway through installing a game. Windows can have this problem, but the Arduino IDE can compensate for that.

Thanks! For now I’ve switched to building from the CLI since it’s slightly more convenient for me to tweak the port from the keyboard each time vs. poking around in menus; here’s how, if anyone else would like to use it:

/Applications/Arduino_1_6_11.app/Contents/MacOS/Arduino --upload ~/Documents/Arduino/HelloArduboy/HelloArduboy.ino --board arduino:avr:leonardo --port /dev/cu.usbmodem96
(just keep adding two to that port number at the end each time you upload)

I’ve used this machine for plenty of other Arduino development, though mostly with 168/328/ARM - I think this might be the first 32u4 board I’ve used; looks like the issue is not unprecedented with that MCU:

I’ll give it a try on some other machines to see what happens there and report back! :slight_smile:

Aaaaand today it’s working normally/maintaining a constant port… ¯\_(ツ)_/¯ Silver lining: I still get to use the Sublime Text Arduboy build system that I set up as a workaround… :metal: :stuck_out_tongue_closed_eyes: :metal:

3 Likes