[Solved] Unable to upload to Zero on either programming or native USB ports

When trying to upload a sketch to my Arduino Zero on the programming port I get the following error message:

the selected serial port at file "embedded.startup:tcl", line 454 does not exist or your board is not connected

Open On-Chip Debugger 0.9.0-gd4b7679 (2015-06-10-22:24)
Licensed under GNU GPL v2
For bug reports, read
 http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Error: Target not examined yet
in procedure 'program' 
in procedure 'reset' called at file "embedded:startup.tcl", line 478
in procedure 'ocd_bouncer'

Runtime Error: embedded:startup.tcl:454: ** Unable to reset target **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 479
at file "embedded:startup.tcl", line 454
the selected serial port at file "embedded:startup.tcl", line 454
 does not exist or your board is not connected

On the programming port communications with the COM port is established, but fails with the above error on programming.

On the native USB port the windows driver complains that the device has malfunctioned.

I've tried to burn the bootloader using the Atmel EDBG on the programming port, but this also fails.

I guess this might mean a dead processor, but I'd appreciate any help or suggestions that may get it going again.

I managed to get it going again. Got the idea from "How to "reset" your Arduino board?" on the Stackoverflow website: http://stackoverflow.com/questions/5290428/how-to-reset-an-arduino-board

I attempted to upload an empty (new) sketch via the programming port and pressed the reset button just as compilation ended and upload began. It took a few goes, then all of a sudden it worked and the sketch uploaded!

H E L P !

I have the same problem - but the recovery process suggested above sadly did not work.

I am using Mac OS 10.9.5. I have tried the following without any success. The Arduino IDE is 1.6.5

(1) Tried to use the Programming port (This appears as dev/cu.usbmodemfd121) (2) Installed latest FTDI driver (v.2.3). (3) Tried to use the USB native port (This also appears as dev/cu.usbmodemfd121 under "Port" in the "Tools" menu.) The failure message was: No device found on cu.usbmodem0041 (4) Checked everything was working OK with a Uno. (This worked OK). (5) Tried with an Ubuntu system, with an up to date Arduino IDE with identical results.

The error log with verbose turned-on for upload, is included below. From this error log it seems that communication with the board is OK but there is some error with the uploader.

Any advice or help would be appreciated.

Harry J. Whitlow

Arduino: 1.6.5 (Mac OS X), Board: "Arduino Zero (Programming Port)"

Sketch uses 10,940 bytes (4%) of program storage space. Maximum is 262,144 bytes. /Users/whitlow/Library/Arduino15/packages/arduino/tools/openocd/0.9.0-arduino/bin/openocd -d2 -s /Users/whitlow/Library/Arduino15/packages/arduino/tools/openocd/0.9.0-arduino/share/openocd/scripts/ -f /Users/whitlow/Library/Arduino15/packages/arduino/hardware/samd/1.6.1/variants/arduino_zero/openocd_scripts/arduino_zero.cfg -c telnet_port disabled; program {{/var/folders/k3/pmv342j127d1sh77y72szg4h0000gn/T/build4275863584046010801.tmp/sketch_jul24a.cpp.bin}} verify reset 0x00002000; shutdown Open On-Chip Debugger 0.9.0-gd4b7679 (2015-06-10-19:16) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 2 Info : only one transport option; autoselect 'swd' adapter speed: 500 kHz adapter_nsrst_delay: 100 cortex_m reset_config sysresetreq Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: JTAG Supported Info : CMSIS-DAP: Interface Initialised (SWD) Info : CMSIS-DAP: FW Version = 01.1F.0118 Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 500 kHz Info : SWD IDCODE 0x0bc11477 Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x81000000 pc: 0x000028f4 msp: 0x20002c00 ** Programming Started ** auto erase enabled Info : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM) Warn : Adding extra erase range, 00000000 to 0x00001fff Error: SAMD: NVM lock error Error: Failed to erase row containing 00002000 Error: error writing to flash at address 0x00000000 at offset 0x00002000 Runtime Error: embedded:startup.tcl:454: ** Programming Failed ** in procedure 'program' in procedure 'program_error' called at file "embedded:startup.tcl", line 510 at file "embedded:startup.tcl", line 454 the selected serial port at file "embedded:startup.tcl", line 454 does not exist or your board is not connected

