Can not burn Zero bootloader in my M0 Pro

I was one of the person that was fooled and ordered too early on of this green & gray Arduino Zero in Europe. I can see the label “Arduino Zero Pro” on it, but now I learn that it came form Arduino.org and was recenntly renamed to “M0 Pro”. It is really a pity that few persons can make such a damage and confusion to a very big community.

I want to stay with the original Arduino Team and IDE (1.6.5), I read carefully and learnt that I need to make some changes to the IDE configuration files, and burning the Arduino.cc bootloader. This is the process I followed using the Arduino IDE 1.6.5 in my Arch Linux machine:

  1. I added the Arduino SAMD boards v1.6.1, through the board managuer → Install option, this created the SAMD folder (ATMEL ARM Architecture) with all the needed configuration, in my home directory.

  2. I edited the board.txt in the followingLinux path, and added the Arduino M0 Pro:
    /home/USER/.arduino15/packages/arduino/hardware/samd/1.6.1/

# Copyright (c) 2014-2015 Arduino LLC.  All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

# Arduino Zero de www.arduino.cc
arduino_zero_edbg.name=Arduino Zero (Programming Port)
arduino_zero_edbg.vid.0=0x03eb
arduino_zero_edbg.pid.0=0x2157
arduino_zero_edbg.upload.tool=openocd
arduino_zero_edbg.upload.protocol=sam-ba
arduino_zero_edbg.upload.maximum_size=262144
arduino_zero_edbg.upload.use_1200bps_touch=false
arduino_zero_edbg.upload.wait_for_upload_port=false
arduino_zero_edbg.upload.native_usb=false
arduino_zero_edbg.build.mcu=cortex-m0plus
arduino_zero_edbg.build.f_cpu=48000000L
arduino_zero_edbg.build.usb_product="Arduino Zero"
arduino_zero_edbg.build.usb_manufacturer="Arduino LLC"
arduino_zero_edbg.build.board=SAMD_ZERO
arduino_zero_edbg.build.core=arduino
arduino_zero_edbg.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
arduino_zero_edbg.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
arduino_zero_edbg.build.openocdscript=openocd_scripts/arduino_zero.cfg
arduino_zero_edbg.build.variant=arduino_zero
arduino_zero_edbg.build.variant_system_lib=
arduino_zero_edbg.build.vid=0x2341
arduino_zero_edbg.build.pid=0x804d
arduino_zero_edbg.bootloader.tool=openocd
arduino_zero_edbg.bootloader.file=zero/samd21_sam_ba.bin

arduino_zero_native.name=Arduino Zero (Native USB Port)
arduino_zero_native.vid.0=0x2341
arduino_zero_native.pid.0=0x804d
arduino_zero_native.vid.1=0x2341
arduino_zero_native.pid.1=0x004d
arduino_zero_native.upload.tool=bossac
arduino_zero_native.upload.protocol=sam-ba
arduino_zero_native.upload.maximum_size=262144
arduino_zero_native.upload.use_1200bps_touch=true
arduino_zero_native.upload.wait_for_upload_port=true
arduino_zero_native.upload.native_usb=true
arduino_zero_native.build.mcu=cortex-m0plus
arduino_zero_native.build.f_cpu=48000000L
arduino_zero_native.build.usb_product="Arduino Zero"
arduino_zero_native.build.usb_manufacturer="Arduino LLC"
arduino_zero_native.build.board=SAMD_ZERO
arduino_zero_native.build.core=arduino
arduino_zero_native.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
arduino_zero_native.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
arduino_zero_native.build.openocdscript=openocd_scripts/arduino_zero.cfg
arduino_zero_native.build.variant=arduino_zero
arduino_zero_native.build.variant_system_lib=
arduino_zero_native.build.vid=0x2341
arduino_zero_native.build.pid=0x804d
arduino_zero_native.bootloader.tool=openocd
arduino_zero_native.bootloader.file=zero/samd21_sam_ba.bin

# Arduino M0 Pro de www.arduino.org     <------ La Falsa de Arsuino Srl!!!!!!!!, 29/10/2015
arduino_m0_pro_edbg.name=Arduino M0 Pro (Programming Port)
arduino_m0_pro_edbg.vid.0=0x03eb
arduino_m0_pro_edbg.pid.0=0x2157
arduino_m0_pro_edbg.upload.tool=openocd
arduino_m0_pro_edbg.upload.protocol=sam-ba
arduino_m0_pro_edbg.upload.maximum_size=262144
arduino_m0_pro_edbg.upload.use_1200bps_touch=false
arduino_m0_pro_edbg.upload.wait_for_upload_port=false
arduino_m0_pro_edbg.upload.native_usb=false
arduino_m0_pro_edbg.build.mcu=cortex-m0plus
arduino_m0_pro_edbg.build.f_cpu=48000000L
arduino_m0_pro_edbg.build.usb_product="Arduino M0 Pro"
arduino_m0_pro_edbg.build.usb_manufacturer="Arduino Srl"
arduino_m0_pro_edbg.build.board=SAMD_M0_PRO
arduino_m0_pro_edbg.build.core=arduino
arduino_m0_pro_edbg.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
arduino_m0_pro_edbg.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
arduino_m0_pro_edbg.build.openocdscript=openocd_scripts/arduino_zero.cfg
arduino_m0_pro_edbg.build.variant=arduino_zero
arduino_m0_pro_edbg.build.variant_system_lib=
arduino_m0_pro_edbg.build.vid=0x2341
arduino_m0_pro_edbg.build.pid=0x804d
arduino_m0_pro_edbg.bootloader.tool=openocd
arduino_m0_pro_edbg.bootloader.file=zero/samd21_sam_ba.bin

