Unable to [re]program the SparkFun SAMD21 Mini Breakout bootloader

I was experimenting with using the Arduino IDE (and a Microchip/Atmel) ICE to [re]program a SparkFun SAMD21 mini breakout board’s bootloader.

I set the board type to “SparkFun SAMD21 mini breakout”, selected “Atmel SAM-ICE” as the programmer, and then selected “Burn Bootloader” in the Arduino IDE Tools menu.

The Arduino IDE successfully started the Open On-Chip Debugger, configured the Atmel SAM-ICE programmer, and attempted to program the SAMD21 mini breakout with the bootloader binary… and then immediately returned the following error:

Error: couldn’t open {/Users/kxxxxx/Library/Arduino15/packages/SparkFun/hardware/samd/1.8.6/bootloaders/zero/SparkFun_SAMD21_Dev.bin}

embedded:startup.tcl:477: Error: ** Programming Failed **

in procedure ‘program’

in procedure ‘program_error’ called at file “embedded:startup.tcl”, line 536

Given that a file named “SparkFun_SAMD21_Dev.bin}” is in the samd/1.8.6/bootloaders/zero/ directory, I thought that the problem wasn’t specific to the “SparkFun SAMD21 mini breakout”. I attempted to confirm this by programming the SAMD21 mini breakout board using the Arduino Zero bootloader. I followed the exact same steps as above, except that I selected “Arduino Zero (Native USB Port)” as the board type.

Good news! I was able to program the SAMD21 mini breakout with the Arduino Zero bootloader.

Bad news! I’m still not able to program the SparkFun SAMD21 mini breakout board with the SparkFun_SAMD21_Dev.bin bootloader; I continue to get the unable to open error:

Error: couldn’t open {/Users/kxxxxx/Library/Arduino15/packages/SparkFun/hardware/samd/1.8.6/bootloaders/zero/SparkFun_SAMD21_Dev.bin}

Any thoughts on why the Arduino IDE is getting an unable to open error with the SparkFun_SAMD21_Dev.bin file when (a) said file does exist and (b) I am able to successfully program the Arduino Zero bootloader (into the SparkFun SAMD21 mini breakout board)?

As I say, the SparkFun_SAMD21_Dev.bin file does exist:

ls -la /Users/kxxxxx/Library/Arduino15/packages/SparkFun/hardware/samd/1.8.6/bootloaders/zero/SparkFun_SAMD21_Dev.bin

-rw-r–r-- 1 kxxxxx staff 6604 Jun 17 2021 /Users/kxxxxx/Library/Arduino15/packages/SparkFun/hardware/samd/1.8.6/bootloaders/zero/SparkFun_SAMD21_Dev.bin

Thanks,

K.

Can you test the same setup on a different machine/PC?

Also, is the ‘double-tap’ being used to enter bootloader mode? https://learn.sparkfun.com/tutorials/sa … leshooting

Also be sure the IDE is pointing to the right files/has the necessary stuff mentioned here https://learn.sparkfun.com/tutorials/sa … up-arduino

3rd idea is the IDE might have something screwy going on (sometimes it get lost!); it can also be helpful to uninstall/wipe/reload all of the IDE folder’s contents like so https://support.arduino.cc/hc/en-us/art … rduino-IDE

Hi TS-Russell,

Thanks for the reply!

Unfortunately the “double tap to enter bootloader mode” recommendation, and the linked article, have to do with resolving issues with uploading a sketch to the SparkFun SAMD21 Mini Breakout board, NOT with burning a bootloader into the SparkFun SAMD21 Mini Breakout board.

To be clear: I don’t have problems uploading a sketch to the SparkFun SAMD21 Mini Breakout board. I can upload a sketch to the SparkFun SAMD21 Mini Breakout board without difficulty.

Rather, the problem I’m having is that I’m not able to burn the SparkFun SAMD21 Mini Breakout bootloader into the Mini Breakout board.