This report would have more information with "Show verbose output during compilation" enabled in File > Preferences.

There’s a post here: http://forum.arduino.cc/index.php?topic=330870.0 with a similar error, but it’s in French.

Are you by any chance using the Arduino “Zero Pro” or “M0 Pro” from Arduino.org?

I have a problem my self when i try to upload using programming port. I get this this error message.

Arduino: 1.6.5 (Windows 8), Board: "Arduino Zero (Programming Port)"

Sketch uses 11,060 bytes (4%) of program storage space. Maximum is 262,144 bytes.

Open On-Chip Debugger 0.9.0-gd4b7679 (2015-06-10-22:24)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x61000000 pc: 0x000028f4 msp: 0x20002c00
** Programming Started **
auto erase enabled
Error: SAMD: NVM lock error
Error: Failed to erase row containing 00002000
Error: error writing to flash at address 0x00000000 at offset 0x00002000
Runtime Error: embedded:startup.tcl:454: ** Programming Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 510
at file "embedded:startup.tcl", line 454
the selected serial port at file "embedded:startup.tcl", line 454
 does not exist or your board is not connected

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

so i first looked at my device manger and i get a yellow mark in there saying EDGB Data Gateway. Not sure what that is but it’s part of the arduino for the Zero can someone please help me out

I’m using 1.6.4 ide with the m0 zero in the board manger Version 1.6.1 installed

Arduino has split into two companies Arduino LLC (arduino.cc) that produces the "Zero" and Arduino SRL (arduino.org) that produces the "Zero Pro", later renamed "M0 Pro". Unfortunately, the Zero/Zero Pro design hasn't entirely escaped the consequences of the division. Luckily the boards are very similar, but fact that the bootloader is different is probably causing the error. There are also some very minor design differences detailed below.

