Can't burn bootloader with Atmel ICE

Arduino: 1.6.5 (Windows 7), Board: "Arduino Zero (Native USB Port)"

Error while burning bootloader: missing 'bootloader.tool' configuration parameter

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

I've selected Arduino Zero native port for the board, and I've selected programmer Atmel-ICE. I get the above error message when trying to burn the bootloader from within the IDE.

Atmel Studio also does not recognize the .BIN file supplied so I can't burn it that way either.

I'm using a board of my own design that features the SAMD21 processor, so burning the bootloader using the EDBG chip isn't an option.

Hm, I found preferences.txt and noticed the configuration options looked suspiciously like that 'bootloader.tool' thing, and I noticed a line 'programmer=arduino:atmel_ice', so I tried adding 'bootloader.tool=arduino:atmel_ice' to the file, but unfortunately it didn't work, and I got the following error message:

Arduino: 1.6.5 (Windows 7), Board: "Arduino Zero (Native USB Port)"

Could not find tool atmel_ice from package arduino

I found that in
C:\Users\USERNAME\AppData\Roaming\Arduino15\packages\arduino\hardware\samd\1.6.0\boards.txt

there are probably missing 2 lines (?)
at the end of the part for the "Arduino Zero (Native USB Port)"
try to add:
arduino_zero_native.bootloader.tool=openocd
arduino_zero_native.bootloader.file=zero/samd21_sam_ba.bin

just a try, can not test it here

I'll try that.

In the meantime, I think I managed to burn it succesfully with Atmel Studio after converting the .bin file to a .hex using this tool:

http://www.ht-lab.com/freeutils/bin2hex/bin2hex.html

Windows detected a device when the board powered up and it said Arduino Zero Bootloader, so it's probably working, though I don't know if all the fuses are set right. I'd set them to match the Zero Pro.

I think you may use the tool
C:\Users\USERNAME\AppData\Roaming\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\bin\arm-none-eabi-objcopy.exe
on a commandline as well to do a bin2hex conversion...

Please let us know if you can upload a sketch now to your custom-board, using the "normal way" with the Arduino IDE (using "Arduino Zero native port")

Dirk:
That worked, thanks!

I just tested uploading with the blink and an OLED demo and it works with both the Atmel ICE and USBasp through the native port.

Burning the bootloader also worked once I added those two lines to the native section of boards.txt.

Fix pushed upstream, thank you!

guys, can you please help with this case?

In the meantime, I think I managed to burn it succesfully with Atmel Studio after converting the .bin file to a .hex using this tool:

http://www.ht-lab.com/freeutils/bin2hex/bin2hex.html

I`m trying to convert .bin to .hex using program you recommended, and this is what i get.

C:\Users\mOSKit\Desktop\SAM21D bootloader files\bin2hex>BIN2HEX [samd21_sam_ba.b
in] [samd21_sam_ba.hex]

BIN2HEX Ver 1.1 HABT05

Error cannot open input file : [samd21_sam_ba.bin]

I have also tried using arduino ide with the same result as first post

Error while burning bootloader: missing 'bootloader.tool' configuration parameter

any suggestions??

mOskit:
guys, can you please help with this case?I`m trying to convert .bin to .hex using program you recommended, and this is what i get.

I have also tried using arduino ide with the same result as first post
any suggestions??

Dirk67 posted the solution above:

I found that in
C:\Users\USERNAME\AppData\Roaming\Arduino15\packages\arduino\hardware\samd\1.6.0\boards.txt

there are probably missing 2 lines (?)
at the end of the part for the "Arduino Zero (Native USB Port)"
try to add:
arduino_zero_native.bootloader.tool=openocd
arduino_zero_native.bootloader.file=zero/samd21_sam_ba.bin

That's all that needs to be done to get the bootloader to burn from within the IDE.

I don't know what's wrong with the bintohex tool. I got it to work but I don't remember how. It wasn't difficult though, it just worked the first time.

