Error flashing board from web editor

Hi; when uploading the "blink" sketch to an Arduino MKR WiFi 1010, I got the following error:
"Executing commend: exec: not started"
Compilation went fine, I guess; but last command issued to my Windows 10 machine gives an error due to the fact -I think- that the folder name isn't escaped: note the "C:/Users/Alessandro LastName/AppData/..." at te beginning of the path, compared to "C:/Users/ALESSA~1/AppData/..." in the last part.

Moreover, even if I try to execute the command within a shell, another error occurs given that the path does not exists: in fact under C:/Users/ALESSA~1/.arduino-create/arduino/bossac/ I found the "1.7.0" folder (the correct one) and the "1.7.0-arduino3" file (which causes the path mess in the issued command).

Summarising: if I translate the issued command
C:/Users/Alessandro LastName/.arduino-create/arduino/bossac/1.7.0-arduino3/bossac.exe -i -d --port=COM14 -U true -i -e -w -v C:/Users/ALESSA~1/AppData/Local/Temp/arduino-create-agent897223482/Blink_copy.bin -R

to

C:/Users/ALESSA~1/.arduino-create/arduino/bossac/1.7.0/bossac.exe -i -d --port=COM14 -U true -i -e -w -v C:/Users/ALESSA~1/AppData/Local/Temp/arduino-create-agent742443738/Blink_copy.bin -R

the compiled sketch is loaded.
Many thanks in advance,
Alessandro.

== log transcription ==

/home/builder/opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware /home/builder/opt/arduino-builder/hardware -hardware /home/builder/.arduino15/packages -tools /home/builder/opt/arduino-builder/tools -tools /home/builder/.arduino15/packages -built-in-libraries /home/builder/opt/libraries/latest -logger humantags -fqbn arduino:samd:mkrwifi1010 -build-cache /tmp -build-path /tmp/260665628/build -verbose -prefs runtime.tools.arm-none-eabi-gcc.path=/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs runtime.tools.sketchUploader.path=/home/builder/.arduino15/packages/Intel/tools/sketchUploader/1.6.2+1.0 -prefs runtime.tools.arc-elf32.path=/home/builder/.arduino15/packages/Intel/tools/arc-elf32/1.6.9+1.0.1 -prefs runtime.tools.dfu-util.path=/home/builder/.arduino15/packages/arduino/tools/dfu-util/0.9.0-arduino1 -prefs runtime.tools.linuxuploader.path=/home/builder/.arduino15/packages/arduino/tools/linuxuploader/1.5.1 -prefs runtime.tools.arm-linux-gcc.path=/home/builder/.arduino15/packages/arduino/tools/arm-linux-gcc/4.9.3 -prefs runtime.tools.i586-poky-linux-uclibc.path=/home/builder/.arduino15/packages/Intel/tools/i586-poky-linux-uclibc/1.6.2+1.0 -prefs runtime.tools.openocd.path=/home/builder/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino7 -prefs runtime.tools.arduino101load.path=/home/builder/.arduino15/packages/Intel/tools/arduino101load/2.0.1 -prefs runtime.tools.core2-32-poky-linux.path=/home/builder/.arduino15/packages/Intel/tools/core2-32-poky-linux/1.6.2+1.0 -prefs runtime.tools.CMSIS-Atmel.path=/home/builder/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0 -prefs runtime.tools.flashpack.path=/home/builder/.arduino15/packages/Intel/tools/flashpack/2.0.0 -prefs runtime.tools.bossac.path=/home/builder/.arduino15/packages/arduino/tools/bossac/1.7.0-arduino3 -prefs runtime.tools.arduinoOTA.path=/home/builder/.arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs runtime.tools.avr-gcc.path=/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5 -prefs runtime.tools.x86-linux-gcc.path=/home/builder/.arduino15/packages/arduino/tools/x86-linux-gcc/7.2.0 -prefs runtime.tools.nrf5x-cl-tools.path=/home/builder/.arduino15/packages/arduino/tools/nrf5x-cl-tools/9.3.1 -prefs runtime.tools.CMSIS.path=/home/builder/.arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs runtime.tools.avrdude.path=/home/builder/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8 -libraries /tmp/260665628/custom -libraries /tmp/260665628/pinned /tmp/260665628/Blink_copy