If you've got an Arduino "Zero Pro" or "M0 Pro" from Arduino.org, you have two choices, either:

  1. Download the Integrated Development Environment (IDE) from the Arduino.org website, this is however different from the 1.6.5 IDE you currently have and is likely to diverage even further as the two companies go their separate ways. It may also require you to unintall version 1.6.5 of the IDE, (though I haven't tried this).

or

  1. Continue using the Version 1.6.5 of the IDE, but burn the bootloader of the board following the advice given here: http://forum.arduino.cc/index.php?topic=330097.msg2280755#msg2280755.

On this link patthoyts states:

The error message reported is the same one I got using an Arduino Zero Pro with the the arduino.cc 1.6.5 IDE. The problem is the Zero Pro needs an update to the bootloader to work with arduino.cc software. You can update this by connecting the programming port and I selected "Atmel EDBG" as the programmer from the Tools/Programmer menu. Then select Tools/Burn Bootloader. Doing this has allowed me to use the arduino.cc Arduino 1.6.5 IDE to program the Zero Pro.

There is a minor consideration though as scswift points out, digital pins 2 and 4 are swapped and there's no experimental ATN pin on the Zero Pro/M0 Pro, although this is really only a consideration if you intended to use some offical shields:

The differences are minor. Pins 2 and 4 are swapped. There is no ATN pin. That's about it. Don't sweat it. It would only matter if you intended to design shields and didn't know about the difference or wanted to use a shield that used those pins. But I don't know how many shields are even compatible with it, so that's probably not a big concern yet either.

Hello MartinL i just figure it out the board i got is from a .org product. I also tried to burn the bootloader it didn't take. at all. i did get the drivers to install though.

Thanks for the help!

I was using an Arduino M0 PRO. The IDE 1.7.6 from Arduino.org worked with the board and solved the problem.

Harry J. Whitlow

Thanks MartinL for the information yeah I'm now figuring this out too. I'm also using hte .org software 1.7.6 ide for now.

I found that the IDE 1.6.5 works very well, and had real problems connecting with the .org 1.7.6 IDE - no Zero board showed up in the list.

Now I have got it connected, I need to try out a few projects on it.

Hi, My problem is similar but unresolved. I would like to document what I found and ask if anyone has a solution for me, please?

I have an "Arduino Zero Pro", the barcode on the side of the box is ZP0000154 and on the board the chip closest to pin 13 has a blue sticker with "LIMITED EDITION" in white letters on it. On the reverse of the board it has printed "BOARD MODEL ZERO PRO R3" and "ARDUINO.ORG"

My host computer is an HP desktop running Windows/7 64bit. My Arduino IDE is version 1.6.4. I used "Tools/Board/Boards Manager" and selected "Arduino SAMD Boards (32-bits ARM Cortex-M0+)", selected the latest version: "1.6.2" and installed it.

Then I connected my host computer via the USB port and the Arduino board using the "Programming Port" furthest from the "Reset" button. Very briefly a dialog appeared, I presume it was to do with installing drivers but it disappeared before I could read it.

The I noticed in "Control Panel/Device Manager" that there were three items under "Other Devices" (Between Network adapters and Portable adapters) EDBG CMSIS-DAP EDBG Data Gateway EDBG Virtual COM Port But they all had a yellow box with an Exclamation mark in it to the left - indicating that all is not well.

Then, a few minites later - EDBG CMSIS-DAP has disappeared from the list Then EDBG Virtual COM Port has also disappeared And now I have under Ports(COM & LPT): Atmel Corp.EDBG USB Port(COM18) But I still have EDBG Data Gateway with a yellow box with an Exclamation mark.

I thought I would try the IDE anyway and selected Port: COM18 - OK Next I selected the Board: Arduino/Genuino Zero (Programming Port) - OK

Finally I tried to upload the Blink sketch, but got this:

Open On-Chip Debugger 0.9.0-gd4b7679 (2015-06-10-22:24) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 0 adapter speed: 500 kHz adapter_nsrst_delay: 100 cortex_m reset_config sysresetreq Error: unable to open CMSIS-DAP device 0x3eb:0x2111 Error: No Valid JTAG Interface Configured.

I did what "SurfingDude" suggested in this post: "http://forum.arduino.cc/index.php?topic=356313.0" and found out the "Device Instance Path" was, for the "Atmel Corp.EDBG USB Port(COM18)" device in "Device Manager" and got: USB\VID_03EB&PID_2111&MI_01\7&21F3553F&0&001 I don't know what that means but it might help someone diagnosing my problem.

I have not tried to "Burn bootloaders" as I don't know whether I need to and don't want to make matters worse.

Please can anyone help to stop these errors: Error: unable to open CMSIS-DAP device 0x3eb:0x2111 Error: No Valid JTAG Interface Configured.

And tell me if the remaining problem with "EDBG Data Gateway" can be fixed or is nothing to do with these errors?

Regards, Martyn.

I think the issue here is that you're using the Arduino IDE from Arduino.cc and the M0 Pro board from Arduino.org.

To continue using Arduino.cc's IDE, I believe you have to burn the Arduino.cc's bootloader and modify the board's "variant.cpp" and "boards.txt" file.

The other alternative is to use Arduino.org's IDE.

Perhaps someone with experience using an M0 Pro with the Arduino.cc's IDE can give an explanation of how it's done?

As Martin said, burn the v1.6.x bootloader if you are using the v1.6.x IDE.

Burn the v1.7.x bootloader if you are using the v1.7.x IDE.

If you have been using Keil or AS7, you need to burn the bootloader again when you go back to an Arduino IDE.

I suggest that you stick with v1.6.x and add a MO Pro entry to boards.txt.

I have an early board too. It works fine.

David.

Same problem on my Arduino/Genuino Zero with IDE 1.6.7 and cores SAMD 1.6.2 on Mac OS X 10.11.3.

Even after burning the boot-loader again, upload fails.

* Resetting Target **
shutdown command invoked
the selected serial port shutdown command invoked does not exist or your board is not connected

The only solution so far is to reboot the Mac. Hardly a convenient solution!

Any idea?

MartinL: I managed to get it going again. Got the idea from "How to "reset" your Arduino board?" on the Stackoverflow website: http://stackoverflow.com/questions/5290428/how-to-reset-an-arduino-board

I attempted to upload an empty (new) sketch via the programming port and pressed the reset button just as compilation ended and upload began. It took a few goes, then all of a sudden it worked and the sketch uploaded!

THANK YOU THANK YOU THANK YOU !!!

Learned a valuable lesson .. don;t go poking at bits if your not sure what they do ... ;-)

