I checked out that repo, and using the steps provided was able to get close. However, I could not get my device to be found, both with and without putting the board into bootloader mode.
~/repos/atsamd/boards/feather_m0 $ cargo hf2 --release --example blinky_basic
warning: unused import: `IntoFunction`
--> src/lib.rs:17:29
|
17 | use gpio::{Floating, Input, IntoFunction, PfC, Port};
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Finished release [optimized + debuginfo] target(s) in 0.14s
Searching for a connected device with known vid/pid pair.
thread 'main' panicked at 'Are you sure device is plugged in and in bootloader mode?', src/libcore/option.rs:1188:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
I can see the device in Mac's system report (I tried specifying the pid and vid, same issue). I am able to program the board normally using the Arduino IDE if I download Adafruit's board libraries, so the problem isn't hardware related.
I think the problem here is that hidapi's Mac implementation doesn't support devices like this (I compiled that library's test GUI, and sure enough the device is not found). So while this isn't an issue with rust specifically, I imagine this community might have been more likely to have also had a problem like this, and was hoping someone could provide insight. Either a way to work around this, or to explain if there is something important that I'm missing here.
I think I have made some progress on this. One thing I noticed is that according to Adafruit, the Feather M0 does not seem to support HF2, however the Feather M0 Express does (or perhaps I just have an older Feather M0, and newer ones use HF2).
Either way, I stopped going down that route, and instead using bossac.
Ok, I realized my problem. The offset needed to be 0x2000, not 0x4000 (the Feather has a 8K bootloader in memory, but I copy and pasted from the Feather M4, which has a 16K).
Thus, here is what I was able to do to get it working.