Sketch uses 12184 bytes (4%) of program storage space. Maximum is 262144 bytes.

Programming with: Serial

Restarting in bootloader mode

Get port list before reset

[COM14]

Touching port COM14 at 1200bps

Set DTR off

Flashing with command:C:/Users/Alessandro LastName/.arduino-create/arduino/bossac/1.7.0-arduino3/bossac.exe -i -d --port=COM14 -U true -i -e -w -v C:/Users/ALESSA~1/AppData/Local/Temp/arduino-create-agent897223482/Blink_copy.bin -R

subcoderdolomiti:
even if I try to execute the command within a shell, another error occurs given that the path does not exists: in fact under C:/Users/ALESSA~1/.arduino-create/arduino/bossac/ I found the "1.7.0" folder (the correct one) and the "1.7.0-arduino3" file (which causes the path mess in the issued command).

It's not clear what you mean by this. Are you saying that C:/Users/ALESSA~1/.arduino-create/arduino/bossac/1.7.0-arduino3 is a file, not a folder? If so, does the filename have an extension? By default, Windows hides known filename extensions and you have to turn that off by checking the checkbox next to Windows Explorer's View > File name extensions option.

I don't think that is the full LOG either as there is usually more to it.
Do you have "Console: Show verbose output" enabled / ticked ?

Bob.

pert:
It's not clear what you mean by this. Are you saying that C:/Users/ALESSA~1/.arduino-create/arduino/bossac/1.7.0-arduino3 is a file, not a folder? If so, does the filename have an extension? By default, Windows hides known filename extensions and you have to turn that off by checking the checkbox next to Windows Explorer's View > File name extensions option.

Hi pert, that path corresponds to a regular file without extension: I obtained the file list after moving there by means of a "command prompt" window. It is an executable, to be precise (the cygwin 'file' utility says: "PE32 executable (console) Intel 80386, for MS Windows".)

Below I attach the output:

C:\Users\ALESSA~1\.arduino-create\arduino\bossac>1.7.0-arduino3
1.7.0-arduino3: you must specify at least one option
Try '1.7.0-arduino3 -h' or '1.7.0-arduino3 --help' for more information

C:\Users\ALESSA~1\.arduino-create\arduino\bossac>1.7.0-arduino3 --help
Usage: 1.7.0-arduino3 [OPTION...] [FILE]
Basic Open Source SAM-BA Application (BOSSA) Version 1.7.0
Flash programmer for Atmel SAM devices.
Copyright (c) 2011-2012 ShumaTech (http://www.shumatech.com)

Examples:
 bossac -e -w -v -b image.bin   # Erase flash, write flash with image.bin,
                                # verify the write, and set boot from flash
 bossac -r0x10000 image.bin     # Read 64KB from flash and store in image.bin

Options:
 -e, --erase           erase the entire flash (keep the 8KB of bootloader for SAM Dxx)
 -w, --write           write FILE to the flash; accelerated when
                       combined with erase option
 -r, --read[=SIZE]     read SIZE from flash and store in FILE;
                       read entire flash if SIZE not specified
 -v, --verify          verify FILE matches flash contents
 -p, --port=PORT       use serial PORT to communicate to device;
                       default behavior is to auto-scan all serial ports
 -b, --boot[=BOOL]     boot from ROM if BOOL is 0;
                       boot from FLASH if BOOL is 1 [default];
                       option is ignored on unsupported devices
 -c, --bod[=BOOL]      no brownout detection if BOOL is 0;
                       brownout detection is on if BOOL is 1 [default]
 -t, --bor[=BOOL]      no brownout reset if BOOL is 0;
                       brownout reset is on if BOOL is 1 [default]
 -l, --lock[=REGION]   lock the flash REGION as a comma-separated list;
                       lock all if not given [default]
 -u, --unlock[=REGION] unlock the flash REGION as a comma-separated list;
                       unlock all if not given [default]
 -s, --security        set the flash security flag
 -i, --info            display device information
 -d, --debug           print debug messages
 -h, --help            display this help text
 -U, --force_usb_port=true/false override USB port autodetection
 -R, --reset           reset CPU (if supported)
 -I, --ignoreOverflow  ignore if binary is bigger than internal flash
                       may be used to program external flash with contiguous address space)

