From b0b054b932092604bff0a7c2f0f22c13fa11f683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karsten=20Gro=C3=9Fe?= Date: Tue, 3 Nov 2020 23:10:13 +0100 Subject: [PATCH 1/4] Added Arduino Zero support --- boards/arduino_zero/.cargo/config | 10 ++ boards/arduino_zero/Cargo.toml | 55 +++++++ boards/arduino_zero/README.md | 22 +++ boards/arduino_zero/build.rs | 16 +++ boards/arduino_zero/examples/blinky_basic.rs | 32 +++++ boards/arduino_zero/examples/pwm.rs | 48 +++++++ boards/arduino_zero/examples/usb_logging.rs | 105 ++++++++++++++ boards/arduino_zero/memory.x | 5 + boards/arduino_zero/src/lib.rs | 142 +++++++++++++++++++ crates.json | 3 + 10 files changed, 438 insertions(+) create mode 100644 boards/arduino_zero/.cargo/config create mode 100644 boards/arduino_zero/Cargo.toml create mode 100644 boards/arduino_zero/README.md create mode 100644 boards/arduino_zero/build.rs create mode 100644 boards/arduino_zero/examples/blinky_basic.rs create mode 100644 boards/arduino_zero/examples/pwm.rs create mode 100644 boards/arduino_zero/examples/usb_logging.rs create mode 100644 boards/arduino_zero/memory.x create mode 100644 boards/arduino_zero/src/lib.rs diff --git a/boards/arduino_zero/.cargo/config b/boards/arduino_zero/.cargo/config new file mode 100644 index 000000000000..a7d171f51437 --- /dev/null +++ b/boards/arduino_zero/.cargo/config @@ -0,0 +1,10 @@ +# samd21 is a Cortex-M0 and thus thumbv6m + +[build] +target = "thumbv6m-none-eabi" + +[target.thumbv6m-none-eabi] +runner = 'arm-none-eabi-gdb' +rustflags = [ + "-C", "link-arg=-Tlink.x", +] diff --git a/boards/arduino_zero/Cargo.toml b/boards/arduino_zero/Cargo.toml new file mode 100644 index 000000000000..779250395eea --- /dev/null +++ b/boards/arduino_zero/Cargo.toml @@ -0,0 +1,55 @@ +[package] +name = "arduino_zero" +version = "0.8.1" +authors = ["Karsten Große "] +description = "Board Support crate for the Arduino ZERO" +keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"] +license = "MIT OR Apache-2.0" +repository = "https://github.com/atsamd-rs/atsamd" +readme = "README.md" + +[dependencies] +cortex-m = "0.6" +embedded-hal = "0.2.3" +nb = "0.1" + +[dependencies.cortex-m-rt] +version = "0.6.12" +optional = true + +[dependencies.panic-halt] +version = "0.2" +optional = true + +[dependencies.atsamd-hal] +path = "../../hal" +version = "0.10" +default-features = false + +[dependencies.usb-device] +version = "0.2" +optional = true + +[dependencies.usbd-serial] +version = "0.1" +optional = true + +[features] +# ask the HAL to enable atsamd21g support +default = ["rt", "panic_halt", "atsamd-hal/samd21g", "usb"] +rt = ["cortex-m-rt", "atsamd-hal/samd21g-rt"] +usb = ["atsamd-hal/usb", "usb-device", "usbd-serial"] +panic_halt = ["panic-halt"] +unproven = ["atsamd-hal/unproven"] +use_semihosting = [] + +[[example]] +name = "blinky_basic" + +[[example]] +name = "usb_logging" +required-features = ["usb"] + +[[example]] +name = "pwm" +required-features = ["unproven"] diff --git a/boards/arduino_zero/README.md b/boards/arduino_zero/README.md new file mode 100644 index 000000000000..07ce63641a90 --- /dev/null +++ b/boards/arduino_zero/README.md @@ -0,0 +1,22 @@ +# Arduino Mkrzero Board Support Crate + +This crate provides a type-safe API for working with the [Arduino mkrzero board](https://store.arduino.cc/arduino-mkrzero). + +## Examples +### Blinky Basic +#### Requirements + - Arduino IDE installed + - samd package installed + - Now the arduino distribution contains bossac.exe in `ArduinoData/packages/arduino/tools/bossac/1.7.0/` add it to your path + - `ArduinoData` is likely something like `~/.arduino15/` + - Probably best to install an example sketch via the IDE just to make sure everything is working + - Note that the [arduino cli](https://github.com/arduino/arduino-cli) (or just regular bossac) may soon replace this section + - arm-none-eabi tools installed, you need gcc and objcopy. + - thumbv6m-none-eabi rust target installed via `rustup target add thumbv6m-none-eabi` + +#### Steps +```bash +cargo build --release --example blinky_basic +arm-none-eabi-objcopy -O binary target/thumbv6m-none-eabi/release/examples/blinky_basic target/blinky_basic.bin +bossac -i -d -U true -i -e -w -v target/blinky_basic.bin -R +``` diff --git a/boards/arduino_zero/build.rs b/boards/arduino_zero/build.rs new file mode 100644 index 000000000000..4bed4688f2c0 --- /dev/null +++ b/boards/arduino_zero/build.rs @@ -0,0 +1,16 @@ +use std::env; +use std::fs::File; +use std::io::Write; +use std::path::PathBuf; +fn main() { + if env::var_os("CARGO_FEATURE_RT").is_some() { + let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); + File::create(out.join("memory.x")) + .unwrap() + .write_all(include_bytes!("memory.x")) + .unwrap(); + println!("cargo:rustc-link-search={}", out.display()); + println!("cargo:rerun-if-changed=memory.x"); + } + println!("cargo:rerun-if-changed=build.rs"); +} diff --git a/boards/arduino_zero/examples/blinky_basic.rs b/boards/arduino_zero/examples/blinky_basic.rs new file mode 100644 index 000000000000..f4051f10025f --- /dev/null +++ b/boards/arduino_zero/examples/blinky_basic.rs @@ -0,0 +1,32 @@ +#![no_std] +#![no_main] + +extern crate arduino_mkrzero as hal; + +use hal::clock::GenericClockController; +use hal::delay::Delay; +use hal::entry; +use hal::pac::{CorePeripherals, Peripherals}; +use hal::prelude::*; + +#[entry] +fn main() -> ! { + let mut peripherals = Peripherals::take().unwrap(); + let core = CorePeripherals::take().unwrap(); + let mut clocks = GenericClockController::with_external_32kosc( + peripherals.GCLK, + &mut peripherals.PM, + &mut peripherals.SYSCTRL, + &mut peripherals.NVMCTRL, + ); + let mut pins = hal::Pins::new(peripherals.PORT); + let mut led = pins.led_builtin.into_open_drain_output(&mut pins.port); + let mut delay = Delay::new(core.SYST, &mut clocks); + + loop { + delay.delay_ms(200u8); + led.set_high().unwrap(); + delay.delay_ms(200u8); + led.set_low().unwrap(); + } +} diff --git a/boards/arduino_zero/examples/pwm.rs b/boards/arduino_zero/examples/pwm.rs new file mode 100644 index 000000000000..720bef65fd06 --- /dev/null +++ b/boards/arduino_zero/examples/pwm.rs @@ -0,0 +1,48 @@ +#![no_std] +#![no_main] + +extern crate arduino_mkrzero as hal; +extern crate atsamd_hal; + +use hal::clock::{GenericClockController, Tcc0Tcc1Clock}; +use hal::delay::Delay; +use hal::entry; +use hal::pac::{CorePeripherals, Peripherals}; +use hal::prelude::*; +use hal::pwm::{Channel, Pwm0}; + +#[entry] +fn main() -> ! { + let mut peripherals = Peripherals::take().unwrap(); + let core = CorePeripherals::take().unwrap(); + let mut clocks = GenericClockController::with_external_32kosc( + peripherals.GCLK, + &mut peripherals.PM, + &mut peripherals.SYSCTRL, + &mut peripherals.NVMCTRL, + ); + let mut delay = Delay::new(core.SYST, &mut clocks); + let mut pins = hal::Pins::new(peripherals.PORT); + + // PWM0_CH1 is A4 on the board - pin 19 or PA05 + // see: https://github.com/arduino/ArduinoCore-samd/blob/master/variants/mkrzero/variant.cpp + let _a4 = pins.a4.into_function_e(&mut pins.port); + let gclk0 = clocks.gclk0(); + + let tcc0_tcc1_clock: &Tcc0Tcc1Clock = &clocks.tcc0_tcc1(&gclk0).unwrap(); + + let mut pwm0 = Pwm0::new( + &tcc0_tcc1_clock, + 1.khz(), + peripherals.TCC0, + &mut peripherals.PM, + ); + let max_duty = pwm0.get_max_duty(); + pwm0.enable(Channel::_1); + loop { + pwm0.set_duty(Channel::_1, max_duty); + delay.delay_ms(500u16); + pwm0.set_duty(Channel::_1, max_duty / 4); + delay.delay_ms(500u16); + } +} diff --git a/boards/arduino_zero/examples/usb_logging.rs b/boards/arduino_zero/examples/usb_logging.rs new file mode 100644 index 000000000000..afea793bb016 --- /dev/null +++ b/boards/arduino_zero/examples/usb_logging.rs @@ -0,0 +1,105 @@ +#![no_std] +#![no_main] + +extern crate arduino_mkrzero as hal; +extern crate cortex_m; +extern crate panic_halt; +extern crate usb_device; +extern crate usbd_serial; + +use hal::clock::GenericClockController; +use hal::delay::Delay; +use hal::entry; +use hal::pac::{interrupt, CorePeripherals, Peripherals}; +use hal::prelude::*; + +use hal::usb::UsbBus; +use usb_device::bus::UsbBusAllocator; +use usb_device::prelude::*; +use usbd_serial::{SerialPort, USB_CLASS_CDC}; + +use cortex_m::peripheral::NVIC; + +static mut USB_ALLOCATOR: Option> = None; +static mut USB_BUS: Option> = None; +static mut USB_SERIAL: Option> = None; + +#[entry] +fn main() -> ! { + let mut peripherals = Peripherals::take().unwrap(); + let mut core = CorePeripherals::take().unwrap(); + let mut clocks = GenericClockController::with_external_32kosc( + peripherals.GCLK, + &mut peripherals.PM, + &mut peripherals.SYSCTRL, + &mut peripherals.NVMCTRL, + ); + let mut pins = hal::Pins::new(peripherals.PORT); + let mut led = pins.led_builtin.into_open_drain_output(&mut pins.port); + let mut delay = Delay::new(core.SYST, &mut clocks); + + let bus_allocator = unsafe { + USB_ALLOCATOR = Some(hal::usb_allocator( + peripherals.USB, + &mut clocks, + &mut peripherals.PM, + pins.usb_n, // PA24, also usb_dm + pins.usb_p, // PA24 also usb_dp + &mut pins.port, + )); + USB_ALLOCATOR.as_ref().unwrap() + }; + + unsafe { + USB_SERIAL = Some(SerialPort::new(&bus_allocator)); + USB_BUS = Some( + UsbDeviceBuilder::new(&bus_allocator, UsbVidPid(0x2222, 0x3333)) + .manufacturer("Fake company") + .product("Serial port") + .serial_number("TEST") + .device_class(USB_CLASS_CDC) + .build(), + ); + } + + unsafe { + core.NVIC.set_priority(interrupt::USB, 1); + NVIC::unmask(interrupt::USB); + } + + loop { + delay.delay_ms(200u8); + led.set_high().unwrap(); + delay.delay_ms(200u8); + led.set_low().unwrap(); + + // Turn off interrupts so we don't fight with the interrupt + cortex_m::interrupt::free(|_| unsafe { + USB_BUS.as_mut().map(|_| { + USB_SERIAL.as_mut().map(|serial| { + // Skip errors so we can continue the program + let _ = serial.write("log line\r\n".as_bytes()); + }); + }) + }); + } +} + +fn poll_usb() { + unsafe { + USB_BUS.as_mut().map(|usb_dev| { + USB_SERIAL.as_mut().map(|serial| { + usb_dev.poll(&mut [serial]); + + // Make the other side happy + let mut buf = [0u8; 16]; + let _ = serial.read(&mut buf); + }); + }); + }; +} + +#[interrupt] +fn USB() { + poll_usb(); +} diff --git a/boards/arduino_zero/memory.x b/boards/arduino_zero/memory.x new file mode 100644 index 000000000000..6416b4b9d025 --- /dev/null +++ b/boards/arduino_zero/memory.x @@ -0,0 +1,5 @@ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 /* bootloader 8kb */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} diff --git a/boards/arduino_zero/src/lib.rs b/boards/arduino_zero/src/lib.rs new file mode 100644 index 000000000000..b31441cd8ea8 --- /dev/null +++ b/boards/arduino_zero/src/lib.rs @@ -0,0 +1,142 @@ +#![no_std] + +extern crate atsamd_hal as hal; + +#[cfg(feature = "rt")] +extern crate cortex_m_rt; +#[cfg(feature = "rt")] +pub use cortex_m_rt::entry; + +#[cfg(feature = "panic_halt")] +pub extern crate panic_halt; + +#[cfg(feature = "usb")] +use hal::clock::GenericClockController; +#[cfg(feature = "usb")] +use hal::usb::usb_device::bus::UsbBusAllocator; +#[cfg(feature = "usb")] +pub use hal::usb::UsbBus; + +use hal::prelude::*; +use hal::*; + +pub use hal::common::*; +pub use hal::samd21::*; +pub use hal::target_device as pac; + +use gpio::{Floating, Input, Port}; + +// The docs could be further improved with details of the specific channels etc +define_pins!( + /// Maps the pins to their arduino names and the numbers printed on the board. + /// Information from: + struct Pins, + target_device: target_device, + + /// Digital 2: TC + pin d2 = a14, + + /// Digital 3: PWM, TCC + pin d3 = a9, + + /// Digital 4: PWM + pin d4 = a8, + + /// Digital 5: PWM + pin d5 = a15, + + /// Digital 6: PWM + pin d6 = a20, + + /// Digital 7: PWM, TCC + pin d7 = a21, + + /// Digital 8: PWM + pin d8 = a6, + + /// Digital 9: PWM + pin d9 = a7, + + /// Digital 9: PWM + pin d10 = a18, + + /// SPI MOSI: PWM, TCC + pin mosi = a16, + + /// SPI SCK + pin sck = a17, + + /// SPI MISO: PWM, TC + pin miso = a19, + + /// SDA + pin sda = a22, + + /// SCL + pin scl = a23, + + /// RX + pin rx = a11, + + /// TX + pin tx = a10, + + /// Analog 0: DAC + pin a0 = a2, + + /// Analog 1 + pin a1 = b8, + + /// Analog 2 + pin a2 = b9, + + /// Analog 3: PWM, TCC + pin a3 = a4, + + /// Analog 4: PWM, TCC + pin a4 = a5, + + /// Analog 5 + pin a5 = b2, + + pin usb_n = a24, + pin usb_p = a25, + pin usb_id = a18, + pin aref = a3, + pin sd_sck = a12, + pin sd_mosi = a13, + pin sd_ss = a14, + pin sd_miso = a15, + pin sd_cd = a27, + + /// LED built into the board + pin led_builtin = a17, + pin tx_led = a27, + pin rx_led = b3, + + pin xin32 = a0, + pin xout32 = a1, +); + +#[cfg(feature = "usb")] +pub fn usb_allocator( + usb: pac::USB, + clocks: &mut GenericClockController, + pm: &mut pac::PM, + dm: gpio::Pa24>, + dp: gpio::Pa25>, + port: &mut Port, +) -> UsbBusAllocator { + use gpio::IntoFunction; + + let gclk0 = clocks.gclk0(); + let usb_clock = &clocks.usb(&gclk0).unwrap(); + + UsbBusAllocator::new(UsbBus::new( + usb_clock, + pm, + dm.into_function(port), + dp.into_function(port), + usb, + )) +} diff --git a/crates.json b/crates.json index f23f45a4822b..e203402fe699 100644 --- a/crates.json +++ b/crates.json @@ -9,6 +9,9 @@ "arduino_mkrzero": { "build": "cargo build --examples --features=unproven,usb" }, + "arduino_zero": { + "build": "cargo build --examples --features=unproven,usb" + }, "arduino_nano33iot": { "build": "cargo build --examples --features=unproven" }, From ad381133b48442c3901a6452c0e7ba8f8be6404e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karsten=20Gro=C3=9Fe?= Date: Tue, 3 Nov 2020 23:36:47 +0100 Subject: [PATCH 2/4] Fixed pins and added convenience functions for UART, I2C and SPI --- boards/arduino_zero/src/lib.rs | 104 ++++++++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 14 deletions(-) diff --git a/boards/arduino_zero/src/lib.rs b/boards/arduino_zero/src/lib.rs index b31441cd8ea8..72f78688fc97 100644 --- a/boards/arduino_zero/src/lib.rs +++ b/boards/arduino_zero/src/lib.rs @@ -10,8 +10,6 @@ pub use cortex_m_rt::entry; #[cfg(feature = "panic_halt")] pub extern crate panic_halt; -#[cfg(feature = "usb")] -use hal::clock::GenericClockController; #[cfg(feature = "usb")] use hal::usb::usb_device::bus::UsbBusAllocator; #[cfg(feature = "usb")] @@ -24,7 +22,10 @@ pub use hal::common::*; pub use hal::samd21::*; pub use hal::target_device as pac; -use gpio::{Floating, Input, Port}; +use gpio::{Floating, Input, PfC, Port}; +use hal::clock::GenericClockController; +use hal::sercom::{I2CMaster3, PadPin, SPIMaster1, UART0}; +use hal::time::Hertz; // The docs could be further improved with details of the specific channels etc define_pins!( @@ -63,8 +64,8 @@ define_pins!( /// SPI MOSI: PWM, TCC pin mosi = a16, - /// SPI SCK - pin sck = a17, + /// Digital 13/LED/SPI SCK: ON-BOARD-LED + pin led_sck = a17, /// SPI MISO: PWM, TC pin miso = a19, @@ -101,16 +102,9 @@ define_pins!( pin usb_n = a24, pin usb_p = a25, - pin usb_id = a18, + pin usb_id = a28, pin aref = a3, - pin sd_sck = a12, - pin sd_mosi = a13, - pin sd_ss = a14, - pin sd_miso = a15, - pin sd_cd = a27, - - /// LED built into the board - pin led_builtin = a17, + pin tx_led = a27, pin rx_led = b3, @@ -140,3 +134,85 @@ pub fn usb_allocator( usb, )) } + +/// Convenience for setting up the labelled SDA, SCL pins to +/// operate as an I2C master running at the specified frequency. +pub fn i2c_master>( + clocks: &mut GenericClockController, + bus_speed: F, + sercom3: pac::SERCOM3, + pm: &mut pac::PM, + sda: gpio::Pa22>, + scl: gpio::Pa23>, + port: &mut Port, +) -> I2CMaster3>, hal::sercom::Sercom3Pad1>> +{ + let gclk0 = clocks.gclk0(); + I2CMaster3::new( + &clocks.sercom3_core(&gclk0).unwrap(), + bus_speed.into(), + sercom3, + pm, + sda.into_pad(port), + scl.into_pad(port), + ) +} + +/// Convenience for setting up the labelled RX, TX pins to +/// operate as a UART device running at the specified baud. +pub fn uart>( + clocks: &mut GenericClockController, + baud: F, + sercom0: pac::SERCOM0, + pm: &mut pac::PM, + rx: gpio::Pa11>, + tx: gpio::Pa10>, + port: &mut Port, +) -> UART0< + hal::sercom::Sercom0Pad3>, + hal::sercom::Sercom0Pad2>, + (), + (), +> { + let gclk0 = clocks.gclk0(); + + UART0::new( + &clocks.sercom0_core(&gclk0).unwrap(), + baud.into(), + sercom0, + pm, + (rx.into_pad(port), tx.into_pad(port)), + ) +} + +/// Convenience for setting up the labelled SPI peripheral. +/// This powers up SERCOM4 and configures it for use as an +/// SPI Master in SPI Mode 0. +pub fn spi_master>( + clocks: &mut GenericClockController, + bus_speed: F, + sercom1: pac::SERCOM1, + pm: &mut pac::PM, + sck: gpio::Pa17>, + mosi: gpio::Pa16>, + miso: gpio::Pa19>, + port: &mut Port, +) -> SPIMaster1< + hal::sercom::Sercom1Pad3>, + hal::sercom::Sercom1Pad0>, + hal::sercom::Sercom1Pad1>, +> { + let gclk0 = clocks.gclk0(); + + SPIMaster1::new( + &clocks.sercom1_core(&gclk0).unwrap(), + bus_speed.into(), + hal::hal::spi::Mode { + phase: hal::hal::spi::Phase::CaptureOnFirstTransition, + polarity: hal::hal::spi::Polarity::IdleLow, + }, + sercom1, + pm, + (miso.into_pad(port), mosi.into_pad(port), sck.into_pad(port)), + ) +} From 90289a00bd6491b8fe50f37ba436db9d0eced7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karsten=20Gro=C3=9Fe?= Date: Tue, 3 Nov 2020 23:37:00 +0100 Subject: [PATCH 3/4] Fixed examples --- boards/arduino_zero/examples/blinky_basic.rs | 4 ++-- boards/arduino_zero/examples/pwm.rs | 2 +- boards/arduino_zero/examples/usb_logging.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boards/arduino_zero/examples/blinky_basic.rs b/boards/arduino_zero/examples/blinky_basic.rs index f4051f10025f..3b840ac71117 100644 --- a/boards/arduino_zero/examples/blinky_basic.rs +++ b/boards/arduino_zero/examples/blinky_basic.rs @@ -1,7 +1,7 @@ #![no_std] #![no_main] -extern crate arduino_mkrzero as hal; +extern crate arduino_zero as hal; use hal::clock::GenericClockController; use hal::delay::Delay; @@ -20,7 +20,7 @@ fn main() -> ! { &mut peripherals.NVMCTRL, ); let mut pins = hal::Pins::new(peripherals.PORT); - let mut led = pins.led_builtin.into_open_drain_output(&mut pins.port); + let mut led = pins.led_sck.into_open_drain_output(&mut pins.port); let mut delay = Delay::new(core.SYST, &mut clocks); loop { diff --git a/boards/arduino_zero/examples/pwm.rs b/boards/arduino_zero/examples/pwm.rs index 720bef65fd06..8710a3616b11 100644 --- a/boards/arduino_zero/examples/pwm.rs +++ b/boards/arduino_zero/examples/pwm.rs @@ -1,7 +1,7 @@ #![no_std] #![no_main] -extern crate arduino_mkrzero as hal; +extern crate arduino_zero as hal; extern crate atsamd_hal; use hal::clock::{GenericClockController, Tcc0Tcc1Clock}; diff --git a/boards/arduino_zero/examples/usb_logging.rs b/boards/arduino_zero/examples/usb_logging.rs index afea793bb016..373e8bf12341 100644 --- a/boards/arduino_zero/examples/usb_logging.rs +++ b/boards/arduino_zero/examples/usb_logging.rs @@ -1,7 +1,7 @@ #![no_std] #![no_main] -extern crate arduino_mkrzero as hal; +extern crate arduino_zero as hal; extern crate cortex_m; extern crate panic_halt; extern crate usb_device; @@ -35,7 +35,7 @@ fn main() -> ! { &mut peripherals.NVMCTRL, ); let mut pins = hal::Pins::new(peripherals.PORT); - let mut led = pins.led_builtin.into_open_drain_output(&mut pins.port); + let mut led = pins.led_sck.into_open_drain_output(&mut pins.port); let mut delay = Delay::new(core.SYST, &mut clocks); let bus_allocator = unsafe { From cb10067ef4ec7a0610621fd35e506337e1061311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karsten=20Gro=C3=9Fe?= Date: Tue, 3 Nov 2020 23:44:18 +0100 Subject: [PATCH 4/4] Updaed edition to 2018 --- boards/arduino_zero/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/arduino_zero/Cargo.toml b/boards/arduino_zero/Cargo.toml index 779250395eea..93e4480499b8 100644 --- a/boards/arduino_zero/Cargo.toml +++ b/boards/arduino_zero/Cargo.toml @@ -7,6 +7,7 @@ keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"] license = "MIT OR Apache-2.0" repository = "https://github.com/atsamd-rs/atsamd" readme = "README.md" +edition = "2018" [dependencies] cortex-m = "0.6"