Hi guys,

If you have an M0 or M0 PRO manufactured by Arduino Org. and wish to go the way of Arduino Org., here is a step by step guide I originally uploaded in march on the Arduino Org. site.

GETTING STARTED WITH ARDUINO M0 ON WINDOWS 7 PROFESSIONAL

This is a step by step procedure that will help you to make the transition from Arduino 1 to Arduino M0 ot M0 PRO. The following points are very important. 1. Use IDE 1.7.8 or higher available at WWW.arduino.org. 2. According to my experience this IDE is not compatible with Windows XP SP3. 3. Do not use IDE 1.6.7 available at WWW.arduino.cc. If you wish to go the Arduino c.c. way, you must change the bootloader as explained in the preceding posts on this topic. 4. Buy & use the best USB/Submin cable you can get. Cheap cables do not work, or work intermittently. Follow the step by step procedure below. 5. Go to the WWW.arduino.org site, go to IDE downloads & download IDE V.1.7.8 or higher installer. 6. REMEMBER THAT INSTALLING THIS WILL AUTOMATICALLY DE-INTALL THE CURRENT IDE ON YOUR SYSTEM. 7. The installation procedure will de-install previous Arduino IDE versions automatically. 8. Install the freshly downloaded IDE. It will install 1.7.8 with its drivers first, then it will install the ATMEL USB driver package: this will take a long time and even though it will seem that you have had a system crash, it will install, eventually. 9. Re-boot. 10. Plug Arduino M0 or M0 PRO into the USB. You will see LED “L” (Pin 13) which will start blinking. Drivers AUTO INSTALL will start. This is a critical point: even though you are impatient and it seems that the drivers have been installed, the PC is still working in secret. Do nothing and wait at least 10 minutes: time to have a coffee. 11. Eventually “Drivers installed, PORT 21” will appear. Port mentioned may be different. 12. Right click “My Computer” and get to “Devices”. Open COM & LPT ports and you should see Arduino on COM 21 or another Port as: “ Arduino M0 Native Port (COM 21)”. Click it and open “Port preferences”, go to “Advanced” and change Port number to Port 2. Do not bother if it says Port 2 is already occupied, just do it. 13. Close “Devices”. It is now time to set the Arduino IDE. 14. Click on the Arduino icon, click on “File”, go to “Preferences” and turn “Line numbers” on. Also turn on “Associate .ino files with Arduino. Close “Preferences”. 15. Go to “Devices”, open “Boards” and make sure the dot is on “Arduino M0”, you will probably find it on Arduino 1 and you must change. “Arduino M0” is at the bottom of the list. Go to “Port” and make sure Arduino is on COM 2. When OK it will read:” COM 2 (Arduino M0)”. 16. NOW RE-SET THE ARDUINO PUSHING ITS RE-SET BUTTON!! 17. Load the following Blinker sketch. This will not only operate the LED with variable times in three rounds, but will show you how the Serial USB works, yes, because now we must use the “SerialUSB” command.

/*============================================================
glovisol M0 Blinker sketch special. This is in the Public Domain.
This sketch demonstrates M0 Serial Monitor operation and if command*/