Report bugs to <bugs@shumatech.com>

C:\Users\ALESSA~1\.arduino-create\arduino\bossac>

To be honest, I don't really know why that file appeared there, and at the same time I don't know why the Create editor issued such a command. But I moved elsewhere the file, I requested another compilation/upload and it worked: more details in the next post.

ballscrewbob:
I don't think that is the full LOG either as there is usually more to it.
Do you have "Console: Show verbose output" enabled / ticked ?

Bob.

Hi Bob, I enabled the verbose flag and that is the output I obtained. I attached the full file, but this is the row that gives the error:

...
Touching port COM6 at 1200bps

Set DTR off

Flashing with command:C:/Users/Alessandro LastName/.arduino-create/arduino/bossac/1.7.0-arduino3/bossac.exe -i -d --port=COM7 -U true -i -e -w -v C:/Users/ALESSA~1/AppData/Local/Temp/arduino-create-agent523151234/Blink_copy.bin -R
... command ends with error

While I was answering to pert, I made another test, after moving elsewhere the file "1.7.0-arduino3" (which is in fact the "bossac.exe" itself); the command went fine and that's the output:

...
Touching port COM7 at 1200bps

Set DTR off

Flashing with command:C:/Users/Alessandro LastName/.arduino-create/arduino/bossac/1.7.0-arduino3/bossac.exe -i -d --port=COM7 -U true -i -e -w -v C:/Users/ALESSA~1/AppData/Local/Temp/arduino-create-agent897235460/Blink_copy.bin -R

Set binary mode

... command continues successfully

The command issued is in fact the same, but as far as I understand, the first time the presence of the file "1.7.0-arduino3" caused the error; the second time, all went fine, given that in the meanwhile a folder "1.7.0-arduino3" was created and the file "bossac.exe" copied there. I don't know what the full process is: is it the agent that creates the folder structure?

As a final note, I was wrong, when I said that the unescaped path "C:/Users/Alessandro LastName/..." was a problem. Even if the same path is used in the second case, that one was successful.

Is there any plausible cause of the presence of the wrong "1.7.0-arduino3" file, or it is all attributable to some failed experiment of mine?
Many thanks,
Alessandro.

console_pre.txt (8.97 KB)

console_post.txt (11.9 KB)

In the "PRE TEXT" you have it picking up COM 6 after the touch and then COM 7 yet in you OP the port is 14 ?

I know MKR's can and will jump ports from the regular port to the bootloader port during programming but that seems a little off.
Have you at any time reset or changed the COM ports yourself in any way ?

It may be nothing to do with your current issue that Per is the master of :slight_smile:

None of us know what experiments you might have done so it would not make much sense for me to comment on that aspect.
Any additional details as to your experiments may be useful.

Bob.

subcoderdolomiti:
As a final note, I was wrong, when I said that the unescaped path "C:/Users/Alessandro LastName/..." was a problem. Even if the same path is used in the second case, that one was successful.

My experiments confirm that there is no problem with the upload command when there are spaces in the path. If you look at the upload recipe:

tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -i -e -w -v "{build.path}/{build.project_name}.bin" -R

You can see they actually do quote the path. I don't know why it's not shown quoted in the console output.

subcoderdolomiti:
Is there any plausible cause of the presence of the wrong "1.7.0-arduino3" file, or it is all attributable to some failed experiment of mine?

I have no explanation for it. It's possible that Arduino Web Editor first puts a compressed file in C:/Users/Alessandro LastName/.arduino-create/arduino/bossac and then extracts it to a folder, but if that were the case I'd expect it to have a file extension like .zip or .tar.gz. If you still have the file on your computer or recycle bin, could you check the file size and post it here? You can get the file size by right clicking on the file and then clicking "Properties". The one I want is listed as "Size", not the "Size on disk".

ballscrewbob:
In the "PRE TEXT" you have it picking up COM 6 after the touch and then COM 7 yet in you OP the port is 14 ?
...
Have you at any time reset or changed the COM ports yourself in any way ?
...
None of us know what experiments you might have done so it would not make much sense for me to comment on that aspect.
Any additional details as to your experiments may be useful.

