Plain M0 burning bootloader with 1.8.1 on windows 7

Hi@all

New in Arduino and programming in general, but very enthusiast! :)

I purchased a plain M0 board in a try to learn more things on programming. I have some difficulties on starting up so i'd like your help.

I downloaded the last version 1.8.1 before two days. I use windows 7 as an OS. The steps that i have followed until now are below¨

  1. I connected board's native usb port to an available usb port (com3) of my computer. A green light is steady on, and right next to it an orange led is blinking.

  2. From control panel i located the M0 board under ports, and manually loaded its driver from arduino's program driver folder.

  3. I open the program (1.8.1) and after installing SAM's related boards (board manager), i picked up the M0 board.

  4. I also choose the COM3 option under the same TOOLS tab.

  5. I opened the classic "blink" sketch and upload it to the board. After uploading finishes, a message appears that uploading completed with success. But nothing happens on the board. It is like nothing was uploaded.

Today i read about the lack of internal programmer on the board and that a bootloader has to be burned on it through an other programmer??!!

Is it possible for someone please to guide me with a step by step instructions on what to do? I really can not wait to upload my first sketch!

Thanks in advance! Jeg

I purchased a plain M0 board

What does that mean? Which one? From where? Most of the people selling M0 boards already have a bootloader on the SAMD21 board. Do they offer instructions? A board support package that you should have installed?

I connected board's native usb port to an available usb port (com3) of my computer.

That doesn't make any sense. USB port or COM port? Usually the "native USB port" on a "plain M0" board will upload over a USB connection, with the sketch offering a COM port as well, so you may need TWO drivers installed (one for the bootloader USB connection, one for the emulated COM port.)

Turn on "verbose" for compilation and uploading the the Arduino IDE preferences, try uploading BLINK again, and then copy and paste all the messages that were produced in a followup message here...

westfw:
What does that mean? Which one? From where?
Most of the people selling M0 boards already have a bootloader on the SAMD21 board.
Do they offer instructions? A board support package that you should have installed?

There are not any instructions that accompany the purchase, or any other helpful document.
i downloaded the arduino 1.8.1 software so to be able to upload a sketch even offline.

[/quote]

westfw:
That doesn’t make any sense. USB port or COM port? Usually the “native USB port” on a “plain M0” board will upload over a USB connection, with the sketch offering a COM port as well, so you may need TWO drivers installed (one for the bootloader USB connection, one for the emulated COM port.)

Perhaps it would be better to mention that i am a novice. I connected the micro usb connector at the M0 native usb port, and the other side to a USB port on my computer. The Software itself marks this port as COM3. I guess that COM1 and COM2 are my mouse and keyboard respectively. I just checked COM3 under the TOOLS<lpt ports menu. If i understood right, do i need a second driver to download?

[/quote]

westfw:
Turn on “verbose” for compilation and uploading the the Arduino IDE preferences, try uploading BLINK again, and then copy and paste all the messages that were produced in a followup message here…

Thank you sir. I’ll do it and post the messages…

I found on their web site the following:

USB port: To use this port, select “Arduino M0 (Native USB Port)” as your board in the Arduino IDE. The Native USB port is connected directly to the SAMD21. Connect the M0 Native USB port (the one closest to the reset button) to your computer. Opening and closing the Native port at 1200bps triggers a ‘soft erase’ procedure: the flash memory is erased and the board is restarted with the boot loader. Opening and closing the native port at a different baudrate will not reset the SAMD21.

I am not sure but i think that i saw a 9600 baudrate inside board’s driver tab on windows. I’ll check again after work.

Hi again, This is the error but in four parts as it is big. If there is a problem and needs to be deleted just tell me. Thanks

Arduino: 1.8.1 (Windows 7), Board: "Arduino M0"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Jeg\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Jeg\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Jeg\Documents\Arduino\libraries -fqbn=arduino:samd:mzero_bl -vid-pid=0X2A03_0X804E -ide-version=10801 -build-path C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0 -prefs=runtime.tools.CMSIS.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0 -prefs=runtime.tools.openocd.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.9.0-arduino5-static -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Jeg\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Jeg\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Jeg\Documents\Arduino\libraries -fqbn=arduino:samd:mzero_bl -vid-pid=0X2A03_0X804E -ide-version=10801 -build-path C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0 -prefs=runtime.tools.CMSIS.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0 -prefs=runtime.tools.openocd.path=C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.9.0-arduino5-static -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino Using board 'mzero_bl' from platform in folder: C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12 Using core 'arduino' from platform in folder: C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12 Detecting libraries used... "C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAM_ZERO -DARDUINO_ARCH_SAMD -D_SAMD21G18A_ -mthumb -DUSB_VID=0x2a03 -DUSB_PID=0x804e -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino M0"' "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0/CMSIS/Device/ATMEL/" "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\cores\arduino" "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\variants\arduino_mzero" "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\sketch\Blink.ino.cpp" -o "nul"