The error reported in the Arduino IDE is that there’s a problem with opening the SparkFun SAMD21 Mini Breakout bootloader .bin file:

Error: couldn’t open {/Users/kxxxxx/Library/Arduino15/packages/SparkFun/hardware/samd/1.8.6/bootloaders/zero/SparkFun_SAMD21_Dev.bin}

I’ve uninstalled and reinstalled (several times) the SparkFun SAMD21 board files using the Arduino board manager. This made no difference; I continue to get the “unable to open [bootloader .bin file]” error message when trying to burn the SparkFun SAMD21 Mini Breakout bootloader into the SparkFun SAMD21 Mini Breakout board.

But, since you replied, I’ll give what you recommended (double tapping reset to enter bootloader mode) a try… … nope, no change.

Even when I double tap the reset button prior to attempting to burn the bootloader I [still] get the:

“couldn’t open …/packages/SparkFun/hardware/samd/1.8.6/bootloaders/zero/SparkFun_SAMD21_Dev.bin” error message

when I try to burn the SparkFun SAMD21 Mini Breakout bootloader into a SparkFun SAMD21 Mini Breakout board.

To reiterate what I described in my first post:

• I am NOT able to (using an Atmel SAM ICE) burn the SPARKFUN SAMD21 Mini Breakout bootloader (located in …packages/SparkFun/hardware/samd/1.8.6/bootloaders/zero/SparkFun_SAMD21_Dev.bin) to a SparkFun SAMD21 Mini Breakout board.

• I AM able to (using an Atmel SAM ICE) burn the ARDUINO Zero Bootloader into the SparkFun SAMD21 Mini Breakout board.

As it happens, I happen to have two SparkFun SAMD21 Mini Breakout boards. A quick check with the second board produces the exact same "unable to open [bootloader .bin file] error when I attempt to burn the SparkFun SAMD21 Mini Breakout bootloader.

The fact that (a) the error message indicates there’s a problem opening the bootloader .bin file and (b) I can burn the Arduino Zero bootloader into the SparkFun SAMD21 Mini Breakout board but not the SparkFun SAMD21 Mini Breakout bootloader, and (c ) this problem occurs with two different SparkFun SAMD21 Mini Breakout boards suggests that:

  1. There isn’t a problem with the Arduino IDE

  2. There isn’t a problem with the Atmel SAM ICE

  3. There isn’t a problem with the SparkFun SAMD21 Mini Breakout boards

Given that there’s no problem with the IDE, Atmel SAM ICE, or SparkFun SAMD21 Mini Breakout boards suggests (but it certainly doesn’t prove :slight_smile: that there’s something amiss with the zero/SparkFun_SAMD21_Dev.bin bootloader file that was downloaded by the Arduino IDE board manager.

Given that uninstalling and reinstalling the SparkFun SAMD21 board files doesn’t make a difference, this leads me to wonder if there’s something amiss with the SparkFun SAMD21 Mini Breakout bootloader .bin file stored in/on the SparkFun server, not with the bootloader .bin file that was installed on my system… or perhaps the file is somehow being corrupted during during download by the Arduino IDE board manager.

Do you have a SparkFun SAMD21 Mini Breakout board and an Atmel SAM ICE?

If you do, please try using the Arduino IDE 1.8.19 to burn the SparkFun SAMD21 Mini Breakout bootloader into the SparkFun SAMD21 Mini breakout board.

If you’re successfully able to burn the bootloader please post the verbose output showing the Open On-Chip debugger successfully burning the SparkFun SAMD21 Mini Breakout bootloader into the SparkFun SAMD21 Mini breakout board and also attach the /zero/SparkFun_SAMD21_Dev.bin from your environment to your response. If you’re successfully burning the bootloader than this suggests that the problem isn’t with the bootloader .bin file on the SparkFun server, but that it’s being corrupted during the download process.

Best regards,

K.