i see where i made mistake. i downloaded those files from github

burning the SAM-BA bootloader with an external programmer (e.g. Atmel-ICE) [Zero] · Issue #7 · arduino/ArduinoCore-samd · GitHub
Added missing bootloader key/value pair in boards.txt · arduino/ArduinoCore-samd@8c4c3b9 · GitHub

and they had those lines included, as i found that file through win search.

But i should really change that file which is within board manager.

Do you guys know, when you use board manager to download M0 boards into IDE 1.6.5, where are they actually stored??
I cant really see where they are, i guess

C:\Users\USERNAME\AppData\Roaming\Arduino15\packages\arduino\hardware\samd\1.6.0\boards.txt

is from WINXP.

I'm using Windows 7. The AppData directory is hidden so you'd have to enable hidden folders in explorer to see it when you go to the user directory.

My Arduino directory for example is:
C:\Users\Shawn\AppData\Roaming\Arduino15

I just made a shortcut to it on my desktop because I got tired of browsing to it.

The AppData directory is hidden so you'd have to enable hidden folders in explorer to see it when you go to the user directory.

this is why i could not find AppData in my folder.

thanks

Can any one please explain what`s might be wrong??JTAGICE3 upgraded swd supported

C:\Users\mOSKit\AppData\Roaming\Arduino15\packages\arduino\tools\openocd\0.9.0-arduino/bin/openocd.exe -d2 -s C:\Users\mOSKit\AppData\Roaming\Arduino15\packages\arduino\tools\openocd\0.9.0-arduino/share/openocd/scripts/ -f C:\Users\mOSKit\AppData\Roaming\Arduino15\packages\arduino\hardware\samd\1.6.0/variants/arduino_zero/openocd_scripts/arduino_zero.cfg -c telnet_port disabled; init; halt; at91samd bootloader 0; program {{C:\Users\mOSKit\AppData\Roaming\Arduino15\packages\arduino\hardware\samd\1.6.0/bootloaders/zero/samd21_sam_ba.bin}} verify reset; shutdown
Open On-Chip Debugger 0.9.0-gd4b7679 (2015-06-10-22:24)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
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 = 03.25.0042
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
in procedure 'init'
in procedure 'ocd_bouncer'

Error while burning bootloader.

Hi,

I have the same error. Did you figured out?

scswift:
Dirk:
That worked, thanks!

I just tested uploading with the blink and an OLED demo and it works with both the Atmel ICE and USBasp through the native port.

Burning the bootloader also worked once I added those two lines to the native section of boards.txt.

Hello,
Can you post all streps, how can I use Atmel ICE to burn bootloader.
Thx in advance

You don't need anything. From the IDE. Just select EDBG as programmer in Tools. Select Burn Bootloader. Job done.

If I have been using Keil or Rowley to program my M0 Pro, it is generally necessary to re-install the bootloader. I can't remember with AS7. But it is not too much of an imposition to do one mouse click for the "Burn".

David.

oky, thx :slight_smile:
i will try :wink:

in my case doesn't work
i don't have EDBG programmer in Tools
please someone make zip file with arduino including all modifying file

i don't have EDBG programmer in Tools
please someone make zip file with arduino including all modifying file

That would be the Arduino IDE install. If you don't have "Atmel EDBG" in the Tools/Programmer menu, then it's not installed correctly. (Don't forget that you'll have to install the samd package with the board manager, after installing the main IDE.)

Finally I burn the bootloader successfully
So:

step 1.
I used Arduino M0 Pro as Programer, i de-soldered the 0 ohm resistor from SWCLK, and SWDIO and also I de-soldered 330 ohm from reset pin,
step 2.
I connected SWCLK, SWDIO, RESET, VCC and GND from blank IC to 2x5 PROGRAMMING PINHEAD.

Using Arduino 1.6.7
I select board Arduino zero native usb
after this i select programmer and BURN
DONE!!