Bootloader gives error about serial port already being open. Linux and Windows

I’ve tried to upload an example sketch to my board under Windows through the Arduino IDE and Linux through arduino-cli. I’m using v 1.0.11 of the board support package. I get the following errors:

Windows:

Sketch uses 7392 bytes (0%) of program storage space. Maximum is 960000 bytes.


Artemis SVL Bootloader
COM1 is currently open. Please close any other terminal programs that may be using COM1 and try again.

Linux:

> arduino-cli -v upload --fqbn SparkFun:apollo3:amap3nano --port /dev/ttyUSB0 ./libraries/Examples/examples/Example8_BLE_LED


Artemis SVL Bootloader

phase:  setup
        cleared startup blip

phase:  bootload
/dev/ttyUSB0 is currently open. Please close any other terminal programs that may be using /dev/ttyUSB0 and try again.

Am I missing something?

User error on the windows side. I had the wrong COM port selected. Linux issues still remains.

Try this.

https://majenko.co.uk/blog/diagnosing-a … lems-linux

It turned out that I was seeing a combination of arduino-cli not copying the .bin file and artemis_svl giving confusing error messages. artemis_svl already had the port open when it did the phase: setup. Due to some unfortunate error handling logic, it was giving the serial error message when it was failing to open the .bin. I sent a PR (https://github.com/sparkfun/Arduino_Apollo3/pull/67) to clear up the the error messages and hacked my local arduino-cli to give me the bin file.