Upload problems with Windows 8.1, 10 and IDE 1.8.9

Hi I’m a first time user, and I am trying to upload the Blink example program to a new Genuino ZERO.

I have tried installing the IDE v1.8.9 on a Windows 8.1 Laptop and a Windows 10 Desktop. Each time I have also installed the correct board manager software (Arduino SAMD board v1.8.1), driver (EDBG 1.4.0.0) and selected the board (Arduino/Genuino Zero (Programming Port)) and port (COM3 on the laptop, COM6 on the desktop).

The Sketch compiles OK, but fails on the upload. The error message seems to suggest that it can’t find the binary to upload, and when I look, it would appear that the file path is garbled. In searches I’ve seen similar errors for older versions of the IDE when there is a space in the username, but that isn’t the case here. I wonder if this may be a regression - it looks like the directory backslash is being used to escape the following character, whereas in other parts of the trace it is doubled.

Also there doesn’t appear to be anything fundamentally wrong with the hardware or cable, as I am able to compile and upload the sketch successfully using the Web based IDE, although I would like to use the desktop one so that I can version my software.

C:\Users\andyr\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7/bin/openocd.exe -d2 -s C:\Users\andyr\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7/share/openocd/scripts/ -f C:\Users\andyr\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.1/variants/arduino_zero/openocd_scripts/arduino_zero.cfg -c telnet_port disabled; program C:\Users\andyr\AppData\Local\Temp\arduino_build_468852/Blink.ino.bin verify reset 0x2000; shutdown 
Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:36)
Licensed under GNU GPL v2
For bug reports, read
 http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 02.01.0157
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread 
xPSR: 0x81000000 pc: 0x00000858 msp: 0x200023a0
** Programming Started **
auto erase enabled
An error occurred while uploading the sketch
Error: couldn't open C:UsersandyrAppDataLocalTemparduino_build_468852/Blink.ino.bin
embedded:startup.tcl:477: Error: ** Programming Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 536
at file "embedded:startup.tcl", line 477

Can you verify that the file it can’t find actually looks like this in the output pane?

C:UsersandyrAppDataLocalTemparduino_build_468852/Blink.ino.bin

and that it’s not getting mangled by the forum because you didn’t use code tags?

If it didn’t look like that, repost in code tags (</> button) so it doesn’t get mangled.

If it did look like that, that would be the problem, as that is clearly an invalid path. In this case, what locale/language do you have set?

Sorry, here it is in code tags:

Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 02.01.0157
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections
An error occurred while uploading the sketch
target halted due to debug-request, current mode: Thread 
xPSR: 0x81000000 pc: 0x00000858 msp: 0x200023a0
** Programming Started **
auto erase enabled
Error: couldn't open C:UsersandyrAppDataLocalTemparduino_build_919417/Blink.ino.bin
embedded:startup.tcl:477: Error: ** Programming Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 536
at file "embedded:startup.tcl", line 477

Region/Language set to UK/English(UK)

Trying it with US settings ...

OK, slightly different final error message, but the same problem with finding the binary:

Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread 
xPSR: 0x81000000 pc: 0x00000858 msp: 0x200023a0
** Programming Started **
auto erase enabled
Error: couldn't open C:UsersandyrAppDataLocalTemparduino_build_446785/Blink.ino.bin
embedded:startup.tcl:477: Error: ** Programming Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 536
at file "embedded:startup.tcl", line 477
the selected serial port at file "embedded:startup.tcl", line 477
 does not exist or your board is not connected

That is bizarre, its mangling the path...

I have not seen that issue reported here before...

Please try this:

  • Tools > Board > Boards Manager
  • Wait for downloads to finish
  • Click on "Arduino SAMD Boards (32-Bits ARM Cortex-M0+) by Arduino".
  • From the dropdown menu, select "1.6.21".
  • Click the "Install" button.
  • Wait for the installation to finish
  • Click the "Close" button.
  • Sketch > Upload

Does the same problem happen?

I'm suspicious that this change made in Arduino SAMD Boards 1.8.1 may have been the cause:

I have no clue why they did that. It seems to have absolutely nothing to do with the stated purpose of the commit: "Mass rename old vidor2000"

Yes, that's fixed it, and the path shows up as expected - brilliant :slight_smile:

Is there someone needs to know about this?

It would be really great if you would submit a bug report about this to this issue tracker:

This is a Windows-specific issue because Windows uses backslashes as path separators instead of the front slashes used by Linux and macOS. The problem is the backslash is also the escape character, which is why the path got all garbled.

It solved my problems, when I moved form the version 1.8.1 to version 1.6.21 it solved my problem.