Interrupt

Programming the ATSAMD21 with IBDAP

In the process of porting a blog post from the retired Arduino M0 Pro to Adafruit’s excellent Metro M0 Express, I ran into a few issues and scant amount of documentation. I’m writing this for the next poor soul wrestling with these systems.


This is a companion discussion topic for the original entry at https://interrupt.memfault.com/blog/getting-started-with-ibdap-and-atsamd21g18

First off, I’m really enjoying the first few posts here on Interrupt! Thank you for taking the time to publish clear guides on these topics.

A couple of comments on the above post:
First up, it took me way longer than I’d care to admit to figure out how to use the openocd.cfg you created in the post. For anyone who is eqaully clueless, you can stick the cfg file whereever you plan on running openocd from, and you use the command

    openocd -f openocd.cfg

to actually run it.

Also, I found that on my system, I needed to combine the following lines:

# Flash the firmware
program your-firmware-file.bin
# Read it back and verify it
verify
# Reset the board
reset

into a single line:

program your-firmware-file.bin verify reset

To properly execute the verification and target reset. It gave an error otherwise.

I’m really looking forward to seeing the rest of this series!

Thanks for the comment @ssvt! I’ll update the post with your suggestions this week. Note that you can also submit edits directly on Github!