Bob.

Hi Bob, you're right, I didn't notice the "port shift".
I did not perform any operation to force a port change. I certainly did the tests in different days and moments, and I connected the board to different ports.

The experiments I did ... Unfortunately I didn't act in a rational way and I didn't keep track of the attempts: I just remember that I experienced problems even in the modeling phase of the device ("Ardino Create" and then "Device Manager") and at that point, yes, maybe I submitted in a shell some commands found on the net by hand.
I'm sorry I didn't help; I believe however that in the end the problem does not exist and that it can be traced back to a "poorly cleaned" environment on my PC.
In fact I posted the problems encountered when working under Windows, but I did not highlight that - with the same board and the same PC booted with Linux Mint - the whole procedure worked perfectly.

Many thanks,
Alessandro.

pert:
My experiments confirm that there is no problem with the upload command when there are spaces in the path. [...]
I have no explanation for it. It's possible that Arduino Web Editor first puts a compressed file in C:/Users/Alessandro LastName/.arduino-create/arduino/bossac and then extracts it to a folder, but if that were the case I'd expect it to have a file extension like .zip or .tar.gz. If you still have the file on your computer or recycle bin, could you check the file size and post it here? You can get the file size by right clicking on the file and then clicking "Properties". The one I want is listed as "Size", not the "Size on disk".

Hi Pert, thanks for the explanation and the link to github.

You're right, the path with spaces is escaped, so it gives no problem.

The fault was due to the presence of the file under "C:/Users/Alessandro LastName/.arduino-create/arduino/bossac" but I don't know how to give you more information because in the meantime I have cleaned up my PC.

As I said to Bob, above, it was probably a "dirty" file that I downloaded by hand doing some experiments after some failure during the modeling phase of a device through the "Device manager".

Now I can't say what the file in the directory was like; I do not exclude that it is the same as the one found in the "... / 1.7.0" folder (judging by the dates, they are probably the result of tests I carried out in the same days); here there is a recursive listing obtained in a cygwin shell:

Alessandro LastName@stachanov /cygdrive/c/Users/Alessandro LastName/.arduino-create/arduino/bossac
$ ls -laR
.:
totale 0
drwx------+ 1 Alessandro LastName NESSUNO 0 14 lug 16.31 .
drwx------+ 1 Alessandro LastName NESSUNO 0 11 lug 22.24 ..
drwx------+ 1 Alessandro LastName NESSUNO 0  8 lug 20.18 1.7.0
drwx------+ 1 Alessandro LastName NESSUNO 0 14 lug 16.31 1.7.0-arduino3

./1.7.0:
totale 704
drwx------+ 1 Alessandro LastName NESSUNO      0  8 lug 20.18 .
drwx------+ 1 Alessandro LastName NESSUNO      0 14 lug 16.31 ..
-rwx------+ 1 Alessandro LastName NESSUNO 719886  8 lug 20.18 bossac.exe

./1.7.0-arduino3:
totale 11528
drwx------+ 1 Alessandro LastName NESSUNO        0 14 lug 16.31 .
drwx------+ 1 Alessandro LastName NESSUNO        0 14 lug 16.31 ..
-rwx------+ 1 Alessandro LastName NESSUNO 11804064 14 lug 16.31 bossac.exe

I'm sorry I didn't help; I believe however that in the end the problem does not exist and that it can be traced back to a "poorly cleaned" environment on my PC.
Many thanks for your help!
Alessandro

I'm just glad to hear that you are able to upload to your Arduino now!

From the information you provided, I don't think it's necessary to investigate the problem further. I'll keep it in mind in case other users report the same problem, at which time an investigation would be warranted to make sure it's not caused by a problem in the Arduino Create plugin.

pert:
I'm just glad to hear that you are able to upload to your Arduino now!

From the information you provided, I don't think it's necessary to investigate the problem further. [...]

I agree.
Many thanks for the support,
Alessandro.

Edit:
P.S. I searched back in my browser history and I found a page I've visited the day the indicted file and folder were created: Executing command: exec: not started - Web Editor - Arduino Forum
I cannot remember, but I think I've manually launched the "downloadtool avrdude ..." command, so I've messed up the plugin work directory. So, my fault...