Crates.io | itsybitsy_m4 |
lib.rs | itsybitsy_m4 |
version | 0.9.0 |
source | src |
created_at | 2019-09-20 04:35:58.362929 |
updated_at | 2024-10-18 20:12:49.29156 |
description | Board Support crate for the Adafruit ItsyBitsy M4 Express |
homepage | |
repository | https://github.com/atsamd-rs/atsamd |
max_upload_size | |
id | 166127 |
size | 52,669 |
This crate provides a type-safe Rust API for working with the Adafruit ItsyBitsy M4 Express board.
rustup target add thumbv7em-none-eabihf
Check out the repository for examples:
https://github.com/atsamd-rs/atsamd/tree/master/boards/itsybitsy_m4/examples
cd boards/itsybitsy_m4
$ cargo hf2 --release --example blinky_basic
Finished release [optimized + debuginfo] target(s) in 0.19s
Searching for a connected device with known vid/pid pair.
Trying Ok(Some("Adafruit Industries")) Ok(Some("PyBadge"))
Flashing "/Users/User/atsamd/boards/itsybitsy_m4/target/thumbv7em-none-eabihf/release/examples/blinky_basic"
Finished in 0.079s
$
Note some examples will tell you they need more features enabled
$ cargo hf2 --release --example usb_serial
error: target `usb_serial` in package `itsybitsy_m4` requires the features: `usb`
Consider enabling them by passing, e.g., `--features="usb"`
Just follow the instructions to add --features like
cargo hf2 --release --example usb_serial --features="usb"
Finished release [optimized + debuginfo] target(s) in 0.09s
Searching for a connected device with known vid/pid pair.
Trying Ok(Some("Adafruit Industries")) Ok(Some("PyBadge"))
Flashing "/Users/User/atsamd/boards/itsybitsy_m4/target/thumbv7em-none-eabihf/release/examples/usb_serial"
Finished in 0.167s
$
If you are on Linux and hf2 fails to flash your board even if it is connected and in bootloader mode, you
might need to add some udev
rules if you have not done that yet.
The example for adafruit boards is shown here.
You might want to have all the hf2 related rules in a single file, i.e. /etc/udev/rules.d/99-hf2-boards.rules
, or have
a different rules file for each vendor. The rules for Adafruit boards look like this:
#adafruit rules
ATTRS{idVendor}=="239a", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idVendor}=="239a", MODE="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="239a", MODE="0666"
After adding the rules remember to reboot or run:
sudo udevadm control --reload-rules
sudo udevadm trigger
For more information on hf2 and other methods of uploading your code, take a look at the base project README.