Skip to content

Commit

Permalink
boards: adafruit: add initial support for feather m4 express
Browse files Browse the repository at this point in the history
The Adafruit Feather M4 Express is a compact, lightweight
ARM development board with an onboard mini NeoPixel, 2 MiB
of SPI flash, charging status indicator and user LEDs, USB
connector, 21 GPIO pins and a small prototyping area.

Signed-off-by: Teresa Zepeda Ventura <[email protected]>
  • Loading branch information
Terezvent committed Nov 7, 2024
1 parent c3466b1 commit 0d0eb4b
Show file tree
Hide file tree
Showing 11 changed files with 447 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
# SPDX-License-Identifier: Apache-2.0

config BOARD_ADAFRUIT_FEATHER_M4_EXPRESS
select SOC_SAMD51J19A
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2022, Gerson Fernando Budke <[email protected]>
* Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/pinctrl/samd51j-pinctrl.h>

&pinctrl {
sercom1_spi_default: sercom1_spi_default {
group1 {
pinmux = <PB23C_SERCOM1_PAD3>,
<PA17C_SERCOM1_PAD1>,
<PB22C_SERCOM1_PAD2>;
};
};

sercom2_i2c_default: sercom3_i2c_default {
group1 {
pinmux = <PA12C_SERCOM2_PAD0>,
<PA13C_SERCOM2_PAD1>;
};
};

sercom5_uart_default: sercom5_uart_default {
group1 {
pinmux = <PB17C_SERCOM5_PAD1>,
<PB16C_SERCOM5_PAD0>;
};
};

pwm0_default: pwm0_default {
group1 {
pinmux = <PA22G_TCC0_WO2>;
};
};
pwm1_default: pwm1_default {
group1 {
pinmux = <PA18F_TCC1_WO2>,
<PA19F_TCC1_WO3>;
};
};

usb_dc_default: usb_dc_default {
group1 {
pinmux = <PA25H_USB_DP>,
<PA24H_USB_DM>;
};
};
};
111 changes: 111 additions & 0 deletions boards/adafruit/feather_m4_express/adafruit_feather_m4_express.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* Copyright (c) 2020 Google LLC.
* Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <atmel/samd5xx19.dtsi>
#include "adafruit_feather_m4_express-pinctrl.dtsi"

/ {
model = "Adafruit Feather M4 Express";
compatible = "adafruit,feather-m4-express";

chosen {
zephyr,console = &sercom5;
zephyr,shell-uart = &sercom5;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};

/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
pwm-0 = &tcc0;
};

leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&porta 23 0>;
label = "LED";
};
};
};

&cpu0 {
clock-frequency = <120000000>;
};

&sercom5 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <1>;
txpo = <0>;
pinctrl-0 = <&sercom5_uart_default>;
pinctrl-names = "default";
};

&sercom1 {
status = "okay";
compatible = "atmel,sam0-spi";
dipo = <3>;
dopo = <0>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&sercom1_spi_default>;
pinctrl-names = "default";
};

&tcc0 {
status = "okay";
compatible = "atmel,sam0-tcc-pwm";
prescaler = <8>;
#pwm-cells = <2>;
pinctrl-0 = <&pwm0_default>;
pinctrl-names = "default";
};

zephyr_udc0: &usb0 {
status = "okay";
pinctrl-0 = <&usb_dc_default>;
pinctrl-names = "default";
};

&dmac {
status = "okay";
};

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "uf2";
reg = <0x00000000 DT_SIZE_K(16)>;
read-only;
};

code_partition: partition@4000 {
label = "code";
reg = <0x4000 DT_SIZE_K(512-16-16)>;
read-only;
};

/*
* The final 16 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@7c000 {
label = "storage";
reg = <0x7c000 DT_SIZE_K(16)>;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
identifier: adafruit_feather_m4_express
name: Adafruit Feather M4 Express
type: mcu
arch: arm
ram: 192
flash: 512
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- dma
- gpio
- hwinfo
- pwm
- spi
- uart
- usb_device
- watchdog
vendor: adafruit
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_ATMEL_SAMD5X_OSCULP32K_AS_MAIN=y

CONFIG_BOOTLOADER_BOSSA=y
CONFIG_BOOTLOADER_BOSSA_ADAFRUIT_UF2=y
CONFIG_BUILD_OUTPUT_HEX=y
CONFIG_BUILD_OUTPUT_UF2=y

CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y

CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
5 changes: 5 additions & 0 deletions boards/adafruit/feather_m4_express/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2020 Google LLC.
# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
5 changes: 5 additions & 0 deletions boards/adafruit/feather_m4_express/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board:
name: adafruit_feather_m4_express
vendor: adafruit
socs:
- name: samd51j19a
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0d0eb4b

Please sign in to comment.