Generating function prototypes... "C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAM_ZERO -DARDUINO_ARCH_SAMD -D_SAMD21G18A_ -mthumb -DUSB_VID=0x2a03 -DUSB_PID=0x804e -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino M0"' "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0/CMSIS/Device/ATMEL/" "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\cores\arduino" "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\variants\arduino_mzero" "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\sketch\Blink.ino.cpp" -o "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\preproc\ctags_target_for_gcc_minus_e.cpp" "C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\preproc\ctags_target_for_gcc_minus_e.cpp" Compiling sketch... "C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAM_ZERO -DARDUINO_ARCH_SAMD -D_SAMD21G18A_ -mthumb -DUSB_VID=0x2a03 -DUSB_PID=0x804e -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino M0"' "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0/CMSIS/Device/ATMEL/" "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\cores\arduino" "-IC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\variants\arduino_mzero" "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\sketch\Blink.ino.cpp" -o "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\sketch\Blink.ino.cpp.o" Compiling libraries... Compiling core... Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\variant.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\pulse_asm.S.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\WInterrupts.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\cortex_handlers.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\delay.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\hooks.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\itoa.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\pulse.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\startup.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\wiring.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\wiring_analog.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\wiring_digital.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\wiring_private.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\wiring_shift.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\USB\samd21_host.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\avr\dtostrf.c.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\IPAddress.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\Print.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\Reset.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\RingBuffer.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\SERCOM.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\Stream.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\Tone.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\Uart.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\WMath.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\WString.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\abi.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\main.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\new.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\USB\CDC.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\USB\PluggableUSB.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\USB\USBCore.cpp.o Using previously compiled file: C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\core.a

Linking everything together... "C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-gcc" "-LC:\Users\Jeg\AppData\Local\Temp\arduino_build_64655" -Os -Wl,--gc-sections -save-temps "-TC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\variants\arduino_mzero/linker_scripts/gcc/flash_with_bootloader.ld" "-Wl,-Map,C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655/Blink.ino.map" --specs=nano.specs --specs=nosys.specs -mcpu=cortex-m0plus -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -o "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655/Blink.ino.elf" "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\sketch\Blink.ino.cpp.o" "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655\core\variant.cpp.o" -Wl,--start-group "-LC:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Lib/GCC/" -larm_cortexM0l_math -lm "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655/core\core.a" -Wl,--end-group "C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-objcopy" -O binary "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655/Blink.ino.elf" "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655/Blink.ino.bin" "C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655/Blink.ino.elf" "C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655/Blink.ino.hex"

Sketch uses 9552 bytes (3%) of program storage space. Maximum is 262144 bytes. Forcing reset using 1200bps open/close on port COM3 PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} PORTS {COM3, } / {COM3, } => {} Uploading using selected port: COM3 C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -v -patmega2560 -cstk500v2 -PCOM3 -b57600 -Uflash:w:C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655/Blink.ino.hex:i

avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM3 Using Programmer : stk500v2 Overriding Baud Rate : 57600 An error occurred while uploading the sketch

What the hell?

why is it trying to use avrdude to upload to a SAM board?

I found on their web site the following:

And a link to "their website" would be... ?

This is the error but in four parts as it is big. If there is a problem and needs to be deleted

That's fine. Perfect, even.

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -v -patmega2560 -cstk500v2 -PCOM3 -b57600 -Uflash:w:C:\Users\Jeg\AppData\Local\Temp\arduino_build_64655/Blink.ino.hex:i

why is it trying to use avrdude to upload to a SAM board?

Now THAT is a good question! And it carefully sets the chip type to atmega2560, as well! Well, that's what's wrong. Hmm. Mine does that too! That is in fact what the Arduino official boards.txt file says to do for that board name. https://github.com/arduino/ArduinoCore-samd/blob/master/boards.txt#L262 I have no idea why, though! (I also don't know what actual board hardware that entry is supposed to represent...)

try setting your board type to a MKRZero? The most likely bootloaders are all BOSSAC/SAMBA based...

westfw: try setting your board type to a MKRZero? The most likely bootloaders are all BOSSAC/SAMBA based...

I did it but gives me an error again. Do i also need to change the driver of M0 to a MKRZero?

....... Uploading using selected port: COM3 C:\Users\Jeg\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0/bossac.exe -i -d --port=COM3 -U true -i -e -w -v C:\Users\Jeg\AppData\Local\Temp\arduino_build_128316/Blink.ino.bin -R An error occurred while uploading the sketch

Following this, "Rescue guide for microcontroller ATSAMD21G18A" i managed to upload the sketch. For every sketch uploading needs a reset when appears the PORTS list on dashboard. This apply only to ATSAMD21G18A.