arduino_m0_pro_native.name=Arduino M0 Pro (Native USB Port)
arduino_m0_pro_native.vid.0=0x2341
arduino_m0_pro_native.pid.0=0x804d
arduino_m0_pro_native.vid.1=0x2341
arduino_m0_pro_native.pid.1=0x004d
arduino_m0_pro_native.upload.tool=bossac
arduino_m0_pro_native.upload.protocol=sam-ba
arduino_m0_pro_native.upload.maximum_size=262144
arduino_m0_pro_native.upload.use_1200bps_touch=true
arduino_m0_pro_native.upload.wait_for_upload_port=true
arduino_m0_pro_native.upload.native_usb=true
arduino_m0_pro_native.build.mcu=cortex-m0plus
arduino_m0_pro_native.build.f_cpu=48000000L
arduino_m0_pro_native.build.usb_product="Arduino M0 Pro"
arduino_m0_pro_native.build.usb_manufacturer="Arduino Srl"
arduino_m0_pro_native.build.board=SAMD_M0_PRO
arduino_m0_pro_native.build.core=arduino
arduino_m0_pro_native.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
arduino_m0_pro_native.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
arduino_m0_pro_native.build.openocdscript=openocd_scripts/arduino_zero.cfg
arduino_m0_pro_native.build.variant=arduino_zero
arduino_m0_pro_native.build.variant_system_lib=
arduino_m0_pro_native.build.vid=0x2341
arduino_m0_pro_native.build.pid=0x804d
arduino_m0_pro_native.bootloader.tool=openocd
arduino_m0_pro_native.bootloader.file=zero/samd21_sam_ba.bin

I am also supossed to change the variant.cpp, however I am not sure what I should change, and it is not so important (pin 2&4 are exchanged in both boards)

  1. In the Arduino IDE I selected:
    Tools → Programmer → “ATMEL EDBG”
    Tools → Boards → “Arduino M0 Pro (Programming Port)”
    Tools → Ports → “/dev/ttyACM0” (the only one listed)

  2. Then: Tools → Burn Bootlader, and I get the error message:

Open On-Chip Debugger 0.9.0-gd4b7679 (2014-10-03-00:26)
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
Error: unable to find CMSIS-DAP device

el puerto seleccionado no existe o tu placa no esta conectada

The spanish error message translates to : “Port not found”, however I can see it listed in the IDE: Tools → Port

I think the issue could be related to the fact that I use linux. Any clue or advice?

In this thread Mr. David Prentice provides a way to adapt the arduino.cc IDE to deal with Arduino.org M0 Pro board: https://forum.arduino.cc/index.php?topic=351419.0

I edited both files following David's instructions: board.txt file, and variant.cpp.

I can not still burn the bootloader or load a program, the errors I get are the following using the Programming USB port:

Burn bootloader:

Open On-Chip Debugger 0.9.0-gd4b7679 (2014-10-03-00:26)
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
Error: unable to find CMSIS-DAP device

el puerto seleccionado 
 no existe o tu placa no esta conectada

Port doesn exist, it seems a configuration problem using the opencd loader.

Flashing a Sketch (with the wrong Arduino.org bootloader)

Open On-Chip Debugger 0.9.0-gd4b7679 (2014-10-03-00:26)
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
Error: unable to find CMSIS-DAP device
Error: No Valid JTAG Interface Configured.

This is not a surprise, Arduino Zero Pro has a non compatible Bootloader with Arduino IDE 1.6.5. That is the reason I need to burn a bootloader first.

Any help or Hint?

Well, I just "Burned the Bootloader" for my "M0_Pro programming port" with "Atmel EDBG" via the v1.6.5 IDE:

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: 0x81000000 pc: 0x00002d64 msp: 0x20007fa8
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x81000000 pc: 0x00000858 msp: 0x200023a0
** Programming Started **
auto erase enabled
wrote 16384 bytes from file C:\Users\David Prentice\AppData\Roaming\Arduino15\packages\arduino\hardware\samd\1.6.0/bootloaders/zero/samd21_sam_ba.bin in 2.205127s (7.256 KiB/s)
** Programming Finished **
** Verify Started **
verified 6328 bytes in 0.555032s (11.134 KiB/s)
** Verified OK **
** Resetting Target **

Occasionally, I install the M0 bootloader via the v1.7.6 IDE. I have had no problem swapping from one IDE to the other.

I do need to re-install the Zero bootloader after using Rowley Crossworks. As far as I can remember, Keil and AS6 use do not require a re-burn.

Does AS6 (or AS7) recognise your M0_Pro ?