#define LED_PIN 13
#define LED_ON HIGH
#define LED_OFF LOW
int delayPeriod = 2000; //Changing this delay will change the initial time
int count = 0;

void setup()
{
pinMode(LED_PIN, OUTPUT);
SerialUSB.begin (9600);
delay(1000); // This delay important, as allows time to free the USB before Serial Monitor turn-on.
}
void loop()
{ 
digitalWrite(LED_PIN, LED_ON);
SerialUSB.println("LED ON");
delay(delayPeriod);
digitalWrite(LED_PIN, LED_OFF);
SerialUSB.println ("LED OFF");
delay (delayPeriod);
SerialUSB.print ("COUNT = ");
SerialUSB.println (count);
delay(delayPeriod);
count++;
if (count == 11)
{
delayPeriod = 100; 
SerialUSB.println ("END COUNT 1");
delay (2000); 
}
if (count == 21)
{
SerialUSB.println ("END COUNT 2");
delayPeriod = 500;
delay (2000); 
} 
if (count == 31)
{
SerialUSB.println ("END COUNT 3");
count = 1;
delayPeriod = 1000;
delay (2000); 
} 
} //Recycles
//===========================================================================

NOTES:

• Try to compile it first. If compilation is O.K., it should load all right and start working. After compiling, when loading, you should see the LEDS blinking madly, just before it finishes upoloading. REMEMBER TO RE-SET with pushbutton prior to loading a new sketch!!! • Disregard all strange alarms that come on and off during Compilation and Upload. If Upload goes wrong, it will never come to “sketch uploaded”, but just hang. In this case you must investigate what has gone wrong and alarm entries with line numbers will help you to debug. • As soon as uploaded, but with no hurry, open the Serial Monitor: you should see the works cycling. • O.K., you are in business!!

PECULIARITIES OF M0: MUST KNOW, OR NOTHING WILL WORK!

  1. REMEMBER: No voltages higher than 3 V on any pins and no higher than 2.7 V on the AREF pin!
  2. Arduino M0 has 6 Digital or Analogue input pins, A0 to A5. A0 can also work as output with a 10 Bit DAC.
  3. Pin 0 and 1 are reserved for COMMS, but are not connected to the USB COMMS as in Arduino 1. Remember to use SerialUSB in place of Serial!!
  4. Arduino M0 has 11 PWM / DIGITAL pins, 2 to 13.
  5. For PWM remember that pins 4 & 10 and 5&12 are effectively in parallel, when in PWM. So there really are only 9 INDEPENDENT PWM pins.
  6. By default PWM frequency is 187 KHz, about 400 times higher that Arduino’s default PWM frequency of 475 Hz. Information for changing PWM frequency not yet available, but soon will be!
  7. For changing Analog Reference, the commands are: If you do not specify, Reference voltage will be the internal 3.3 V. Otherwise: AR_DEFAULT // Internal Reference voltage of 3.3V, same as above. AR_INTERNAL // Internal reference voltage of 1.0 V. AR_EXTERNAL // You must provide an external Reference voltage to the Aref pin, but remember this voltage MUST be lower than 2.7 V.

  8. Input pins A0 to A5 read 0 to 3V (MAX!) input voltage with a default Resolution of 10 Bit (0 – 1023).

  9. You can change this resolution with analogRead for 8 Bit resolution (0 – 255).

  10. OR change this resolution with analogRead(12) for 12 Bit resolution (0-4095).

  11. Pins 2 to 13 can be DIGITAL INPUTS (ON/OFF), DIGITAL OUTPUTS (ON/OFF) or PWM OUTPUTS, with the limitations mentioned in 5 above.

  12. For DIGITAL MODE you have digitalWrite().

  13. When in PWM OUTPUT MODE you have the commands:

  14. pinMode() to set the pin as INPUT or OUTPUT.

  15. analogWrite().

  16. The PWM Resolution of pins 2 – 13 is 8 Bit by Default ( do not be confused with the default Resolution of input pins A0 –A5).