David.

Windows USB driver support is a bit of a mess, especially with the sloppy work done in China and also by the unnamed Italian company.

You want to determine the VID (Vendor ID) and PID (Product ID) of the board they sent you. With it plugged into your computer, in the Control Panel under System you will find a way into the Device Manager, then under Ports(COM & LPT) you will find the USB Port of your board. I'm using Windows 7.1, Microsoft puts the Device Manager someplace else on different versions of Windows.

Now, right-click on properties and click on the Details tab. Under Property look at the "Device Instance Path", there you will find the VID, PID, and Serial Number of your board. The meaning of these is: VID = Vendor ID assigned by a trade group. 03EB (Hexadecimal) is the number assigned to Atmel, and 0403 is a value used by some SparkFun products. This value of 03EB is also used by many Arduino procucts. PID = Product ID is a number assigned by the Vendor. Atmel uses the values of VID = 03EB and PID = 2111 (hexadecimal) on their SAMD21 reference board. Serial = number used to assign the same driver to a board previously configured.

My genuine Arduino.cc Zero has a VID of 03EB and a PID of 2157 (hexadecimal).

Please post on this thread the VID and PID of your M0 Pro board, that information may help others who run into this problem.

I believe that the early production Arduino.org Zero product was a repackaged version of the Atmel reference board and used the same VID and PID. This has caused me no end of trouble.

Now, all the information you find in the Device Manager is stored in the Windows registry. You can change this information in the Device Manager or, if you are brave, with REGEDIT.

Use REGEDIT to examine the Windows Registry. The key will be under: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USB\

These entries were created from the .inf file that was used to first install the drivers for your board and are maintained by Windows in the files described in the comments by David Prentice. Among the things you can change is the file name of the device driver! If you are so bold as to make any changes here, you should keep a record of your changes (so as to back them out) and you will need to restart Windows before trying them.

My M0_Pro (printed Zero Pro on the pcb) running the Zero bootloader shows VID=0x03EB PID 0x2111 (USB Composite Device)

I have just replaced it with the M0 bootloader. And it shows the same VID and PID.

I have just built a sketch with the v1.7.6 IDE and uploaded it to my M0 Pro via the M0 bootloader.

So everything is interchangeable

I still have the box that my "Zero Pro" came in from Cool Components. The barcode label says: ZP0000158. This might be a model no. It might be a Serial no. The bottom of the pcb says: BOARD MODEL ZERO PRO R3

David.

Thanks for your answers, I use Arch Linux and not Windows, however these are my VID/PID numbers:

$lsusb
Bus 004 Device 005: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 004 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 004 Device 026: ID 03eb:2111 Atmel Corp.
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 2109:0811 VIA Labs, Inc. Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So the Vendor ID is Atmel Corporation (03eb), and Product ID is 2111

My Arduino M0 Pro from the unammed company is labelled “Arduino Zero Pro”, and has the print “Developed by ATMEL” on it. It has also the"Borad Model Zero Pro R3" print. It is exactly the same board as David, and one of the early units. :slightly_frowning_face:

If I try to get more information in linux I get the following error: Couldn’t open device, some information will be missing

lsusb -v -d 03eb:2111

Bus 004 Device 026: ID 03eb:2111 Atmel Corp. 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x03eb Atmel Corp.
  idProduct          0x2111 
  bcdDevice            1.01
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          130
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              4 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      35
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         1
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       2 Abstract (modem)
      bFunctionProtocol       1 AT-commands (v.25ter)
      iFunction               6 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              0 
      CDC Header:
        bcdCDC               1.10
      CDC ACM:
        bmCapabilities       0x06
          sends break
          line coding and serial state
      CDC Union:
        bMasterInterface        1
        bSlaveInterface         2 
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          2
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               8
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval             255

I will try now with a Windows Virtual Machine to check if this is an unix specific issue…

By the Way David: what do you mean in your question “Does AS6 (or AS7) recognise your M0_Pro ?”.

I don’t know the meaning of AS6 or AS7…

OK, the situation is much more clear: I installed Arduino.cc IDE in a virtual machine, and everything worked like a charm. I didn't have to edit the board.txt file to burn the bootloader and flash a sketch. This is strange, it worked selecting the Arduino.cc Zero Pro board.

I had to manually install the SAMD boards version (1.6.1), Both IDE versions are 1.6.5.

It seems there is something wrong with the 1.6.5 IDE in Linux, or more likely with my IDE configuration.

Ah-ha. Perhaps they are going to support the M0 Pro in the v1.6.5 IDE now. That is good news.

AS6 means Atmel Studio 6 IDE which runs on Windows machines. You should be able to run it in a Virtual Machine under Linux, but I would not hold your breath.

ATMEL-ICE or EDBG should be recognised by any ARM development environment e.g. Keil, Rowley, ... It should appear as a regular CMSIS-DAP debugger. The good news is that CMSIS-DAP is developed and supported by ARM. All that NXP, TI, ATMEL, ... have to do is compile it for their own chips. Which is why you get a consistent behaviour whether it is Atmel, Freescale, ... and you get a debugger thrown in with every $10 evaluation board.

David.